|
-
Oct 5th, 2006, 06:01 AM
#1
Thread Starter
Fanatic Member
[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.
Last edited by TTn; Oct 5th, 2006 at 03:59 PM.
-
Oct 5th, 2006, 08:35 AM
#2
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.
-
Oct 5th, 2006, 11:59 AM
#3
Thread Starter
Fanatic Member
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.
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.

[EDIT]
I've edited the first post, to show the button's caption.
Last edited by TTn; Oct 5th, 2006 at 12:09 PM.
-
Oct 5th, 2006, 03:59 PM
#4
Thread Starter
Fanatic Member
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]
-
Oct 5th, 2006, 06:12 PM
#5
Re: [RESOLVED]Sendmessage radio button click
why not send a BM_CLICK message
-
Oct 5th, 2006, 06:23 PM
#6
Thread Starter
Fanatic Member
Re: [RESOLVED]Sendmessage radio button click
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|