If you would like to keep your window on top follow these steps - Add this code to your project you will need to add a timer named timer1 and add a checkbox named Check1 set the caption to "Stay On Top" set the timers interval to 1000 - (the lower the interval the quicker the window gets to the top) although 1000 should be fine since it is ever second '-------------------CODE BELOW-----------------------------
[color green]
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Private Sub Check1_Click()
If Check1.Value = True Then
Timer1.Enabled = True
ElseIf Check1.Value = False Then
res& = SetWindowPos(me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
Timer1.Enabled = False
End If
End Sub
Private Sub Timer1_Timer()
res& = SetWindowPos(me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
End Sub
[/color]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.