Sign in to follow this  
Followers 0
doogdoog

How To Close Moving Popup

13 posts in this topic

Aloha,

Don't laugh, but I have been working for a couple of days trying to start a program with a script. So far, I have come up with this to start the program:

Runwait (@Comspec & "/c start dklite.msc")

Ok, the program starts but a popup window appears over the program window that I want to start. Everytime the program starts, the popup is in a different location. I used Window Autoit Info and it only shows the title (Diskeeper Lite) and no control ID and no text. What can I use to close (click on the X) the popup window? I tried mouseclick, and controlclick and couldn't get it to work so far (for me). TIA

Mahalo,

doogdoog

Share this post


Link to post
Share on other sites



Do you have to click on it? Or could you use the Win* functions, such as WinClose? Look them up in the helpfile.

Share this post


Link to post
Share on other sites

...Everytime the program starts, the popup is in a different location...

See the help file for:

AutoItSetOption ("MouseCoordMode", 0)

;Use Mouse Coordinates relative to window (1-rel to desktop)

Be sure to change the "AutoIt Window Info" tool:

Options > Coord Mode > Window

to get your x, y coordinates for a mouse click.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Aloha,

Thanks for the reply. Yes, I have to click on the X and will take a look at Win* functions. TIA

Mahalo,

doogdoog

Share this post


Link to post
Share on other sites

Aloha,

Thanks for the reply. Yes, I have to click on the X and will take a look at Win* functions. TIA

Mahalo,

doogdoog

I believe without knowing your window/program your trying to close, that greenmachine gave you the answer you are looking for. If it is a child window... you may want to do something like this: Opt('WinSearchChildren', 1) and use the WinClose('Title of annoying window', 'Any text that may be relevant').

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Aloha,

Ok, there is a "close" button on the bottom of the popup if I scroll down.

Mahalo,

doogdoog

Share this post


Link to post
Share on other sites

Aloha,

Ok, there is a "close" button on the bottom of the popup if I scroll down.

Mahalo,

doogdoog

That close button more than likely has a control ID so if it does, you could use ConrolClick('WindowTitle', 'Text of Control ID from AutoInfo Tool', 'Control ID Number or ClassNameNN'). Or again you could use the WinClose()

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

That close button more than likely has a control ID so if it does, you could use ConrolClick('WindowTitle', 'Text of Control ID from AutoInfo Tool', 'Control ID Number or ClassNameNN'). Or again you could use the WinClose()

Aloha,

Thanks for the reply and will try as suggested, but I just noticed something. It looks like when the program starts, there are two popups, one behind the other. The popup in back of the popup, closes after a second or so and then the front popup stays open. That's the one that closes by clicking on the X or the close button. I will try the controlclick and winclose again. TIA

Mahalo,

doogdoog

Share this post


Link to post
Share on other sites

...greenmachine gave you the answer you are looking for...

I forgot how specific WinClose can be...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Aloha,

Everyone, thanks for all the help. I finally got this simple script to work for me and it took all but 3 days! LOL I'll post the script:

Runwait (@comspec & " /c start dklite.msc")

Sleep (1000)

WinClose ("Diskeeper Lite", "")

ControlClick ("Diskeeper Lite","Defragment Now",8101,"",1)

It looks like the "Sleep" was one of the key items to make it work. TIA Now for a beer to relax.

Mahalo,

doogdoog

Share this post


Link to post
Share on other sites

Aloha,

Everyone, thanks for all the help. I finally got this simple script to work for me and it took all but 3 days! LOL I'll post the script:

Runwait (@comspec & " /c start dklite.msc")

Sleep (1000)

WinClose ("Diskeeper Lite", "")

ControlClick ("Diskeeper Lite","Defragment Now",8101,"",1)

It looks like the "Sleep" was one of the key items to make it work. TIA Now for a beer to relax.

Mahalo,

doogdoog

Runwait (@comspec & " /c start dklite.msc")
WinWait("Diskeeper Lite", 5)
WinClose ("Diskeeper Lite")
If WinExists("Diskeeper Lite") Then ControlClick ("Diskeeper Lite", "Defragment Now", 8101)

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Aloha,

How do you use EnCodeIt?? After I download it, and then what?? TIA

Mahalo,

doogdoog

Share this post


Link to post
Share on other sites

Aloha,

How do you use EnCodeIt?? After I download it, and then what?? TIA

Mahalo,

doogdoog

Pretty simple, a file dialog pops up... then you choose the file that you want to encode, the method number, and then click the button. It will be in the same location as the file you wanted to encode was.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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