VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Set your Window on top of all forms using SetWindowPos API

by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 14th February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Set your Window on top of all forms using SetWindowPos API

API Declarations


Const HWND_BOTTOM = 1 ' Put the window at the bottom of the Z-order.
Const HWND_NOTOPMOST = -2 ' Put the window below all topmost windows and above all non-topmost windows.
Const HWND_TOP = 0 'Put the window at the top of the Z-order.
Const HWND_TOPMOST = -1 'Make the window topmost of all other windows.
Const SWP_FRAMECHANGED = &H20 'The frame changed: send WM_NCCALCSIZE
Const SWP_DRAWFRAME = SWP_FRAMECHANGED
Const SWP_HIDEWINDOW = &H80
Const SWP_NOACTIVATE = &H10
Const SWP_NOMOVE = &H2
Const SWP_NOCOPYBITS = &H100
Const SWP_NOOWNERZORDER = &H200
Const SWP_NOREDRAW = &H8
Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H4
Const SWP_SHOWWINDOW = &H40
Dim rval As Long

Rate Set your Window on top of all forms using SetWindowPos API



'Bring to normal condition
rval = SetWindowPos(Form1.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE)
End Sub

Private Sub Form_Load()
'Set window on top of all
rval = SetWindowPos(Form1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE)
End Sub
'Visit my Homepage at
'http://www.geocities.com/marskarthik
'http://marskarthik.virtualave.net
'Email: [email protected]

Download this snippet    Add to My Saved Code

Set your Window on top of all forms using SetWindowPos API Comments

No comments have been posted about Set your Window on top of all forms using SetWindowPos API. Why not be the first to post a comment about Set your Window on top of all forms using SetWindowPos API.

Post your comment

Subject:
Message:
0/1000 characters