Re: Shellexecute question



On Mon, 19 Dec 2005 13:59:54 +0100, "Maarten Wiltink"
<maarten@xxxxxxxxxxxxxxxxxx> wrote:

>"J French" <erewhon@xxxxxxxxxx> wrote in message
>news:43a69195.867424475@xxxxxxxxxxxxxxxxxxxxxxx
>> On Mon, 19 Dec 2005 09:16:03 -0000, "Mike Glazer"
>> <glazer@xxxxxxxxxxxxxxxx> wrote:
>
>>> The problem I have is suppose I send my program to someone else who
>>> might have installed the external application to a non-standard
>>> folder on their machine. What I need then is some code in my program
>>> that automatically picks up the .exe file of the external application.

>> If the user is a complete idiot then you will probably have to resort
>> to brute force.

>Poetry.

But pragmatic poetry

>> For the future it would be wise for the App to leave its location
>> somewhere obvious
>> - that does not necessarily involve making a Windows file association.

>> There are ways of finding the file locations of running Apps, under XP
>> some of them just give the App names, but I'll bet others give the
>> full path.

>If the executable is on the path, only the filename is enough anywhere.

It is normally not on the path

>There is also HKLM/Software/Microsoft/Windows/CurrentVersion/App Paths.
>This used to be in win.ini or system.ini, but they're no longer used
>for that (or much of anything). Writing to the registry directly isn't
>the right way to get it there in all likelihood, but I don't know any
>other way.

Well, The CreateWin32SnapShot (or something like that) used to give
one the file path and file name of all currently running processes

Latterly it just gives the file name, but I'm sure something will give
the lot

Realistically this is a 'boot strapping' operation, the OP's next
version will probably converse with the new version via
RegisterWindowsMessage so the Registry will be (correctly) redundant.

(well if I have anything to do with it, he'll just run both Apps and
they'll negotiate the update)

A nasty problem that I've kicked myself for not sorting out before it
bit me.


.


Quantcast