We help IT Professionals succeed at work.

Problem with BM_CLICK

jrrandle
jrrandle asked
on
1,339 Views
Last Modified: 2007-12-19
Hello experts!
I am having problems clicking a button in another application. I have tried using SendMessage, and even though i see the message arrive at the button in Spy++, it does not respond?!

Thankyou in advance,
James.
Comment
Watch Question

Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009

Commented:
Perhaps the "button" you are trying to click is not really a button at all but another type of control that just looks like a button.

You could try sending WM_LBUTTONDOWN followed by WM_LBUTTONUP.

    private const UInt32 WM_LBUTTONDOWN = 0x201;
    private const UInt32 WM_LBUTTONUP = 0x202;

Author

Commented:
Idle Mind,
Thanks for your reply. That still doesn't work, and it's definitely a button (WindowsForms10.BUTTON.app3). I have observed all the messages sent to the button when i actually click it, and even replicated them (to the letter) but the application refuses to accept the click.

Interestingly, that code does work on a non .NET app? and also on a textbox in the same app, just not on the button... :o(

Do you have any other ideas?

Cheers again,
James.
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Idle,
It is now working?! Weird. BM_CLICK doesn't work, but LBUTTONDOWN LBUTTONUP works if i put a small delay in (100ms).

The points are yours - thanks for your help,
James.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.