Sign in to follow this  
Followers 0
jdelaney

ControlCommand: SendCommandID as Run, not RunWait

5 posts in this topic

I'm running across an issue exactly in line with this thread:

When the ControlCommand($win,"",$toolbar,"SendcommandID",$commandid) opens a second window, the script halts until that window closes....almost like a RunWait, where I need a Run...

My workaround is to call a second, compiled script to run the controlcommand, so my main script can wait for the window to open...there has got to be a better way. Any thoughts?

also, GuiCtrlToolbar_ClickButton does not function with my toolbar.

Thanks,

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



Call the ControlCommand using the AutoIt3ExecuteLine switch? Example from helpfile:

Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Hello World!'', ''Hi!'')"')

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Good suggestion...I'm trying that, but the command does not seem to execute:

ConsoleWrite ( ' /AutoIt3ExecuteLine "ControlCommand ( ' & $hwndWindow & ','''', ' & $hwndToolbar & ', ''SendCommandID'', 36507 )"' & @crlf )
Run(@AutoItExe & ' /AutoIt3ExecuteLine "ControlCommand ( ' & $hwndWindow & ','''', ' & $hwndToolbar & ', ''SendCommandID'', 36507 )"')

consolewrite output:

/AutoIt3ExecuteLine "ControlCommand ( 0x0009074E,'', 0x00060776, 'SendCommandID', 36507 )"

Everything looks fine, but no go.

Where this does function:

ControlCommand ( $hwndWindow, "", $hwndToolbar, "SendCommandID", 36507 )
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

#4 ·  Posted (edited)

got it:

Run(@AutoItExe & ' /AutoIt3ExecuteLine "ControlCommand ( hwnd(' & $hwndWindow & '),'''', hwnd(' & $hwndToolbar & '), ''SendCommandID'', 36507 )"')

This helps with a few other areas for me too; thanks again, KaFu.

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

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