Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

Intel corner

Special folders

Getting folderitems to folders on Windows which depend on configuration

Issue: 1.6 (June/July 2003)
Author: Christian Schmitz, cSchmitz-at-rbdeveloper.com
Author Bio: Christian Schmitz has written several articles for the German magazine Macwelt and has made many crossplatform applications using REALbasic.
Article Description: No description available.
Article Length (in bytes): 4,644
Starting Page Number: 37
RBD Number: 1619
Resource File(s):

Download Icon 1619.sit Updated: Friday, October 17, 2003 at 12:21 PM

Related Web Link(s):

http://msdn.microsoft.com/library/en-us/shellcc/platform/Shell/reference/functions/shgetfolderpath.asp

Known Limitations: None

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.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com