Make a form stay on top of all other applications
Make a form stay on top of all other applications
API Declarations
Const SWP_NOSIZE = 1
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Rate Make a form stay on top of all other applications
(1(1 Vote))
(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
Public Function SetTopMostWindow(hwnd As Long, Topmost As Boolean) As Long
If (Topmost) Then
SetTopMostWindow = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
Else
SetTopMostWindow = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
SetTopMostWindow = False
End If
End Function
'SetTopMostWindow Me.hwnd, (TRUE,FALSE)
Private Sub Form_Load()
SetTopMostWindow Me.hwnd, TRUE
End Sub
Make a form stay on top of all other applications Comments
No comments yet — be the first to post one!
Post a Comment