Jump to content

sending message to an autoit.exe


 Share

Recommended Posts

AutoItWinSetTitle

Thanks herewasplato. Understood, but what I'm after is a way to send an autoit executable a message (say 1 or 0) while it is already running not from AutoIt or other Window's macro/scripting applications but from a dos command line. I notice I can launch a script with parameters -- $CmdLine[1] equals... param1 etc. but can I do this with an already running exe (note that AutoIt will not be installed on the machine running these scripts). In other words can the exe "loop and listen" for incomming command line messages

The AutoIt window is usually hidden. The purpose of changing the title is to allow other programs (or other AutoIt scripts) to interact with AutoIt.

Link to comment
Share on other sites

If you are saying that you want to

start your AutoIt script

manually start a console app

have your AutoIt script receive inputs from the console app

...then I'm not sure what to suggest you try within your AutoIt script.

You might look at some of the example scripts - search for console in the titles.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

What you mention below is the mechanism I'm looking for

If you are saying that you want to

start your AutoIt script

manually start a console app

have your AutoIt script receive inputs from the console app

...then I'm not sure what to suggest you try within your AutoIt script.

You might look at some of the example scripts - search for console in the titles.

Link to comment
Share on other sites

What you mention below is the mechanism I'm looking for

You could use ControlSend or messages, but for a simple method ControlSend is easier.

When someone starts the script, which could be from the command prompt, then it checks to see if there is another instance already running. If there is then it sends the parameters to the first instance of the script then closes.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Cool, thanks martin -- thats what I call thinking outside the box. I think that will do just fine for what I need. I also just found the $var = EnvGet("System_Var") thing -- don't know if its usable for what I need but will research it if for nothing more than curiosity.

Thanks again.

Regards;

--Al

You could use ControlSend or messages, but for a simple method ControlSend is easier.

When someone starts the script, which could be from the command prompt, then it checks to see if there is another instance already running. If there is then it sends the parameters to the first instance of the script then closes.

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