jsw3nson
asked on
Send Alt+key to a window
I need to automate selecting a menu of application. The application uses a third-party menu control, so I can send a wm_command to the menu. It does respond to keystrokes, so I would like to do a postmessage that will send the alt+key to the window. For example 'ALT+F' to open the file menu. I have gotten to the point were I can do a postmessage to send keys to a text box. Now I need to know how to add the 'ALT' key too.
Thanks,
Jeff
Thanks,
Jeff
If the visual basic way (described by roos01 above) does not work, you can try using the win32 API
function "keybd_event".
http://www.vbaccelerator.com/home/VB/Tips/SendKeys_using_the_API/article.asp
http://www.devx.com/vb2themax/Tip/19094
function "keybd_event".
http://www.vbaccelerator.com/home/VB/Tips/SendKeys_using_the_API/article.asp
http://www.devx.com/vb2themax/Tip/19094
ASKER
Thank you for the replys.
I want to send the key to a window/ application that I do not own. So application.SendKeys won't work. Also, I don't want to give focus up when I send the keys so, a keybd_event won't work either.
What I really need is how to send or post a message using WM_KEYUP / DOWN and the 'ALT' key.
Thanks agian for the help.
I want to send the key to a window/ application that I do not own. So application.SendKeys won't work. Also, I don't want to give focus up when I send the keys so, a keybd_event won't work either.
What I really need is how to send or post a message using WM_KEYUP / DOWN and the 'ALT' key.
Thanks agian for the help.
I think WM_SYSKEYDOWN is the equivalant for sending Alt Control etc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
GPrentice00, Thanks for your effort!
Jeroen
Jeroen
Application.SendKeys "%f"
regards,
Jeroen