Article ID: 178401
Article Last Modified on 5/12/2003
Form1 Form Property Setting --------------------------------------- BorderStyle 0-None StartUpPosition 2-CenterScreen
Option Explicit
Private 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) As Long
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Private Sub Form_Load()
Dim lngWindowPosition As Long
Command1.Caption = "Show Message Box"
Command2.Caption = "End Program"
LngWindowPosition = SetWindowPos(Form1.hwnd, _
HWND_TOPMOST, _
0, _
0, _
0, _
0, _
SWP_NOMOVE Or SWP_NOSIZE)
End Sub
Private Sub Command1_Click()
MsgBox "From Message Box", vbSystemModal
End Sub
Private Sub Command2_Click()
End
End Sub
Additional query words: topmost top most modal
Keywords: kbapi kbprb KB178401