也可用 SHGetSpecialFolderPath()
DECLARE LONG SHGetSpecialFolderPath IN shell32.dll LONG, STRING@, LONG, LONG
#define CSIDL_DESKTOP
0x0000
#define CSIDL_STARTMENU
0x000b
? _GeSysPath(CSIDL_DESKTOP)
? _GeSysPath(CSIDL_STARTMENU)
CREATE CURSOR tt (CSIDL I, PATH C(240))
FOR i=0 TO 60
INSERT INTO tt VALUES (i, _GeSysPath(i))
ENDFOR
GO TOP
BROWSE
FUNCTION _GeSysPath(nFolder)
LOCAL cPath
cPath = SPACE(260)
IF SHGetSpecialFolderPath(0, @cPath, nFolder, 0) == 0
RETURN "<NULL>"
ENDIF
RETURN LEFT(cPath, AT(0h00,cPath)-1)
ENDFUNC