|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Program files dir
Hello,
how can an application know at run time the complete path of the "Program files" directory, ( for all languages). Also, is there a way to know the path of the start-menu directory where programs shorcuts are installed to be accessible from the START Windows menu? Thanks a lot! Marco Marco Congedo, PhD INRIA (National Institute for Research in Informatics and Control) Grenoble, France Tel: +33 4 76615409 Fax: +33 4 76615454 Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Delphi mailing list -Delphi (AT) elists (DOT) org |
|
#2
|
|||
|
|||
|
Program files dir
the path to program files is in the environment variable 'ProgramFiles'
and you can get the value by using the function GetEnvironmentVariable Patrick Marco Congedo wrote: Hello, how can an application know at run time the complete path of the "Program files" directory, ( for all languages). Also, is there a way to know the path of the start-menu directory where programs shorcuts are installed to be accessible from the START Windows menu? Thanks a lot! Marco Marco Congedo, PhD INRIA (National Institute for Research in Informatics and Control) Grenoble, France Tel: +33 4 76615409 Fax: +33 4 76615454 Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Delphi mailing list -Delphi (AT) elists (DOT) org -- Applications Team Leader t : +44 207 251 7920 f : +44 207 608 3592 Delphi mailing list -Delphi (AT) elists (DOT) org |
|
#3
|
|||
|
|||
|
Program files dir
You have to use the API function SHGetSpecialFolderLocation.
For an example, have a look at: -- Contribute to the SSL Effort. Visit -- francois.piette (AT) overbyte (DOT) be Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be Message From: "Marco Congedo" <loretabiofeedback (AT) yahoo (DOT) com> To: <delphi (AT) elists (DOT) org> Sent: Monday, April 25, 2005 10:50 AM Subject: Program files dir Hello, > how can an application know at run time the complete path of the "Program files" directory, ( for all languages). > Also, is there a way to know the path of the start-menu directory where programs shorcuts are installed to be accessible from the START Windows menu? > Thanks a lot! > Marco > > Marco Congedo, PhD INRIA (National Institute for Research in Informatics and Control) Grenoble, France Tel: +33 4 76615409 Fax: +33 4 76615454 > > Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Delphi mailing list -Delphi (AT) elists (DOT) org > Delphi mailing list -Delphi (AT) elists (DOT) org |
|
#4
|
|||
|
|||
|
Program files dir
Hello Marco,
If you use the Project Jedi Code Library (www.delphi-jedi.org/) , there are functions within for each of these. GetProgramFilesFolder returns the value of HKEY_LCAL_MACHINE\SFTWARE\Microsoft\Windows\Curren tVersion\ProgramFilesDir which on my machine contains the value "C:\Program Files" The location of the Start Menu can be found by calling the Win32 API function SHGetSpecialFolderLocation (see the help in Help | Windows SDK). You pass a value to this function indicating which special folder you want to retrieve. the following list came from the help: CSIDL_BITBUCKET Recycle bin ¾ file system directory containing file objects in the user's recycle bin. The location of this directory is not in the registry; it is marked with the hidden and system attributes to prevent the user from moving or deleting it. CSIDL_CNTRLS Control Panel ¾ virtual folder containing icons for the control panel applications. CSIDL_DESKTP Windows desktop ¾ virtual folder at the root of the name space. CSIDL_DESKTPDIRECTRY File system directory used to physically store file objects on the desktop (not to be confused with the desktop folder itself). CSIDL_DRIVES My Computer ¾ virtual folder containing everything on the local computer: storage devices, printers, and Control Panel. The folder may also contain mapped network drives. CSIDL_FNTS Virtual folder containing fonts. CSIDL_NETHD File system directory containing objects that appear in the network neighborhood. CSIDL_NETWRK Network Neighborhood ¾ virtual folder representing the top level of the network hierarchy. CSIDL_PERSNAL File system directory that serves as a common respository for documents. CSIDL_PRINTERS Printers folder ¾ virtual folder containing installed printers. CSIDL_PRGRAMS File system directory that contains the user's program groups (which are also file system directories). CSIDL_RECENT File system directory that contains the user's most recently used documents. CSIDL_SENDT File system directory that contains Send To menu items. CSIDL_STARTMENU File system directory containing Start menu items. CSIDL_STARTUP File system directory that corresponds to the user's Startup program group. CSIDL_TEMPLATES File system directory that serves as a common repository for document templates. Again you could also call the Project Jedi function GetStartupFolder to return this value as well. Hope this helps Scott Kellish SoftSystem Solutions, LLC skellish (AT) softsystemsolutions (DOT) com Message From: "Marco Congedo" <loretabiofeedback (AT) yahoo (DOT) com> To: <delphi (AT) elists (DOT) org> Sent: Monday, April 25, 2005 4:50 AM Subject: Program files dir Hello, > how can an application know at run time the complete path of the "Program files" directory, ( for all languages). > Also, is there a way to know the path of the start-menu directory where programs shorcuts are installed to be accessible from the START Windows menu? > Thanks a lot! > Marco > > Marco Congedo, PhD INRIA (National Institute for Research in Informatics and Control) Grenoble, France Tel: +33 4 76615409 Fax: +33 4 76615454 > > Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Delphi mailing list -Delphi (AT) elists (DOT) org > Delphi mailing list -Delphi (AT) elists (DOT) org |
|
#5
|
|||
|
|||
|
Program files dir
agree with you there
Francois Piette wrote: >>the path to program files is in the environment variable 'ProgramFiles' >>and you can get the value by using the function GetEnvironmentVariable I don't think it's the right way to get this information. Special folders doesn't have the same name in all languages. Better to use SHGetSpecialFolderLocation API as I explained in my previous message. -- francois.piette (AT) overbyte (DOT) be Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be Delphi mailing list -Delphi (AT) elists (DOT) org -- Applications Team Leader t : +44 207 251 7920 f : +44 207 608 3592 Delphi mailing list -Delphi (AT) elists (DOT) org |
![]() |
| Viewing: Web Development Archives > Mailing Lists > Delphi > Program files dir |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|