获取控件窗口的句柄的标题并执行输入

时间:2018-08-12 03:16:32
【文件属性】:

文件名称:获取控件窗口的句柄的标题并执行输入

文件大小:20KB

文件格式:XLSM

更新时间:2018-08-12 03:16:32

句柄 窗口

Private Sub CommandButton1_Click() Dim ret As Long Dim hwnd As Long Dim str As String * 256 ret = GetDesktopWindow() hwnd = GetWindow(ret, GW_CHILD) Do While hwnd <> 0 GetWindowText hwnd, str, Len(str) hwnd = GetWindow(hwnd, GW_HWNDNEXT) If Left$(str, 1) <> vbNullChar Then UserForm1.ListBox1.AddItem str UserForm1.TextBox1.Text = str End If Loop End Sub


网友评论