I need to use SendMessage fro simulating user clicks in a target program as SendMessage blocks until the event that it triggers is finished processing. The reason for this is that this blocking gives opportunity to detect if any dialogs have opened up as a result of the clicking. My problem currently is that although I can get the click to work using WM_LBUTTONDOWN and WM_LBUTTONUP messages consecutivly on a button in a mocked up form which opens a model dialog, I cannot get it to work on menus and menu items in a standard windows app (Notepad). Any help in getting the ability to perform clicks on menu items in a way which works would be apprecieated. I can already detect if it is a menu item, just need to be able to simulate a click on it with blocking using SendMessage.
Cheers
Ross