Bot

ControlCommand hangs script if control opens a dialog

3 posts in this topic

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.

Share this post


Link to post
Share on other sites



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


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

Share this post


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

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