This code shows how to obtain the Notepad About box button handle.
Hope this will solve the issue.Code: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 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Sub Command1_Click() Dim lngresult As Long lngresult = FindWindow(vbNullString, "About Notepad") lngresult = FindWindowEx(lngresult, 0&, vbNullString, "OK") 'OK IS THE Button text MsgBox lngresult End Sub
Good Luck




Reply With Quote