Sign in to follow this  
Followers 0
esahtar90

How to detect a popup window on a GUI

4 posts in this topic

Hi All,

I have written a script in Autoit to automate a trivial task which is repetitive.

But i facing some difficulties with my my code.

In my code i need to detect a popup window on a GUI and depending on that i need to perform some actions and proceed further.

Can anyone advise  on "how to i detect a small pop up window on a GUI"

Thanks in Advance

Share this post


Link to post
Share on other sites



esahtar90,

How does this popup distinguish itself from any other window on-screen? Does it have a specific title? Or some identifiable text? :huh:

Once you have someting unique to identify the popup you can use WinExists to detect it. Or perhaps even WinWait if you have no actions to take until it appears. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

My fave route is:

$GW_ENABLEDPOPUP = 6
_WinAPI_GetWindow($hOwner, $GW_ENABLEDPOPUP)

If there is a popup created by $hOwner (handle to your parent window), it will return a valid HWND (which will be the popup)

Then you can Use WinGetTitle, WinGetText to logically determine which popup it is, and have a script to do some required action on it...I do this by using arrays of expecteced controlid's to manipulate against the title/text.

As you find more of these popups, you would only need to add them to the array.

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

esahtar90,

How does this popup distinguish itself from any other window on-screen? Does it have a specific title? Or some identifiable text? :huh:

Once you have someting unique to identify the popup you can use WinExists to detect it. Or perhaps even WinWait if you have no actions to take until it appears. :)

M23

 

Hi M23,

thanks a lot that solved my problem. :)

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