📄 api回调函数.bas
字号:
Attribute VB_Name = "Module1"
Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Long
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
Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, IpRect As Rect) As Long
Global Const gcSetCaption = 1
Global Const gcSetPos = 2
Type Rect
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Function EnumChildProc(ByVal hWnd As Long, ByVal IParam As Long) As Boolean
Dim R As Rect
Select Case IParam
Case gcSetCaption
SetWindowText Form1.hWnd, "New Caption"
Case gcSetPos
If GetWindowRect(Form1.hWnd, R) Then
SetWindowPos Form1.hWnd, 0, R.Left + 20, R.Top + 20, R.Right - R.Left, R.Bottom - R.Top, 0
End If
End Select
EnumChildProc = True
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -