VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Make a form stay on top.

by PETRIUS MELO (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Mon 10th January 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Make a form stay on top.

API Declarations


Const KEYEVENTF_KEYUP = &H2
Const VK_LWIN = &H5B
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub 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)

Rate Make a form stay on top.



   SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub
 
Private Sub Timer1_Timer()  'interval = 1
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub
'code by Petrius Melo------- E-mail : [email protected]

Download this snippet    Add to My Saved Code

Make a form stay on top. Comments

No comments have been posted about Make a form stay on top.. Why not be the first to post a comment about Make a form stay on top..

Post your comment

Subject:
Message:
0/1000 characters