Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalent of SYS(16)
Message
 
To
08/04/1998 01:20:51
Raul Davila
Davila Programming Services
Toa Alta, Puerto Rico
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00090128
Message ID:
00090373
Views:
27
>>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.
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform