窗口句柄.frm

来自「Windows API函数,希望大伙有用哦」· FRM 代码 · 共 37 行

FRM
37
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "窗体 1"
   ClientHeight    =   1395
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   1395
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Alignment       =   2  'Center
      Height          =   345
      Left            =   750
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   450
      Width           =   2955
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Sub Form_Load()
    Dim Title As String
    Title = String(100, Chr$(0))
    GetWindowText Me.hwnd, Title, 100
    Title = Left$(Title, InStr(Title, Chr$(0)) - 1)
    Text1 = Title
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?