[RESOLVED]Sendmessage radio button click
I've looked around here, and found some examples, but still cant get this API to click a radio button. This is stupid, it must be me.
Is this how the API should be called?
VB Code:
lhWndParent = exe.MainWindowHandle.ToInt32
lhWndButton = FindWindowEx(lhWndParent, 0, "Button", "&Continue sieving an old file")
SendMessage(lhWndButton, WM_COMMAND, 0, 0)
'or
SendMessage(lhWndParent, WM_COMMAND, lhWndButton, 0)
I've tried several variations, and wonder if it's a problem with the recieving application... or me.
Re: Sendmessage radio button click
It must be the first one, because the last 2 parameters are message-specific info.
What errors are you getting?? And make sure that you are getting the handle of the desired radio button.
Re: Sendmessage radio button click
I'm not getting any errors directly, but it isn't clicking the button.
The handle should be right(findwindowex), since I can disable the button via that handle. I used SPY++ to find the Button's caption, and class name "Button". It's not working on a regular button either. :confused:
The program in question, can be found here:
http://primes.utm.edu/programs/NewPGen/
I want to click the start/stop button, and the radio check button, for new/old file.
:blush:
[EDIT]
I've edited the first post, to show the button's caption.
Re: Sendmessage radio button click
I guess two lines will have to do for now:
VB Code:
SendMessage(lhWndOldButton, WM_KEYDOWN, VK_SPACE, 0)
SendMessage(lhWndOldButton, WM_KEYUP, VK_SPACE, 0)
This seems to work for the regular button too. duh
[RESOLVED]
Re: [RESOLVED]Sendmessage radio button click
why not send a BM_CLICK message
Re: [RESOLVED]Sendmessage radio button click
Quote:
why not send a BM_CLICK message
Because I didn't know it was there, ofcouse. lol
Thanks, I'll try it and rate ya.