WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Program Files folder, I know the SHGetSpecialFolderPath API will get this but the problem is I can't guarantee users will have shell32.dll version 5

andrew_k
Quote Post


Active Member
***

Group: Members
Posts: 41
Member No.: 34
Joined: 25-May 04


Hi,
I am looking for a way to find out the path to a users Program Files folder. I know the SHGetSpecialFolderPath API (or SHGetFolderPath for Win 2000 or later) using the CSIDL 'CSIDL_PROGRAM_FILES' will get this but the problem is I can't guarantee users will have shell32.dll version 5.0 or later installed. I know if they have Internet Explorer 5.0 or later running they will have the requisite version of this dll but if they don't....

I am thinking about simply checking a registry key (which is no doubt what the shell programs do anyway). On Win 2000 the key is:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ProgramFilesDir

However I don't whether this is consistent across various Windows versions.
Any ideas much appreciated.
Cheers,
Andrew
PMEmail Poster
Top
akyprian
Quote Post


Administrator
******

Group: Admins
Posts: 2307
Member No.: 1
Joined: 12-May 04


Hi,

I would stick to SHGetSpecialFolderPath. Minimum DLL Version shell32.dll version 4.71 or later which is what almost everybody has (I suppose)

Antonis
PMEmail PosterUsers Website
Top
andrew_k
Quote Post


Active Member
***

Group: Members
Posts: 41
Member No.: 34
Joined: 25-May 04


Hi Akyprian,
Thanks for your reply. I have been doing some digging around and have discovered that Microsoft actually intended the writers of installation programs for Win 9x to query the key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ProgramFilesDir to get the program files directory. The key is universal across all versions of Windows too.

Cheers,
Andrew
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google