Jump to content

Passing commands or variables between 2 exe's


Recommended Posts

  • -3 is the value of $GUI_EVENTCLOSE
  • It writes to the ini and waits for nothing
  • Yes
  • Nothing is waiting for the ini to change
  • Might not even need the Int() but leave it anyway, makes no difference if the value is 0
  • What does it say it's checking for? The property of "locationurl" and then checks to see if that property contains "autoitscript"

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Moderators

Please forgive me, but I need a bit of clarification, I have added some comments to a part of the parent gui script, and was hoping you could answer them for me, I'm hoping to better understand how this works.

While 1
    Switch GUIGetMsg()
        Case -3 ; where does this message come from?
            IniWrite($s_ini, "ParentCommandToChild", "Exit", 1) ;what does this do beside set ini state, does something wait for ini to change?
            While ProcessExists($i_pid) ;does this loop until the child process finishes?
                Sleep(250)
            WEnd
            IniWrite($s_ini, "ParentCommandToChild", "Exit", 0) ;what does this do beside set ini state, does something wait for ini to change?
            Exit
    EndSwitch
    If Int(IniRead($s_ini, "child", "readystate", 0)) Then ;I understand it checks for integer, but why, and what if it is 0?
        IniWrite($s_ini, "ParentCommandToChild", "NavigateTo","http://www.autoitscript.com/forum/index.php?showtopic=115196")
    EndIf
    If StringInStr(_IEPropertyGet($o_ie, "locationurl"), "autoitscript") Then ;what does this check for?
        IniWrite($s_ini, "ParentCommandToChild", "Exit", 1)
    EndIf
WEnd

Thanks in advance

Really? A bit of work on your part and you would have figured it out.

While 1
    Switch GUIGetMsg()
        Case -3 ; I didn't include the GUIConstantsEx.au3 file, so I used the value for $GUI_EVENTCLOSE
            IniWrite($s_ini, "ParentCommandToChild", "Exit", 1) ;lets see, if we look at the child.au3, we see it looks to see if the ini value is <> 0 to exit itself?
            While ProcessExists($i_pid) ;yes, we're going to wait until the child process finishes, to make sure it's filled/removed all the data we need it to
                Sleep(250)
            WEnd
            IniWrite($s_ini, "ParentCommandToChild", "Exit", 0) ;we're defaulting back to zero for next time we run, I should probably have changed the other, but didn't know I needed to write the entire logic
            Exit
    EndSwitch
    If Int(IniRead($s_ini, "child", "readystate", 0)) Then ;in the child.au3, we're telling it to navigate to whatever NavigateTo equals at the time... well, we would want to make sure child.au3 is ready to accept commands wouldn't we?
        IniWrite($s_ini, "ParentCommandToChild", "NavigateTo","http://www.autoitscript.com/forum/index.php?showtopic=115196")
    EndIf
    If StringInStr(_IEPropertyGet($o_ie, "locationurl"), "autoitscript") Then ;I'm simply verifying that child.au3 has done what I asked, navigated to this threads url, if that url exists, I don't need child.au3 to run anymore.
        IniWrite($s_ini, "ParentCommandToChild", "Exit", 1)
    EndIf
WEnd
I'm highly disappointed. This is rudimentary code at best. You obviously didn't study it too long at all.

My point was to show you a way you could manipulate what you had to, not to concern yourself with what my example was doing.

The points you needed to understand are what I provided.

1. Create a main app object

2. Create a unique title for you object

3. Make sure your child process understands what that title is

4. Have your child process create an object for its own process based on title.

The above 4 points answered your initial question, nothing else should have concerned you unless you wanted to adopt this crude method of IPC ( http://msdn.microsoft.com/en-us/library/aa365574%28VS.85%29.aspx ).

I want to thank you though, I now remember why I quit helping in the support forum other than moderator stuff.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

@SmOKe_N

I'm highly disappointed. This is rudimentary code at best. You obviously didn't study it too long at all.

I know that at many points in this post I have said I am a noob that has a desire to learn!

My point was to show you a way you could manipulate what you had to, not to concern yourself with what my example was doing.

How can I understand your point, If I don't completely understand whats going on.

I want to thank you though, I now remember why I quit helping in the support forum other than moderator stuff.

I appologize for being a noob that wants to learn! I do want to thank you for taking the time to answer my questions.

@GEOSoft, Thanks for your reply and patience as well!

Edited by Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 

Link to comment
Share on other sites

  • Moderators

I spelled it out in my comments in the code above. If it seems I was snippy, I probably was. I have a deadline of my own to make, but I hate to leave things hanging.

Things I would look at in the code I presented:

Parent.au3

1. The embedded object was navigated before I set it to a browser condition and before I called my exe.

2. How I created a unique title for my object window.

3. How I set the unique title for my object window ( eg. _IEPropertySet($o_object, "title", "value") ).

4. How I told my child.au3 what the title was ( eg. IniWrite() )

Child.au3

1. How I found out what my parent.au3 set the title to ( eg. IniRead() ).

2. How I created an object from that title ( eg. _IEAttach("unique title read from ini") )

3. I verified I created an object before I continued on.

The rest of the data in the .au3 files is irrelevant to your original question.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Unaware of a deadline, I still understand your time is important too. Most of your code I understood what it was meant to do, I have a tendency to get lost with other peoples Statements and Functions, unless they are well commented, My understanding of AutoIt mostly comes from the help files that for the most part has plenty of explanation, along with comments in their examples. I have no other programming knowledge other than what I have come to learn here. Thank you for taking the time to explain what I was not comprehending. I do appreciate you and your help, good luck with your deadline!

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 

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