Keeping a window on top

BlitzMax Forums/BlitzMax Programming/Keeping a window on top

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If you have maxgui and you are on windows, this works:
Const HWND_TOP:Int					= 0
Const HWND_TOPMOST:Int				= -1

Function AlwaysOnTop(gad:TGadget,mode:Int=HWND_TOP)
	Local hwnd:Int = QueryGadget(gad,QUERY_HWND)
	SetWindowPos( hwnd,mode, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE)
End Function

Local win:TGadget = CreateWindow("yo",100,100,100,100)
AlwaysOnTop(win,HWND_TOPMOST)

While WaitEvent()
	If EventID() = EVENT_WINDOWCLOSE
		End
	EndIf
Wend