Results 1 to 40 of 44

Thread: [RESOLVED] menuItemExecute

Threaded View

  1. #38
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: menuItemExecute

    This code shows how to obtain the Notepad About box button handle.

    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
    Hope this will solve the issue.
    Good Luck
    Last edited by Fazi; Oct 22nd, 2007 at 05:48 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width