|
-
Dec 20th, 2008, 03:21 AM
#1
Thread Starter
Hyperactive Member
Registry shell open, unless already running - in which case...
Hi guys,
I'm writing to the registry to create a custom web protocol that passes variables to my program, so that on the web, my application would handle URLs like: appname:var1/var2 -- This has worked out great thus far, however, I have it setup in the registry somewhat like this:
SetStringValue "HKEY_CLASSES_ROOT\app", "", "URL: appProtocol"
SetStringValue "HKEY_CLASSES_ROOT\app", "URL Protocol", ""
SetBinaryValue "HKEY_CLASSES_ROOT\app", "EditFlags", Chr$(&H2) + Chr$(&H0) + Chr$(&H0) + Chr$(&H0)
SetStringValue "HKEY_CLASSES_ROOT\app\shell\open\command", "", "" & EXEpath
Which is OK if the program has not already been executed, but if the program is already a running process, it will not communicate with the running .exe, but instead open a new (duplicate) one.
Now, I didn't really expect it to 'communicate' with the existing one automatically or anything, as I know from messing with VB6 for a few months now, that nothing really 'communicates' on its own.
So, my question is; How can I say, if xxxxxxx.exe is running, do not open a new instance and instead open communication with the current process, otherwise [else] open a new xxxxxxx.exe
In case you were wondering, the remainder of the function resembles this:
Code:
'command is the command that open the program, if you double clicked the icon, the path would be "" nothing.
'if a file called the opening of this program, the Command would be the path of that file
Path = Command
If Path = "" Then ' if no file requested it to open, aka you click the icon to execute the program
Else ' if it was requested by a webpage, then do the following
ExtractData1
ExtractData2
ExtractData3
End If
Thanks a lot!
David
Last edited by DavidNels; Dec 20th, 2008 at 03:25 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|