` Current User Desktop Folder (Dave Nichols ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Current User Desktop Folder
2013-06-27 -- Dave Nichols
 
!Get the users or global Desktop path !gxGetDesktopPath(BYTE=0),STRING ! ! !the Desktop path or '' if can't find it ! !iff TRUE get the common desktop (all users), else just this users gxGetDesktopPath FUNCTION(Common) CSIDL:CREATE EQUATE(8000h) CSIDL:COMMON_DESKTOPDIRECTORY EQUATE(0019h) CSIDL:DESKTOPDIRECTORY EQUATE(0010h) DesktopPath CSTRING(261),AUTO PIDL LONG FolderId LONG CODE IF Common FolderId = CSIDL:COMMON_DESKTOPDIRECTORY ELSE FolderId = CSIDL:DESKTOPDIRECTORY END IF SHGetSpecialFolderLocation(0,FolderId+CSIDL:CREATE,PIDL) = 0 IF SHGetPathFromIDList(PIDL,DesktopPath) = 1 !OK ELSE DesktopPath = '' END CoTaskMemFree(PIDL) ELSE DesktopPath = '' END RETURN Clip(DesktopPath) The windoze prototypes are: SHGetSpecialFolderLocation(LONG,LONG,*LONG),LONG,PASCAL,RAW,NAME('SHGetSpecialFolderLocation') SHGetPathFromIDList(LONG,*CSTRING),BYTE,PASCAL,RAW,NAME('SHGetPathFromIDList') CoTaskMemFree(LONG),PASCAL,RAW,NAME('CoTaskMemFree') and gxGetDesktopPath(BYTE=0),STRING


Today is November 21, 2024, 3:35 am
This article has been viewed 35315 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: