VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Keep a window always on top of other To keep your form always on top call the SetWindowOnTop Me, Tr

by Thomas Kaloyani (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 4th August 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Keep a window always on top of other To keep your form always on top call the SetWindowOnTop Me, True and to deactivate the always on top of

API Declarations


Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40

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


Rate Keep a window always on top of other To keep your form always on top call the SetWindowOnTop Me, Tr



   Dim iFlag As Long

   iFlag = IIf(bAlwaysOnTop, HWND_TOPMOST, HWND_NOTOPMOST)

   SetWindowPos f.hwnd, iFlag, f.Left / Screen.TwipsPerPixelX, f.Top / Screen.TwipsPerPixelY, _
                f.Width / Screen.TwipsPerPixelX, f.Height / Screen.TwipsPerPixelY, SWP_NOACTIVATE Or SWP_SHOWWINDOW
End Sub

Download this snippet    Add to My Saved Code

Keep a window always on top of other To keep your form always on top call the SetWindowOnTop Me, Tr Comments

No comments have been posted about Keep a window always on top of other To keep your form always on top call the SetWindowOnTop Me, Tr. Why not be the first to post a comment about Keep a window always on top of other To keep your form always on top call the SetWindowOnTop Me, Tr.

Post your comment

Subject:
Message:
0/1000 characters