注册 登录
编程论坛 VB6论坛

怎么枚举一个主窗体内子窗体的类名

sdhtli 发布于 2012-04-18 14:57, 811 次点击
请教各位老师怎么枚举一个主窗体内子窗体的类名判断是否包含一个excelb的类名,谢谢
4 回复
#2
kevinqq2012-04-23 01:43
用FindWindow 先找到主窗口句柄
然后通过FindWindwos 找子窗体的类名
找到了句柄会大于0
#3
kevinqq2012-04-23 01:48

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Public Function GetChilHwnd(ByVal 窗口标题 As string ,byval 子窗口类名 as string ) As Long
    Dim hwwd As Long
    hwnd=FindWindow(vbnullstring,窗口标题)
    hwwd = FindWindowEx(MeHwnd, 0, 子窗口类名, vbNullString)
GetWebBrowserHwnd = hwwd
End Function
#4
bczgvip2012-04-25 21:44
EnumChildWindows '枚举子窗体。
#5
l66854192013-04-03 11:35
求vb枚举编程实例程序
1