Article Preview
Buy Now
COLUMN
Special folders
Getting folderitems to folders on Windows which depend on configuration
Issue: 1.6 (June/July 2003)
Author: Christian Schmitz
Author Bio: Christian Schmitz has written several articles for the German magazine
Article Description: No description available.
Article Length (in bytes): 5,391
Starting Page Number: 37
Article Number: 1619
Resource File(s):
1619.zip Updated: 2013-03-11 19:07:56
Related Web Link(s):
http://msdn.microsoft.com/library/en-us/shellcc/platform/Shell/reference/functions/shgetfolderpath.asp
Excerpt of article text...
Today we will take a big look into the declare statement of REALbasic to get folderitems which point to folders on the user's hard disk. Folders like the user's picture folder have paths that depend on the username or the Windows version. Some RB programmers thought that the application folder is just sitting at "C:\Program Files", but it isn't! On a German system, it's in "C:\Programme". Thinking the Windows directory is always "C:\Windows" is simply wrong. Windows NT uses as default "C:\WINNT". Users may even have two Windows versions on the same partition, so even if "C:\Windows" exists, we might run NT from "C:\WINNT". To avoid that, we will add a function to return folderitems to special folders for which Windows can tell us the location.
Borrowed from C code
From the Win32 SDK Header files (free to download from Microsoft), we find a function called SHGetFolderPath which returns information on a given folder:
SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath);
...End of Excerpt. Please purchase the magazine to read the full article.