Jump to content

win wait active function


Recommended Posts

Hello all,

 

            I am using win wait active function( which  takes the title of the window as input )to pause the script until a particular window with the given title pops up.My script was not waiting till the window was fully loaded, instead its just recognising the title and executing the script.  

            I used sleep function, but it doesn't seems to be generic as the duration varies for diferent machines. Is there any function which waits till the window is fully loaded.

 

            Please do share, if you have any idea.

Thank you

Link to comment
Share on other sites

WinWaitActive should wait for the window to be active..

Could you show us the code?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Is there a line of text in the program's window that appears when the program is 'active enough' for your script to proceed? There is a text parameter for WinWaitActive function. You could use the ControlCommand function to check any buttons or other kind of control to be active or inactive.. When and if you post your code, please use the autoit tags, or the blue button with an A.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

I usually use WinWaitActive of winwaitclose then, that means I wait for the window is really present and if present hope to continue to be close to the action, but in your script wait for the window to appear immediately and will continue running to the next step, not needed to sleep.

Simple Exapmle:

Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]", "")
WinWaitClose("[CLASS:Notepad]")
MsgBox(0,"Continue Script","Notepad its closed"&@CRLF&"Here Continue Script")
Link to comment
Share on other sites

Being active does not mean the window is enabled...a window must be enabled to accept clicks, sends, etc

WinGetState

Loop through ^ until enabled is included (check with BitAnd).

I also like to then loop until my controls is present, and enabled.

ControlGetHandle
ControlCommand

It makes a script that runs 90% of the time, run 99% of the time.

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...