` Printed Icetips Article

Icetips Article



Windows API: SHGetFolderLocation - 1
2002-08-06 -- Mark Sarson
 
Newsgroups: comp.lang.clarion


Here are the equates and module definition.

HTH

Mark Sarson

Equates

SHITEMID  GROUP,TYPE
cb    USHORT
abID  BYTE
 END

ITEMIDLIST GROUP,TYPE
mkid LIKE(SHITEMID)
 END

CSIDL_DESKTOP  EQUATE(0H)                 !{desktop}
CSIDL_INTERNET  EQUATE(1H)                !Internet Explorer (icon on desktop)
CSIDL_PROGRAMS  EQUATE(2H)                !Start Menu\Programs
CSIDL_CONTROLS  EQUATE(3H)                !My Computer\Control Panel
CSIDL_PRINTERS  EQUATE(4H)                !My Computer\Printers
CSIDL_PERSONAL  EQUATE(5H)                !My Documents
CSIDL_FAVORITES  EQUATE(6H)               !{user name}\Favorites
CSIDL_STARTUP  EQUATE(7H)                 !Start Menu\Programs\Startup
CSIDL_RECENT  EQUATE(8H)                  !{user name}\Recent
CSIDL_SENDTO  EQUATE(9H)                  !{user name}\SendTo
CSIDL_BITBUCKET  EQUATE(0AH)               !{desktop}\Recycle Bin
CSIDL_STARTMENU  EQUATE(0BH)               !{user name}\Start Menu
CSIDL_DESKTOPDIRECTORY  EQUATE(10H)       !{user name}\Desktop
CSIDL_DRIVES  EQUATE(11H)                 !My Computer
CSIDL_NETWORK  EQUATE(12H)                !Network Neighborhood
CSIDL_NETHOOD  EQUATE(13H)                !{user name}\nethood
CSIDL_FONTS  EQUATE(14H)                  !windows\fonts
CSIDL_TEMPLATES  EQUATE(15H)
CSIDL_COMMON_STARTMENU  EQUATE(16H)       !All Users\Start Menu
CSIDL_COMMON_PROGRAMS  EQUATE(17H)        !All Users\Programs
CSIDL_COMMON_STARTUP  EQUATE(18H)         !All Users\Startup
CSIDL_COMMON_DESKTOPDIRECTORY  EQUATE(19H)!All Users\Desktop
CSIDL_APPDATA  EQUATE(1AH)                !{user name}\Application Data
CSIDL_PRINTHOOD  EQUATE(1BH)              !{user name}\PrintHood
CSIDL_LOCAL_APPDATA  EQUATE(1CH)          !{user name}\Local
Settings\Application Data (non roaming)
CSIDL_ALTSTARTUP  EQUATE(1DH)             !non localized startup
CSIDL_COMMON_ALTSTARTUP  EQUATE(1EH)      !non localized common startup
CSIDL_COMMON_FAVORITES  EQUATE(1FH)
CSIDL_INTERNET_CACHE  EQUATE(20H)
CSIDL_COOKIES  EQUATE(21H)
CSIDL_HISTORY  EQUATE(22H)
CSIDL_COMMON_APPDATA  EQUATE(23H)          !All Users\Application Data
CSIDL_WINDOWS  EQUATE(24H)                 !GetWindowsDirectory()
CSIDL_SYSTEM  EQUATE(25H)                  !GetSystemDirectory()
CSIDL_PROGRAM_FILES  EQUATE(26H)           !C:\Program Files
CSIDL_MYPICTURES  EQUATE(27H)              !C:\Program Files\My Pictures
CSIDL_PROFILE  EQUATE(28H)                 !USERPROFILE
CSIDL_SYSTEMX86  EQUATE(29H)               !x86 system directory on RISC
CSIDL_PROGRAM_FILESX86  EQUATE(2AH)        !x86 C:\Program Files on RISC
CSIDL_PROGRAM_FILES_COMMON  EQUATE(2BH)    !C:\Program Files\Common
CSIDL_PROGRAM_FILES_COMMONX86  EQUATE(2CH) !x86 Program Files\Common on RISC
CSIDL_COMMON_TEMPLATES  EQUATE(2DH)        !All Users\Templates
CSIDL_COMMON_DOCUMENTS  EQUATE(2EH)        !All Users\Documents
CSIDL_COMMON_ADMINTOOLS  EQUATE(2FH)       !All Users\Start
Menu\Programs\Administrative Tools
CSIDL_ADMINTOOLS  EQUATE(30H)              !{user name}\Start
Menu\Programs\Administrative Tools

CSIDL_FLAG_CREATE  EQUATE(8000H)           !combine with CSIDL_ value to force create on
SHGetSpecialFolderLocation()
CSIDL_FLAG_DONT_VERIFY  EQUATE(4000H)      !combine with CSIDL_ value to
force create on SHGetSpecialFolderLocation()
CSIDL_FLAG_MASK  EQUATE(0FF00H)            !mask for all possible flag
values
SHGFP_TYPE_CURRENT  EQUATE(0)              !current value for user, verify
it exists
SHGFP_TYPE_DEFAULT  EQUATE(1)

MAX_LENGTH EQUATE(260)
S_OK EQUATE(0)
S_FALSE EQUATE(1)



Definition

MODULE('shfolder')

SHGetFolderPath(Long,Long,Long,Long,*CSTRING),Long,PASCAL,RAW,NAME('SHGetFol
derPathA')
END

an example of calling the above is as follows. It retrieves the my documents
folder

If SHGetFolderPath(0{prop:handle}, CSIDL_PERSONAL, 0, SHGFP_TYPE_CURRENT,
sPath) = S_OK Then
!   blah blah
End

"Roel S.F. Abspoel"  wrote in message
news:3d4fce84@news.softvelocity.com...
> Im looking for a way to get the paths to special folders, like the
> favorites, the desktopdirectory, the history, the fonts etc.. Browsing
> through MSDN i found SHGetFolderLocation with a truckload of options. I
> hoped this was prototyped in the WINAPI app from Clarion but no luck.
>
> Has anyone used this api or can anyone help me get it up and running? or
> does anyone have a better solution to finding these folders?
>
> Thanks in advance,
>
> --
> Met vriendelijke groet,
>
> Roel S.F. Abspoel
>
>


---
Outgoing mail is certified Virus Free.
www.compushopuk.com
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 15/07/02



Printed November 23, 2024, 5:58 am
This article has been viewed/printed 35461 times.
Google search has resulted in 463 hits on this article since January 25, 2004.