Jump to content
Macro Express Forums

How to get the state of a check box control


Cory

Recommended Posts

From time to time I open a dialog box and want to make sure a certain box is checked as part of my process. But one can’t blindly click on it because one doesn’t know what the existing state is. With the control commands one can get the text of a control which is something I often do but this doesn’t work for check boxes. I suspect there isn’t a way short of ‘get pixel color or something to do what I want but I thought I would ask in case I’m missing something. So far I’ve been able to check if another control is enabled or not and when that doesn’t work I try and find where the state is stored in the registry but it would be easier if I could somehow get the state from the control. Not only that but sometimes registry values are mystifying.

Link to comment
Share on other sites

  • 2 weeks later...

Yes but with distributed macros this does not always work so I try to avoid GPC. You see depending on color depth on the playing computer, skins and other things one can run into pixels with different colors on different machines. These can be dealt with but it's more work. Mainly I feel that the proper way would be to have something like the Get Control Text that would return the state.

 

Having said all this I found a better workaround and now think that this is actually a better approach all together. That is to go into the registry or INI file and get or change those settings there. For instance I was working in IrfanView and was going a batch process. There's an advanced settings dialog box and I needed to make sure everything was configured correctly. Problem is that's about 30 different check boxes and values. So by checking and changing the INI file I was able to enforce those settings instantly without even having to open the dialog box. Much smarter.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...