 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
SRD Guest
|
Posted: Thu Jan 25, 2007 1:34 am Post subject: How to go to virtual desktop with opendialog |
|
|
Anyone know how to get a regular opendialog to go to the main desktop
programmatically? I don't want to open the actual desktop folder but the
virtual desktop. Same as when you use the folder dropdown in the dialog and
select the desktop item at the top. Using D6. Found a lot of tricks for
the common file dialogs but not this one.
Thanks |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jan 31, 2007 3:52 am Post subject: Re: How to go to virtual desktop with opendialog |
|
|
After a few minutes of research on Google, do this:
Include 'ShlObj' in your uses.
function GetDesktopPath(): string;
var
DesktopPidl: PItemIDList;
DesktopPath: array [0..MAX_PATH] of Char;
begin
SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, DesktopPidl);
SHGetPathFromIDList(DesktopPidl, DesktopPath);
Result := DesktopPath;
end;
Then to make sure that it opens to it, before calling your
OpenDialog.Execute(), issue:
OpenDialog1.InitialDir := GetDesktopPath(); |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|