Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program Files folder - How to get the name?
Message
 
To
13/09/2002 10:24:37
Arlei Silva
Chevron Oronite Brasil Ltda.
Capuava, Brazil
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00700175
Message ID:
00700438
Views:
10
Arlei,

>How I can check the name of the "Program Files" folder?
>My app will run in multi language environments and I need to know the name of this folder to perform some tasks.

I'm not sure if there was a solution supplied in this thread already (too long to read it all). If not, this should work for you. If there already was a solution I apologize :)
DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ;
   INTEGER hwndOwner, ;
   INTEGER nFolder, ;
   INTEGER hToken, ;
   INTEGER dwFlags, ;
   STRING @ pszPath
   
#DEFINE CSIDL_PROGRAM_FILES 38

lcPath = REPL(CHR(0),261)

SHGetFolderPath(_SCREEN.Hwnd, CSIDL_PROGRAM_FILES, 0, 0, @lcPath)
? LEFT(lcPath,AT(CHR(0),lcPath)-1)
BTW: Basically taken from SHGetFolderPath API #12735 plus the constant not provided there. Additionally I've changed the method of retrieving the VFP window handle. Please note the comments in the article regarding the availability of the shfolder.dll on different Windows versions.

HTH,
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Reply
Map
View

Click here to load this message in the networking platform