mIRC Home    About    Download    Register    News    Help

Print Thread
P
paulbeauclair
paulbeauclair
P
From a script, an .exe program is called and parameters passed.
The program is ip2country. In this program their are button that can be trigger manually with alt-c or alt-w. How from the script can these button can be trigger?
Tnaks to all

Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
After activating the window you can use SendKeys:

alias sendkeys { .comopen a WScript.Shell | .comclose a $com(a,SendKeys,3,*bstr,$$1-) }

//sendkeys $(%c,0)

Activating the window can also be done with com:

alias appactivate { .comopen a WScript.Shell | .comclose a $com(a,AppActivate,3,*bstr,$$1-) }

//appactivate TITLEOFTHEWINDOW

at which point you can use the sendkeys code above.

You can also refactor those two aliases to work as one, saving one (probably costly) /comopen and /comclose command

Note that you cannot use these methods to get any data out of your exe. If the EXE writes the result to stdout without a GUI you can use exec.dll to get the data in a much simpler fashion.


Link Copied to Clipboard