settop.bas
来自「solidworks 2007 二次开发」· BAS 代码 · 共 35 行
BAS
35 行
Attribute VB_Name = "KeepOnTop"
Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
Declare Function GetModuleUsage Lib "Kernel32" (ByVal hModule As Integer) As Integer
' SetWindowPos Flags
Global Const SWP_NOSIZE = &H1
Global Const SWP_NOMOVE = &H2
Global Const SWP_NOZORDER = &H4
Global Const SWP_NOREDRAW = &H8
Global Const SWP_NOACTIVATE = &H10
Global Const SWP_DRAWFRAME = &H20
Global Const SWP_SHOWWINDOW = &H40
Global Const SWP_HIDEWINDOW = &H80
Global Const SWP_NOCOPYBITS = &H100
Global Const SWP_NOREPOSITION = &H200
Global Const HWND_TOPMOST = -1
Sub SetTopMost(ByVal hWindow As Long, ByVal fBool As Integer)
SetWindowPos hWindow, HWND_TOPMOST - Abs(Not fBool), 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
Sub WaitTillDone(ByVal hWindow As Integer)
Do While GetModuleUsage(hWindow) > 0
DoEvents
Loop
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?