Jump to content

How To Close Moving Popup


Recommended Posts

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

Link to comment
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]

Link to comment
Share on other sites

  • Moderators

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').

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.

Link to comment
Share on other sites

  • Moderators

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()

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.

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

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

Link to comment
Share on other sites

  • Moderators

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)

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.

Link to comment
Share on other sites

  • Moderators

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.

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.

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...