ChiGGz Posted January 18, 2008 Share Posted January 18, 2008 (edited) Hey guys, I have problems trying to properly access a CheckBox within an application programmed in C++ .NET I am able to toggle the CheckBox via ControlCommand ( $hWndAccount, "", $autoRKeyIKE_CID, "Check", "" ) but am not able not UNCHECK and more importantly, use the ISCHECKED function. Please help if you can. It is absolutely important to my program that I am able to properly modify a CheckBox ! Thank-you very much Edited January 18, 2008 by ChiGGz Link to comment Share on other sites More sharing options...
Developers Jos Posted January 18, 2008 Developers Share Posted January 18, 2008 What is the au3info information for the control ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ChiGGz Posted January 18, 2008 Author Share Posted January 18, 2008 (edited) What is the au3info information for the control ?Hey Jos, not exactly sure what info you are looking for, but here is all of it>>>> Window <<<<Title: Create New VPN AccountClass: WindowsForms10.window.8.app.0.378734aPosition: 193, 217Size: 656, 510Style: 0x16C80000ExStyle: 0x00010300Handle: 0x00B902EC>>>> Control <<<<Class: WindowsForms10.BUTTON.app.0.378734aInstance: 13ClassnameNN: WindowsForms10.BUTTON.app.0.378734a13ID: 12977202Text: Propose AllPosition: 142, 111Size: 79, 17ControlClick Coords: 57, 11Style: 0x5601000BExStyle: 0x00000000Handle: 0x00C60432This will be an issue if it cannot be figured out Edited January 18, 2008 by ChiGGz Link to comment Share on other sites More sharing options...
Developers Jos Posted January 18, 2008 Developers Share Posted January 18, 2008 I have had it several times that the control wasn't detected properly because its not a real s"standard" one and resorted doing a Send() command to it. The {NUMPADADD} will do a select and {NUMPADSUB} will de-select. But you mention a Radio control and are you sure you cna deselect it ? Normally radio controls is a set and one of them is selected which auto-deselect the others. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ChiGGz Posted January 18, 2008 Author Share Posted January 18, 2008 (edited) I have had it several times that the control wasn't detected properly because its not a real s"standard" one and resorted doing a Send() command to it.The {NUMPADADD} will do a select and {NUMPADSUB} will de-select.But you mention a Radio control and are you sure you cna deselect it ? Normally radio controls is a set and one of them is selected which auto-deselect the others.My apologies, it is actually a Check Box. the CHECK function in sendcommand toggles it on and off. The others do not work however (uncheck, ischecked) I am pressing numpadd +/- right now and it does nothing. However spacebar toggles it.I really need a way to find thecurrent state of the checkbox Edited January 18, 2008 by ChiGGz Link to comment Share on other sites More sharing options...
Developers Jos Posted January 18, 2008 Developers Share Posted January 18, 2008 My apologies, it is actually a Check Box. the CHECK function in sendcommand toggles it on and off. The others do not work however (uncheck, ischecked) Does doing send({numpadadd}) work?I am pressing numpadd +/- right now and it does nothingYou will have to set the focus to the control first ... could be done with the proper Alt+Character combo when it has one or sending tabs. or try ControlSend() to send it to the correct control. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ChiGGz Posted January 18, 2008 Author Share Posted January 18, 2008 You will have to set the focus to the control first ... could be done with the proper Alt+Character combo when it has one or sending tabs. or try ControlSend() to send it to the correct control. Unfortunately this does not work either for add and sub. ControlSend($hWndAccount,"", $propAllIKE_CID, "{numpadadd}") Link to comment Share on other sites More sharing options...
Developers Jos Posted January 18, 2008 Developers Share Posted January 18, 2008 Its always difficult with custom controls to know/figure out what messages they accept. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Siao Posted January 18, 2008 Share Posted January 18, 2008 Try #Include <Misc.au3> Global Const $BM_SETCHECK = 0xF1 Global Const $BM_GETSTATE = 0xF2 Global Const $BST_INDETERMINATE = 0x2 Global Const $BST_CHECKED = 0x1 Global Const $BST_UNCHECKED = 0x0 $hCheck = ControlGetHandle("Create New VPN Account", "", "Propose All") If IsHWnd($hCheck) Then $i = _SendMessage($hCheck, $BM_GETSTATE, 0, 0) MsgBox(0,'','State = ' & $i) ;~ _SendMessage($hCheck, $BM_SETCHECK, $BST_CHECKED, 0) EndIf "be smart, drink your wine" Link to comment Share on other sites More sharing options...
ChiGGz Posted January 18, 2008 Author Share Posted January 18, 2008 (edited) Try #Include <Misc.au3> Global Const $BM_SETCHECK = 0xF1 Global Const $BM_GETSTATE = 0xF2 Global Const $BST_INDETERMINATE = 0x2 Global Const $BST_CHECKED = 0x1 Global Const $BST_UNCHECKED = 0x0 $hCheck = ControlGetHandle("Create New VPN Account", "", "Propose All") If IsHWnd($hCheck) Then $i = _SendMessage($hCheck, $BM_GETSTATE, 0, 0) MsgBox(0,'','State = ' & $i) ;~ _SendMessage($hCheck, $BM_SETCHECK, $BST_CHECKED, 0) EndIf Hi Siao, It almost worked! But it detects the state change of the check box the first time (gives a value of 8 when stat changes). If I change it again and check the value is still 8. So it seems to only detect state changes and not retrieve the value of the checkbox. Also, is it supposed to be giving me an 8? EDIT: Upon inspect your code works on the taskbar properties were it returns a value of 9 or 8. So I guess it does not on an application created by .NET? Edited January 18, 2008 by ChiGGz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now