⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 api回调函数.bas

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 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 + -