Jump to content

[SOLVED]Writing a gui handle to a file, then reading it


Recommended Posts

Okay, so I want to experiment around some with using multiple processes. (+IPC)

So I was thinking of giving each process a hidden window. Then storing the handles for each process in a file.

So my question is how do I store

$gui = guicreate("(WIN:0001)", '100', '100')

$gui to a file as a handle

then read it back from a file and do winexists($gui) (with the handle) to make sure the helper process is open?

Thanks!

Edited by nullschritt
Link to comment
Share on other sites

FileWrite("yourfile.txt", "" & String($gui)). Isn't it simple? :guitar:

WinExists(HWnd(FileRead("yourfile.txt")))

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

You know you can just call a second script, and pass in the hwnd as a variable, right? Cut out the middle man (text doc).

I don't think you understand the activity I am doing.

(also I am not using a text file but ADS within the exe)

What I am doing is constantly having the second process write it;s handle to an ADS, then have the main script check to see if the handle exists.

If the handle does exist, do nothing, if the handle does not exist, launch itself with a command line parameter, to run the second process.

(this way I will always be able to verify if the second process is running, so that it can be turned on and off [it is actually a plugin, that adds additional features])

Thanks for everyone's help and suggestions though!

Link to comment
Share on other sites

I don't think you understand the activity I am doing.

(also I am not using a text file but ADS within the exe)

What I am doing is constantly having the second process write it;s handle to an ADS, then have the main script check to see if the handle exists.

If the handle does exist, do nothing, if the handle does not exist, launch itself with a command line parameter, to run the second process.

(this way I will always be able to verify if the second process is running, so that it can be turned on and off [it is actually a plugin, that adds additional features])

Thanks for everyone's help and suggestions though!

Hi,

Maybe you can use _Singleton with the plugin and then check with the main script if the plugin is running (by the same func)

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Hi,

Maybe you can use _Singleton with the plugin and then check with the main script if the plugin is running (by the same func)

Br, FireFox.

I figured it out fine, thanks firefox, I was just explaining why that suggestion would not have worked worked for me!

(this is more reliable than singleton)

Link to comment
Share on other sites

I figured it out fine, thanks firefox, I was just explaining why that suggestion would not have worked worked for me!

(this is more reliable than singleton)

Yes, in my opinion I prefer my suggestion because you don't write files.

You can also you use the AutoIt window (AutoItWinSetTitle, AutoItWinGetTitle) to comunicate between your scripts.

Edit : Now it's solved, you can edit the topic title to add SOLVED.

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Yes, in my opinion I prefer my suggestion because you don't write files.

You can also you use the AutoIt window (AutoItWinSetTitle, AutoItWinGetTitle) to comunicate between your scripts.

Edit : Now it's solved, you can edit the topic title to add SOLVED.

Br, FireFox.

And I am saying I tried your method, and singleton is an unreliable function.
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...