I'm using VS2k10 c#
Here is what I am trying to do.
Have a program that you have to press a refresh button, it doesn't have a hotkey so I can't send F5 key to the window so I need to send WM_LBUTTONDOWN and WM_LBUTTONUP on a button. This will be for other people on other machines as well not just mine.
Also as you can see below one of the window text changes with user login creds. idk if this matters or not. Also the window may not always have focus so I need it to issue the click without it being in focus. (Example. split windows or dual monitors, app may not have main focus but it is still viewable)
Now I know I need to grab info from spy++ (*I think anyhow lol*) so here is the run down of the location of the button I want pressed.
|
Here is what I attempted to do before but I know its wrong.
|
again no idea if this is correct or if I am in the ball park of this being correct.
Thanks in advance.
Sam HobbsPosted Jul 12, 2010, 3:49 PM
One common mistake that beginners often make is to try sending mouse messages to a button to click the button. First I must say that I have no guess what you mean by "press a refresh button, it doesn't have a hotkey so I can't send F5 key", so I might entirely misunderstand everything you are saying. If I understand, then you need to send a BN_CLICKED message to the parent window; the parent of the button. This will solve all your problems and you can usually use Spy++ to get the control id that is needed for the message.