﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <description><![CDATA[Comments for How to find the location of Windows special folders.]]></description>
    <title><![CDATA[Comments for How to find the location of Windows special folders.]]></title>
    <link>http://dn.codegear.com/article/26676</link>
    <!-- source: http://dn.codegear.com/article/26676/feed-->
    <dc:date>2009-01-09T05:42:10-08:00</dc:date>
    <item>
      <description><![CDATA[--um, sorry for my troubled posting before, 2nd part is coming here---art Menu\Programs\Administrative Tools {spfNetworkDialupConnections,      "spfNetworkDialupConnections",        CSIDL_CONNECTIONS},        // Network and Dial-up Connections {spfRISC_SystemX86,                "spfRISC_SystemX86",                  CSIDL_SYSTEMX86},         // x86 system directory on RISC {spfRISC_ProgramFilesX86,          "spfRISC_ProgramFilesX86",            CSIDL_PROGRAM_FILESX86},  // x86 C:\Program Files on RISC {spfRISC_ProgramFilesCommonX86,    "spfRISC_ProgramFilesCommonX86",      CSIDL_PROGRAM_FILES_COMMONX86},  // x86 Program Files\Common on RISC};#define FOLDERCODESLENGTH (sizeof(FolderCodes)/sizeof(FolderCodes[0]))//-----void GetSpecialFolderLocation(SpecialFolder_t FolderType, AnsiString&amp; dest){   dest.SetLength(0);   for(int i=0; i&lt;FOLDERCODESLENGTH; i++)   {      if(FolderCodes[i].FolderType == FolderType )      {         LPITEMIDLIST pidl;         if (SHGetSpecialFolderLocation(0/*Handle*/, FolderCodes[i].WINAPIFolderCode, &amp;pidl) == NOERROR)         {            char buf[MAX_PATH];            SHGetPathFromIDList(pidl,buf);            dest = buf;            return;         }      }   }//for each folder type codes.}//-----int main(){   AnsiString dest;   for(int i=0; i&lt;FOLDERCODESLENGTH; i++)   {      GetSpecialFolderLocation(FolderCodes[i].FolderType, dest);      printf("%d,\"%s\",\"%s\"\n",int(FolderCodes[i].FolderType), FolderCodes[i].FolderName, dest.c_str());   }//for each folder type.   return 0;}//-----]]></description>
      <title><![CDATA[2nd part of getter routine]]></title>
      <managingEditor>
	 (Joseph Ostor)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=31786</guid>
      <dc:date>2002-03-12T16:32:59-07:00</dc:date>
      <pubDate>2002-03-12T16:32:59-07:00</pubDate>
      <source url="http://dn.codegear.com/article/26676/feed">Comments for How to find the location of Windows special folders.</source>
    </item>
    <item>
      <description><![CDATA[Re: previous message: In BCB5, the definition of necessary structures is fine, do not duplicate them. ------If you want a generic routine for getting most file folder info, use this:#include &lt;shlobj.h&gt;#define NO_WIN32_LEAN_AND_MEAN 1#include &lt;vcl.h&gt;#pragma hdrstop#include &lt;stdio.h&gt;typedef enum{ spfDesktop, spfInternetExplorerIconOnDesktop, spfStartMenuPrograms, spfMyComputerControlPanel, spfMyComputerPrinters, spfMyDocuments, spfCurrentUserFavorites, spfStartMenuProgramsStartup, spfCurrentUserRecent, spfCurrentUserSendTo, spfDesktopRecycleBin, spfCurrentUserStartMenu, spfCurrentUserDesktop, spfMyComputer, spfNetworkNeighborhood, spfCurrentUserNetHood, spfWindowsFonts, spfTemplates, spfAllUsersStartMenu, spfAllUsersPrograms, spfAllUsersStartup, spfAllUsersDesktop, spfCurrentUserApplicationData, spfCurrentUserPrintHood, spfCurrentUserLocalAppData, spfnonLocalStartup, spfnonLocalCommonStartup, spfCommonFavorites, spfInternetCache, spfCookies, spfHistory, spfAllUsersApplicationData, spfWindowsDirectory, spfSystemDirectory, spfProgramFiles, spfMyPictures, spfUserProfile, spfProgramFilesCommon, spfAllUsersTemplates, spfAllUsersDocuments, spfAllUsersAdminTools, spfCurrentUserAdminTools, spfNetworkDialupConnections, spfRISC_SystemX86, spfRISC_ProgramFilesX86, spfRISC_ProgramFilesCommonX86,} SpecialFolder_t;struct {SpecialFolder_t FolderType; char* FolderName; unsigned int WINAPIFolderCode;}FolderCodes[] ={ {spfDesktop,                       "spfDesktop",                         CSIDL_DESKTOP},   // &lt;desktop&gt; {spfInternetExplorerIconOnDesktop, "spfInternetExplorerIconOnDesktop",   CSIDL_INTERNET},  // Internet Explorer (icon on desktop) {spfStartMenuPrograms,             "spfStartMenuPrograms",               CSIDL_PROGRAMS},  // Start Menu\Programs {spfMyComputerControlPanel,        "spfMyComputerControlPanel",          CSIDL_CONTROLS},  // My Computer\Control Panel {spfMyComputerPrinters,            "spfMyComputerPrinters",              CSIDL_PRINTERS},  // My Computer\Printers {spfMyDocuments,                   "spfMyDocuments",                     CSIDL_PERSONAL},  // My Documents {spfCurrentUserFavorites,          "spfCurrentUserFavorites",            CSIDL_FAVORITES}, // &lt;user name&gt;\Favorites {spfStartMenuProgramsStartup,      "spfStartMenuProgramsStartup",        CSIDL_STARTUP},   // Start Menu\Programs\Startup {spfCurrentUserRecent,             "spfCurrentUserRecent",               CSIDL_RECENT},    // &lt;user name&gt;\Recent {spfCurrentUserSendTo,             "spfCurrentUserSendTo",               CSIDL_SENDTO},    // &lt;user name&gt;\SendTo {spfDesktopRecycleBin,             "spfDesktopRecycleBin",               CSIDL_BITBUCKET}, // &lt;desktop&gt;\Recycle Bin {spfCurrentUserStartMenu,          "spfCurrentUserStartMenu",            CSIDL_STARTMENU}, // &lt;user name&gt;\Start Menu {spfCurrentUserDesktop,            "spfCurrentUserDesktop",              CSIDL_DESKTOPDIRECTORY}, // &lt;user name&gt;\Desktop {spfMyComputer,                    "spfMyComputer",                      CSIDL_DRIVES},    // My Computer {spfNetworkNeighborhood,           "spfNetworkNeighborhood",             CSIDL_NETWORK},   // Network Neighborhood {spfCurrentUserNetHood,            "spfCurrentUserNetHood",              CSIDL_NETHOOD},   // &lt;user name&gt;\nethood {spfWindowsFonts,                  "spfWindowsFonts",                    CSIDL_FONTS},     // windows\fonts {spfTemplates,                     "spfTemplates",                       CSIDL_TEMPLATES}, {spfAllUsersStartMenu,             "spfAllUsersStartMenu",               CSIDL_COMMON_STARTMENU}, // All Users\Start Menu {spfAllUsersPrograms,              "spfAllUsersPrograms",                CSIDL_COMMON_PROGRAMS},  // All Users\Programs {spfAllUsersStartup,               "spfAllUsersStartup",                 CSIDL_COMMON_STARTUP},   // All Users\Startup {spfAllUsersDesktop,               "spfAllUsersDesktop",                 CSIDL_COMMON_DESKTOPDIRECTORY}, // All Users\Desktop {spfCurrentUserApplicationData,    "spfCurrentUserApplicationData",      CSIDL_APPDATA},           // &lt;user name&gt;\Application Data {spfCurrentUserPrintHood,          "spfCurrentUserPrintHood",            CSIDL_PRINTHOOD},         // &lt;user name&gt;\PrintHood {spfCurrentUserLocalAppData,       "spfCurrentUserLocalAppData",         CSIDL_LOCAL_APPDATA},     // &lt;user name&gt;\Local Settings\Applicaiton Data (non roaming) {spfnonLocalStartup,               "spfnonLocalStartup",                 CSIDL_ALTSTARTUP},        // non localized startup {spfnonLocalCommonStartup,         "spfnonLocalCommonStartup",           CSIDL_COMMON_ALTSTARTUP}, // non localized common startup {spfCommonFavorites,               "spfCommonFavorites",                 CSIDL_COMMON_FAVORITES}, {spfInternetCache,                 "spfInternetCache",                   CSIDL_INTERNET_CACHE}, {spfCookies,                       "spfCookies",                         CSIDL_COOKIES}, {spfHistory,                       "spfHistory",                         CSIDL_HISTORY}, {spfAllUsersApplicationData,       "spfAllUsersApplicationData",         CSIDL_COMMON_APPDATA},    // All Users\Application Data {spfWindowsDirectory,              "spfWindowsDirectory",                CSIDL_WINDOWS},           // GetWindowsDirectory() {spfSystemDirectory,               "spfSystemDirectory",                 CSIDL_SYSTEM},            // GetSystemDirectory() {spfProgramFiles,                  "spfProgramFiles",                    CSIDL_PROGRAM_FILES},     // C:\Program Files {spfMyPictures,                    "spfMyPictures",                      CSIDL_MYPICTURES},        // C:\Program Files\My Pictures {spfUserProfile,                   "spfUserProfile",                     CSIDL_PROFILE},           // USERPROFILE {spfProgramFilesCommon,            "spfProgramFilesCommon",              CSIDL_PROGRAM_FILES_COMMON}, // C:\Program Files\Common {spfAllUsersTemplates,             "spfAllUsersTemplates",               CSIDL_COMMON_TEMPLATES},   // All Users\Templates {spfAllUsersDocuments,             "spfAllUsersDocuments",               CSIDL_COMMON_DOCUMENTS},   // All Users\Documents {spfAllUsersAdminTools,            "spfAllUsersAdminTools",              CSIDL_COMMON_ADMINTOOLS},  // All Users\Start Menu\Programs\Administrative Tools {spfCurrentUserAdminTools,         "spfCurrentUserAdminTools",           CSIDL_ADMINTOOLS},         // &lt;user name&gt;\St]]></description>
      <title><![CDATA[getter routine for Windows special folders]]></title>
      <managingEditor>
	 (Joseph Ostor)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=31785</guid>
      <dc:date>2002-03-12T16:27:50-07:00</dc:date>
      <pubDate>2002-03-12T16:27:50-07:00</pubDate>
      <source url="http://dn.codegear.com/article/26676/feed">Comments for How to find the location of Windows special folders.</source>
    </item>
    <item>
      <description><![CDATA[After poking around with the SHGetSpecialFolderLocation sample code, I've noted these differences/changes were required for me.  I'm using BCB5 pro under W98se &amp; W2K.The constants in the case statement don't match with those in the MS shlobj.h header file at about line 2636.  (Search for "CSIDL_DESKTOP".).Also:I needed to add#include &lt;shlobj.h&gt;#define NO_WIN32_LEAN_AND_MEAN 1  before the usual#include &lt;vcl.h&gt;  at the top of the MainForm's .cpp file.There is no def for LPITEMIDLIST, so after digging up this info, I added these lines in the function:  typedef struct _SHITEMID {      USHORT cb;      BYTE   abID[1];  } SHITEMID, * LPSHITEMID;  // typedef const SHITEMID  * LPCSHITEMID;  // typedef struct _ITEMIDLIST {  //    SHITEMID mkid;  //} ITEMIDLIST, * LPITEMIDLIST;  typedef const ITEMIDLIST * LPCITEMIDLIST;I now get results more like what I was expecting. &lt;g&gt;Hope this helps someone.  wje]]></description>
      <title><![CDATA[How to find the location of Windows special folders.]]></title>
      <managingEditor>
	 (James Weiss)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=30056</guid>
      <dc:date>2001-09-29T13:43:00-07:00</dc:date>
      <pubDate>2001-09-29T13:43:00-07:00</pubDate>
      <source url="http://dn.codegear.com/article/26676/feed">Comments for How to find the location of Windows special folders.</source>
    </item>
    <generator>Atom 1.0 XSLT Transform v1 (http://atom.geekhood.net)</generator>
  </channel>
</rss>