Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 1.6

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 Macwelt and has made many crossplatform applications using REALbasic.
Article Description: No description available.
Article Length (in bytes): 5,391
Starting Page Number: 37
Article Number: 1619
Resource File(s):

Download Icon 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.