Jump to content

ControlCommand hangs script if control opens a dialog

Recommended Posts

I'm trying to click a button on a toolbar

ControlCommand($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:1]", "SendCommandID", 32780)

The button is clicked, but since its purpose is to open a Save As dialog, the script won't continue and hangs there forever unless the dialog is closed.

So what should I do? Thanks so much.

Link to post
Share on other sites
4 minutes ago, alienclone said:

well what is the next line in your script? what is supposed to happen next?

I'm just testing and there is no next lines yet. However I found the solution here ">>>ToolsBar<<<" Understanding how to access these controls - AutoIt General Help and Support - AutoIt Forums

I replaced the old code with this code based on jdelaney's post:

Run('"' & @AutoItExe & '" /ErrorStdOut /AutoIt3ExecuteLine "ControlCommand(WinGetHandle(''My Window''),'''', ''[CLASS:ToolbarWindow32; INSTANCE:1]'', ''SendCommandID'', 32780)"')

And it works just fine :)

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...