精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● VB和Basic>>〓〓..API 函数使用..〓〓>>窗体和显示相关>>有关“如何获得一个按钮的句柄”

主题:有关“如何获得一个按钮的句柄”
发信人: gzwsh(小伟)
整理人: winsy(2003-03-05 15:56:15), 站内信件
看了精华区“如何获得一个按钮的句柄”一文,见其中没有内容,不知道
是什么意思,现给出一个获得一个按钮的句柄的方法。
用API实现:
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

Function GetButton(ByVal Form As String, ByVal Button As String) As Long
Dim FromhWnd As Long
FromhWnd = FindWindowEx(0, 0, vbNullString, Form)
GetButton = FindWindowEx(FromhWnd, 0, vbNullString, Button)
End Function

[关闭][返回]