VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Keep a form on top

omidles  (4 Submissions)   Custom Controls/Forms/Menus   VB 6.0   Unknown Difficulty   Fri 11th November 2005   Mon 8th February 2021

Keep a form on top

API Declarations


Private Const HWND_NOTOPMOST = -2
Private Const HWND_TOP = 0
Private Const HWND_TOPMOST = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1

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
Private Declare Function GetActiveWindow Lib "user32" () As Long

Public Sub MakeWindowAlwaysTop(hwnd As Long)
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
End Sub

Public Sub MakeWindowNotTop(hwnd As Long)
SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
End Sub

Rate Keep a form on top (1(1 Vote))
Keep a form on top.bas

Keep a form on top Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters