Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI, all................

I am developing a project where i want to access an application through strictly using messages. So i want to simulate click on menu using SendMessage.
Does anyone know complete code about how to click on menu to see list of menu items.

My code works in client area but i am unable to click on non-client area.

Thanks in advance.
Posted
Updated 11-Sep-11 20:36pm
v2

1 solution

Don't do it! This is a really bad style of programming which will give you hard time a bit later. If you already came to the situation you need it, change your design; what you have now is wrong and will lead you nowhere.

Instead, have a separate function which is called from the handler of a menu item click and elsewhere.

If by some reason you still need to simulate a click or a keyboard input, use Windows API SendInput. It is low-level and highly universal, works exactly if you did the input using hardware. See http://msdn.microsoft.com/en-us/library/ms646310(v=vs.85).aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900