VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Make a form stay on top.

by Chris Johnston (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 27th May 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Make a form stay on top.

API Declarations



Global Const conHwndTopmost = -1
Global Const conHwndNoTopmost = -2
Global Const conSwpNoActivate = &H10
Global Const conSwpShowWindow = &H40


Rate Make a form stay on top.



'You must make a menu and call it mnuStayOnTop.
'However, the menu does not have to be visible.
'You can change the 0, 0, 205, 141, to whatever you like.
'0, 0, is top left corner of the screen.

If mnuStayOnTop.Enabled = True Then
SetWindowPos hwnd, conHwndTopmost, 0, 0, 205, 141, conSwpNoActivate Or conSwpShowWindow
Else
mnuStayOnTop.Enabled = False
SetWindowPos hwnd, conHwndNoTopmost, 100, 100, 205, 141, conSwpNoActivate Or conSwpShowWindow
End If

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