[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Dir-path for Start menu\Programs

Posted on 2000-02-28
5
Medium Priority
?
201 Views
Last Modified: 2010-04-04
Where in RegEdit can I get the dir-path to \Start menu\Programs ? Platform independent.....

I've looked in RegEdit and found that the path (in RegEdit) isn't the same in 95 and NT. I've also tried to use SHGetSpecialFolderLocation (CSIDL_STARTMENU) but then i miss \programs part.
0
Comment
Question by:espensen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 2

Expert Comment

by:craig_capel
ID: 2564440
I thought you had to use DDE and talk to explorer to do this......
0
 
LVL 6

Accepted Solution

by:
Jaymol earned 200 total points
ID: 2564450
Type
  TWinDirectory=(wdAppData, wdCache, wdCookies, wdDesktop, wdFavourites,
                 wdFonts, wdHistory, wdNetHood, wdPersonal, wdPrintHood,
                 wdPrograms, wdRecent, wdSendTo, wdStartMenu, wdStartUp,
                 wdTemplates, wdUser);

function       GetWindowsDir(wdDirectoryName : TWinDirectory): String;
begin
      Case wdDirectoryName of
        wdAppData            : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'AppData');
        wdCache                  : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Cache');
        wdCookies            : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Cookies');
        wdDesktop            : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Desktop');
        wdFavourites: Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Favorites');
        wdFonts                  : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Fonts');
        wdHistory            : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'History');
        wdNetHood            : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'NetHood');
        wdPersonal      : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Personal');
        wdPrintHood      : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'PrintHood');
        wdPrograms      : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Programs');
        wdRecent            : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Recent');
        wdSendTo            : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'SendTo');
        wdStartMenu      : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Start Menu');
        wdStartUp            : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'StartUp');
        wdTemplates      : Result:=ReadRegString(HKEY_CURRENT_USER,
                                                                                                                'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
                                                'Templates');
  end;
end;

Sorry if that's come out looking a bit bad....but that get's any standard windows directory on any platform.

John.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2564454
Sorry....you need ReadRegString as well to make that work....

function      ReadRegString(rHKey: HKey; rKey, rName: String): String;
var
      WinReg      :      TRegistry;
begin
      WinReg:=TRegistry.Create;
  WinReg.RootKey:=rHKey;
  WinReg.OpenKey(rKey, False);
  Result:=WinReg.ReadString(rName);
  WinReg.Free;
end;

That should do the trick.

John.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2564456
If you can't be arsed pasting it, let me know and I'll do a unit and send it to you.  Just give me your email address.

John.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2564561
Thanks!  You just bumped me over 10,000 points!

John.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question