奇门遁甲

Excel窗口始终在最前缘

2020-06-02  本文已影响0人  cugliming
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 HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2

Sub 窗口总在最前面()
SetWindowPos Application.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
End Sub
Sub 恢复()
SetWindowPos Application.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
End Sub
上一篇下一篇

猜你喜欢

热点阅读