>>Hi,
>>
>>I'm writing a small "splash screen" app using Borland C++ Builder.
>>
>>It works quite well, but I'd like to defend the exe against a user installing my exe in another directory and trying to run it.
>>
>Hi Matt:
>
> GetModuleFileName will give you the exact path of exe.
>
> DWORD GetModuleFileName(
> HMODULE hModule, // handle to module to find filename for
> LPTSTR lpFilename, // pointer to buffer for module path
> DWORD nSize // size of buffer, in characters
> );
>
> You can use it in the splash screen exe and look for the VFP app in tha directory.
>
Raul,
I happen to be searching for EXACTLY the same solution as Matt here, I want to display the compile date/time of the exe and need to find it first using equivalent of SYS(16). The solution you provide (without testing) looks as if it needs the file to be opened to offer a handle to the function. Problem: you need to know where the file is stored to open it. I think Matt's problem is the same as mine - what if the exe is somewhere in the path list and the user runs it from a command window. It is not in the current directory, nor current working directory.