choonghooi
asked on
How to send click event to button on other application
Hi,
Anyone know how to send "click" to button on other application. I tried alot of example from internet but still no luck.
Below is a portion of my existing code:
Dim hwnd As Long
hwnd = FindWindowEx(hwnd, 0, "Button", "Cancel") 'vbNullString)
If hwnd = 0 Then
MsgBox("Couldn't find the button")
Exit Sub
End If
'PostMessage(hwnd, BM_CLICK, 0, 0)
I do not know why its not working. Need help.
Anyone know how to send "click" to button on other application. I tried alot of example from internet but still no luck.
Below is a portion of my existing code:
Dim hwnd As Long
hwnd = FindWindowEx(hwnd, 0, "Button", "Cancel") 'vbNullString)
If hwnd = 0 Then
MsgBox("Couldn't find the button")
Exit Sub
End If
'PostMessage(hwnd, BM_CLICK, 0, 0)
I do not know why its not working. Need help.
ASKER
Idle_Mind,
Thanks :)
I need to sendmessage to hide a toolbar inside pdf. By using spy++, i found out that the toolbar described as Window 00B51286 "AVToolBarEasel" AVL_AVView, i try the below codes:
hwnd_box = FindWindowEx(app_hwnd, 0, "AVL_AVView", "AVToolBarEasel")
PostMessage(hwnd_box, SW_HIDE, 0, 0)
However i coudnt get the handler for AVToolBarEasel, any idea? Please refer to the attached print screen, there are several entries of AVL_AVView and the highlighted is the correct one.
AVToolBarEasel.GIF
Thanks :)
I need to sendmessage to hide a toolbar inside pdf. By using spy++, i found out that the toolbar described as Window 00B51286 "AVToolBarEasel" AVL_AVView, i try the below codes:
hwnd_box = FindWindowEx(app_hwnd, 0, "AVL_AVView", "AVToolBarEasel")
PostMessage(hwnd_box, SW_HIDE, 0, 0)
However i coudnt get the handler for AVToolBarEasel, any idea? Please refer to the attached print screen, there are several entries of AVL_AVView and the highlighted is the correct one.
AVToolBarEasel.GIF
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks alot :)
To convert to VB.Net you need to change all "Long" to "Integer". (You can use "IntPtr" for window handles instead.)
Don't forget to change any other API declarations and all of your local variables as well...
So it would look like:
Open in new window