Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:21 pm
by allistar >> Tue, 11 Feb 2003 23:40:45 GMT
Hi Haydn,
This C++ code will do the trick. You can make an external function
that gets called from Jade:
BOOL ok = true;
char *desktopPath = (char*)malloc(MAX_PATH);
LPITEMIDLIST desktopPidl;
LPMALLOC shellMalloc;
ok = !FAILED(SHGetMalloc(&shellMalloc));
if (ok) {
ok = !FAILED(SHGetSpecialFolderLocation(NULL,
CSIDL_DESKTOPDIRECTORY, &desktopPidl));
}
if (ok) {
ok = SHGetPathFromIDList(desktopPidl, desktopPath);
}
if (ok) {
shellMalloc->Free(desktopPidl);
shellMalloc->Release();
//now "desktopPath" contains the desktop pacth for
this computer.
}
free(desktopPath);
free(path);
Regards,
Allistar.
------------------------------------------------------------------
Allistar Melville
Software Developer
Auckland, NEW ZEALAND
Greentree International,
Developer of Greentree Financial Software. ------------------------------------------------------------------