Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

Tracking a CheckBox

Hi,

I want to track the clicking of a checkbox in an application I did not write. I want another program to tell me when the checkbox has been clicked...

Is that Possible?
0
maximebrunet
Asked:
maximebrunet
1 Solution
 
mark2150Commented:
Doubt that you can get this to work without access to the original source.

M

0
 
maximebrunetAuthor Commented:
I think you can track the menus with the windows API, couldn't you track checkboxes as well?
0
 
jjmartinCommented:
What application are you trying to monitor?  Perhaps there is an API you can use?  If not, I think you are out of luck.
0
 
BillabanCommented:
I suppose that if you REALLY wanted to get from here to there you could write an app that would recursively search the processes for the app you didn't write (with the checkbox).  I presume that you would use the "Like" operator and string comparison to find the app.  Then enum (e.g., EnumChildWindows) the child window(s) (recursively if necessary) using the same technique to find the host of the highly touted checkbox.  Now you have the window hwnd of the checkbox host window.  This is where it would start to get ugly.  If you are familiar with the Visual Studio Spy tool (particularly the "Find Window" feature) u can confirm that a checkbox is just a button class object with style = 50000002.  If U don't have Spy there are other tools that provide the same insight into running app's.... Visual Test has one.  Now enum the controls of the window with the same EnumChildWindow technique and find the object with the desired button class and style.  If u have more than one checkbox in the enumeration - you have a problem differentiating.  Once you have the hwnd of the control u can determine the state and use PostMessage or SendMessage to convey as much to your app.  A connection point on a COM object doing all this would be more better but certainly not necessary.  Whew... I'm goin home.  HTH
0
 
mark2150Commented:
Like I said, you're probably not going to get this to work without access to the original code.

M

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now