Jump to content

Newbie.. Need Help!


Recommended Posts

  • Developers

How can i use the argument received from another *.exe in a MsgBox? :shocked:

Can anyone please help me!

$CMDLINE[] ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Can you give me an example script please?! THANKS :shocked:

There are examples enough in helpfile and forum .....

Just search for some :(

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Look at the Command Line Parameters section of the Running Scripts part of the help file.

Here is the on-line version

http://www.autoitscript.com/autoit3/docs/intro/running.htm

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

What i have done in the past is use the iniwrite function then the ini read function.

so the first .exe writes it and the second .exe reads it. ie the following:

FIRST .EXE

IniWrite("C:\Temp\myfile.ini", "section2", "key", "MESSAGE!!!!!")

SECOND .EXE

$var = IniRead("C:\Temp\myfile.ini", "section2", "key", "NotFound")

MsgBox(4096, "Result", $var)

Link to comment
Share on other sites

Both programs need to access something in common. Some examples you can find easily by searching this forum:

1. Shared file (like INI file mentioned earlier)

2. Shared registry setting

3. Shared memory access (complicated and advanced, but doable)

4. Shared network port (TCP or UDP)

5. Shared GUI info

I recently posted an example of number 5, Shared GUI info, to the Example Scripts part of the forum: Using GUI Controls for interprocess comms

:shocked:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Well what exactly do you mean by "the argument received from another *.exe" anyway? You mean the other exe has some text somewhere you want to capture? Is the other exe also an autoitscript written by you?

If you want it to be something like this:

1. used command: "myexe.exe abcde" --> 2. display a msgbox with "abcde" in it

... then you use the CmdLine[]. Compile the following to an exe and run it with the abovementioned command

msgbox(0,"test",$CmdLine[1])

If you mean to do something else then please give some more info about what the first and the second exe are and do, that would make it easier to give you suggestions.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Well what exactly do you mean by "the argument received from another *.exe" anyway? You mean the other exe has some text somewhere you want to capture? Is the other exe also an autoitscript written by you?

If you want it to be something like this:

1. used command: "myexe.exe abcde" --> 2. display a msgbox with "abcde" in it

... then you use the CmdLine[]. Compile the following to an exe and run it with the abovementioned command

msgbox(0,"test",$CmdLine[1])

If you mean to do something else then please give some more info about what the first and the second exe are and do, that would make it easier to give you suggestions.

I have an .exe that does the following the following function:

File.Run (

string Filename,

string Args = "",

string WorkingFolder = "",

number WindowMode = SW_SHOWNORMAL,

boolean WaitForReturn = false )

result = File.Run("MyProg.exe", "Hello", "", SW_SHOWNORMAL, false);

The MyProg.exe is created with autoit. I want the autoit to display the "Hello" in a MsgBox, is that possible if it is can i send multiple e.g. "Hello/Bye"

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