davy Posted December 19, 2005 Share Posted December 19, 2005 I have a simple windows form with 3 buttons on it. I need to check what ones are visible. The problem is that even when I pass in a rubbish value the control command always returns 1. I've seen other people using this and think I might be doing something stupid. can someone help please? here is the code i'm using. WinActivate("Form1"); $ControlText = "DoesNotExist"; $isVisible = ControlCommand("Form1", "",$ControlText, "IsVisible", "") MsgBox(4096, "",$IsVisible , 1) ; Thanks Link to comment Share on other sites More sharing options...
LxP Posted December 19, 2005 Share Posted December 19, 2005 (edited) Welcome to the forums!I can confirm that this is happening with AutoIt v3.1.1. This behaviour is not apparent in the beta; you will find that other v3.1.1 issues are also resolved making the beta more stable anyway.Edit: What you probably should be doing is checking the @Error value, which correctly reports that there was a problem:ControlCommand('Form1', '', 'DoesNotExist', 'IsVisible') If @Error Then MsgBox(0x10, 'Stop!', 'That control does not exist!') Edited December 19, 2005 by LxP Link to comment Share on other sites More sharing options...
MHz Posted December 19, 2005 Share Posted December 19, 2005 Tested on CCleaners invisible progress bar MsgBox(0, '', ControlCommand('CCleaner', '', 7, 'IsVisible', '') ) Run it when it is hidden intially returns 0. Click Analyze then run again and it returns 1. ControlCommand works as expected. As LxP notes, beta returns 0 for your test. Link to comment Share on other sites More sharing options...
davy Posted December 20, 2005 Author Share Posted December 20, 2005 Thanks a lot. I think using the @error will work perfectly for what i'm trying to achieve. Davy 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