Enumerate the sub-window handle in the window, class name

xiaoxiao2021-03-06  41

'Code by 魑 魑 魍魉' Mailto: DemonStudio@hotmail.com

Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As LongPrivate Declare Function GetClassName Lib "user32" Alias ​​"GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long

Private const gw_child = 5Private const gw_hWndnext = 2

Private Sub Form_Load () DIM HWD, CLA AS Longdim Lon as stringlon = space (255) HWD = getWindow (me.hwnd, gw_child) get the first sub-window handle Me.caption = hwddo while hwd <> 0 'If the handle < > 0 Cycle CLA = GetClassName (HWD, LON, 255) 'Name List1.AddItem HWD & "& Trim $ (lon) in this sub-window List1.additem HWD &" & TRIM $ (lon) 到 to list1 hwd = getWindow (hwind, gw_hwndnext ) 'Find Next Loopend Sub

转载请注明原文地址:https://www.9cbs.com/read-119373.html

New Post(0)