Cory Posted September 22, 2007 Report Share Posted September 22, 2007 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. Quote Link to comment Share on other sites More sharing options...
joe Posted September 23, 2007 Report Share Posted September 23, 2007 Is this checkbox from a form on, say, the web ... an html document, or is it in a program? Quote Link to comment Share on other sites More sharing options...
Cory Posted September 24, 2007 Author Report Share Posted September 24, 2007 It's in an application. It's a proper control and I can 'get control text' but it only returns the label, not the state. Quote Link to comment Share on other sites More sharing options...
cyberchief Posted September 28, 2007 Report Share Posted September 28, 2007 It's in an application. It's a proper control and I can 'get control text' but it only returns the label, not the state. I would be interested in this as well... have run across this a few times. Also in an application. Quote Link to comment Share on other sites More sharing options...
mrpaperplate Posted October 7, 2007 Report Share Posted October 7, 2007 I would be interested in this as well... have run across this a few times. Also in an application. ©ouldn't you use something like get pixel color from the center of your check box? Quote Link to comment Share on other sites More sharing options...
Cory Posted October 8, 2007 Author Report Share Posted October 8, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.