iWinSt = Me.WindowState
showWindow Me.hwnd, SW_NORMAL
SetBorder Me.hwnd, False '无边框
Me.Refresh
If iWinSt = 2 Then showWindow Me.hwnd, SW_MAXIMIZE
'[0.9.18] 设置无边框会使全屏扩大两个边框,且偏移一个边框。先Normal后Maximize
'设有无标题栏
Public Sub SetBorder(shWnd As Long, bB As Boolean)
Dim lStyle As Long
lStyle = GetWindowLong(shWnd, GWL_STYLE)
If bB Then
lStyle = lStyle Or WS_THICKFRAME Or WS_CAPTION
SetWindowLong shWnd, GWL_STYLE, lStyle
SetWindowPos shWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOZORDER Or SWP_DRAWFRAME Or SWP_NOMOVE Or SWP_NOSIZE
Else
lStyle = lStyle And Not WS_THICKFRAME And Not WS_CAPTION '去掉边框和标题栏
SetWindowLong shWnd, GWL_STYLE, lStyle
SetWindowPos shWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOZORDER Or SWP_DRAWFRAME Or SWP_NOMOVE Or SWP_NOSIZE '[0.9.16]修改
End If
End Sub