?? pro2.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3690
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3690
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 315
Left = 420
TabIndex = 2
Top = 300
Width = 1275
End
Begin VB.TextBox Text1
Height = 1875
Left = 60
MultiLine = -1 'True
TabIndex = 1
Top = 1680
Width = 4575
End
Begin VB.PictureBox Picture1
BackColor = &H00FF8080&
ForeColor = &H00000000&
Height = 1395
Left = 2820
ScaleHeight = 1335
ScaleWidth = 1755
TabIndex = 0
Top = 60
Width = 1815
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 GetParent& Lib "user32" (ByVal hWnd As Long)
Private Declare Function GetTopWindow& Lib "user32" (ByVal hWnd As Long)
Private Declare Function SetParent& Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long)
Private Declare Function GetClassName& Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long)
Private Sub Command1_Click()
Dim dl&
dl& = SetParent(Command1.hWnd, Picture1.hWnd)
Command1.Move (Picture1.Width - Command1.Width) \ 2, (Picture1.Height - Command1.Height) \ 2
info Command1, Command1.hWnd
End Sub
Private Sub Form_Click()
info Form1, Form1.hWnd
End Sub
Private Sub Picture1_Click()
info Picture1, Picture1.hWnd
End Sub
Sub info(obj As Object, hWnd As Long)
Dim TxtName As String * 256
Dim TextLength As Long
Dim dl As Long
Dim Handle As Long
Text1.Text = "名稱∶" & obj.Name & Chr(13) & Chr(10)
TextLength = GetClassName(hWnd, TxtName, 255) '獲得類名
Text1.Text = Text1.Text & "類名∶" & Left(TxtName, TextLength) & Chr(13) & Chr(10)
Handle& = GetParent(hWnd) ' 檢查是否存在父窗口
If Handle Then
TextLength = GetClassName(Handle, TxtName, 255)
Text1.Text = Text1.Text & "父窗口∶" & Left(TxtName, TextLength) & Chr(13) & Chr(10)
Else
Text1.Text = Text1.Text & "父窗口∶" & "沒有" & Chr(13) & Chr(10)
End If
Handle& = GetTopWindow(hWnd) '檢查是否存在子窗口
If Handle Then
TextLength = GetClassName(Handle, TxtName, 255)
Text1.Text = Text1.Text & "第一個子窗口∶" & Left(TxtName, TextLength) & Chr(13) & Chr(10)
Else
Text1.Text = Text1.Text & "第一個子窗口∶" & "沒有" & Chr(13) & Chr(10)
End If
End Sub
Private Sub Text1_Click()
info Text1, Text1.hWnd
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -