Private Declare Function SetWindowPos Lib "USER32.DLL" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As Long) As Boolean
Const SWP_NOMOVE = &H2 '不更动目前视窗位置
Const SWP_NOSIZE = &H1 '不更动目前视窗大小
Const HWND_TOPMOST = -1 '设定为最上层
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Dim bTopMost As Boolean
Private Sub Form_Load()
If bTopMost = False Then
SetWindowPos Me.hWnd, HWND_TOPMOST, Me.Left, Me.Top, Me.Width, Me.Height, FLAGS
bTopMost = True
End If