hello!!
how can my program be always ontop.
Printable View
hello!!
how can my program be always ontop.
1) Make 2 command buttons (Command1, Command2)
place this code into form
private Declare Function SetWindowPos Lib "user32" (byval h%, byval hb%, byval X%, byval Y%, byval cx%, byval cy%, byval F%) as Integer
Const flags = SWP_NOMOVE Or SWP_NOSIZE
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
private Sub Command1_Click()
SetWindowPos me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, flags
End Sub
private Sub Command2_Click()
SetWindowPos me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, flags
End Sub
Clicking Command1 will activate "on top"
Clicking Command2 will remove "on top"