Sign in to follow this  
Followers 0
snorkel

GUI Controls not working on some systems

2 posts in this topic

I'm sorry if this has been covered elsewhere.  I've been searching for two days, and haven't had any luck.

I have a simple AutoIT script to automate configuring the network settings of a wireless printer.  The printer's configuration program uses SysTreeView32.  My script navigates through the tree, selects the items I wish to configure, and places the configuration.  My script works perfectly fine on some systems, and fails on others.

The interesting bit is below:

 $window = WinWait("Device Properties")
 $tree = ControlGetHandle($window, "", "[CLASS:SysTreeView32; INSTANCE:1]")
 $searchText = "Basic (Wireless)"
 $ItemFound = _GUICtrlTreeView_FindItem($tree, $searchText, True)
 
On some systems the _GUICtrlTreeView_FindItem function finds the item.  On others it returns 0.  I am able to get the handle for the window and for the tree.. I just can't find the items.
 
I also tried using the ControlTreeView functions and got the same results.  Works fine on some systems, not on others.
 
Additionally, functions such as ControlCommand and ControlSetText do not work on these systems.
 
Any tips or advice would be greatly appreciated.

Share this post


Link to post
Share on other sites



I just needed to ask for help, apparently.  Problem was permissions related.  Placing #RequireAdmin at top of script got everything working.

Thanks

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0