Sign in to follow this  
Followers 0
aleph01

ControlDisable issues

3 posts in this topic

Greetings, and thanks in advance for any help.

My experiments attempting to get ControlDisable to actually disable a control have been a failure. So far, I’ve only tried this on Notepad, but, although Notepad is grayed out, it still takes input during my sleep interval (the input is gray as well) and when I run ControlEnable a few seconds later, the text becomes black. It’s a little amusing, but I must be using ControlDisable incorrectly.

Run ("notepad.exe")
WinWait ("Untitled")
ControlDisable("Untitled", "", 15)
Sleep (10000)
ControlEnable("Untitled", "", 15)

Meds.  They're not just for breakfast anymore. :'(

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

Run ("notepad.exe")
WinWait ("Untitled")
ControlHide("Untitled", "", 15)
ControlFocus("Untitled", "", 1025)
Sleep (5000)
ControlShow("Untitled", "", 15)

or:

Run ("notepad.exe")
WinWait ("Untitled")
ControlDisable("Untitled", "", 15)
ControlFocus("Untitled", "", 1025)
Sleep (5000)
ControlEnable("Untitled", "", 15)

main point is to focus on something else, after disabling

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Thanks, jdelaney. That should be mentioned in the Help file. :)


Meds.  They're not just for breakfast anymore. :'(

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