Click TSpeedBtn

J

Joe Thompson

Hi,

I am trying to control an app that was written in Borland C++ Builder with
my app written in C# 2008. I can get the handle to most controls I need
except for two buttons. I have determined they are TSpeedBtn's using Spy++.
I can get all the way down to the handle of the TPanel they are in. This is
where the trouble starts.

I can simulate clicking the buttons by using SetCursorPos and then sending
LeftButtonDown then LeftButtonUp to the screen cordinates (which I've also
gotten using FindWindowRect on nearby controls with handles).

The problem is, we want the app I am trying to control off screen and I
can't seem to move the cursor there. I was hoping I could send the TPanel a
button click message with x y coordinates relative to the panel itself but
either that doesn't work or I'm doing something wrong.

Does anyone have any ideas on how to accomplish this?

Thank you,
Joe
 
M

Michael C

Joe Thompson said:
Hi,

I am trying to control an app that was written in Borland C++ Builder with
my app written in C# 2008. I can get the handle to most controls I need
except for two buttons. I have determined they are TSpeedBtn's using
Spy++.
I can get all the way down to the handle of the TPanel they are in. This
is
where the trouble starts.

I can simulate clicking the buttons by using SetCursorPos and then sending
LeftButtonDown then LeftButtonUp to the screen cordinates (which I've also
gotten using FindWindowRect on nearby controls with handles).

The problem is, we want the app I am trying to control off screen and I
can't seem to move the cursor there. I was hoping I could send the TPanel
a
button click message with x y coordinates relative to the panel itself but
either that doesn't work or I'm doing something wrong.

Does anyone have any ideas on how to accomplish this?

Use Spy++ to capture the messages sent to the button or host window when you
click it and then simulate these messages. You could also try sending
shortcut keys such as Alt-X or whatever, assuming they have them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top