VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Make any VB form stay always on top of every other Window form.

by nofx (8 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Thu 4th March 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Make any VB form stay always on top of every other Window form.

API Declarations


' CaptiveX TM. '
' Writen by nofx (op-ivy) '
'http://www.sharpnet.net/~nofx/'
'or visit us on EFNET #captivex'
' P.S. '
' Have Fun '


#If Win32 Then
Public Const HWND_TOPMOST& = -1
#Else
Public Const HWND_TOPMOST& = -1
#End If 'WIN32

#If Win32 Then
Const SWP_NOMOVE& = &H2
Const SWP_NOSIZE& = &H1
#Else
Const SWP_NOMOVE& = &H2
Const SWP_NOSIZE& = &H1
#End If 'WIN32

#If Win32 Then
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)
#Else
Declare Sub SetWindowPos Lib "user" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
#End If 'WIN32

Rate Make any VB form stay always on top of every other Window form.



Dim lFlags As Long
Dim lStay As Long

lFlags = SWP_NOSIZE Or SWP_NOMOVE
lStay = SetWindowPos(Form.hWnd, HWND_TOPMOST, 0, 0, 0, 0, lFlags)
End Function


Download this snippet    Add to My Saved Code

Make any VB form stay always on top of every other Window form. Comments

No comments have been posted about Make any VB form stay always on top of every other Window form.. Why not be the first to post a comment about Make any VB form stay always on top of every other Window form..

Post your comment

Subject:
Message:
0/1000 characters