Board index » delphi » Open Windows Virtual Folders Window (My Computer, Control Panel)

Open Windows Virtual Folders Window (My Computer, Control Panel)

how to open a Windows virtual folder like "My Computer" or "Control Panel"
in code
--
Efraim Gotlib
Efiguti Software
efig...@geocities.com
http://www.come.to/efiguti

begin 666 Efraim Gotlib.vcf
M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..D=O=&QI8CM%9G)A:6T-"D9.
M.D5F<F%I;2!';W1L:6(-"DY)0TM.04U%.D5F:6=U=&D-"D]21SI%9G5I9W5T
M:2!3;V9T=V%R90T*0412.TA/344Z.SL[2F5R=7-A;&5M.TES<F%E;#LY-30P
M, T*3$%"14P[2$]-13I*97)U<V%L96TL($ES<F%E;" Y-30P, T*6"U704(M
M1T5.1$52.C(-"E523#IH='1P.B\O=W=W+F-O;64N=&\O969I9W5T:0T*0D1!
M63HQ.3<W,#<R-PT*14U!24P[4%)%1CM)3E1%4DY%5#IE9FEG=71I0&=E;V-I
K=&EE<RYC;VT-"E)%5CHQ.3DY,#@P,U0P,# T,SA:#0I%3D0Z5D-!4D0-"@``
`
end

 

Re:Open Windows Virtual Folders Window (My Computer, Control Panel)


Efraim Gotlib a crit dans le message
<7o5bh4$68...@news.netvision.net.il>...

Quote
>how to open a Windows virtual folder like "My Computer" or "Control Panel"
>in code
>--
>Efraim Gotlib
>Efiguti Software
>efig...@geocities.com
>http://www.come.to/efiguti

procedure LaunchSHFolder(Folder: integer);
var ppidl: PItemIDList;
    FPath: array[0..MAX_PATH] of Char;
begin
 if SHGetSpecialFolderLocation(Application.Handle, Folder, ppidl)<>NOERROR
then
  begin
   MessageDlg('Could not retrieve folder location.', mtError, [mbOk], 0);
   exit;
  end;
 SHGetPathFromIDList(ppidl, FPath);
 ShellExecute(Application.Handle, 'open', 'explorer.exe', FPath, '',
SW_SHOW);
end;

Special folders consts:
CSIDL_BITBUCKET Recycle bin - file system directory containing file objects
in the user's recycle bin. The location of this directory is not in the
registry; it is marked with the hidden and system attributes to prevent the
user from moving or deleting it.
CSIDL_CONTROLS Control Panel - virtual folder containing icons for the
control panel applications.
CSIDL_DESKTOP Windows desktop - virtual folder at the root of the name
space.
CSIDL_DESKTOPDIRECTORY File system directory used to physically store file
objects on the desktop (not to be confused with the desktop folder itself).
CSIDL_DRIVES My Computer - virtual folder containing everything on the local
computer: storage devices, printers, and Control Panel. The folder may also
contain mapped network drives.
CSIDL_FONTS Virtual folder containing fonts.
CSIDL_NETHOOD File system directory containing objects that appear in the
network neighborhood.
CSIDL_NETWORK Network Neighborhood - virtual folder representing the top
level of the network hierarchy.
CSIDL_PERSONAL File system directory that serves as a common respository for
documents.
CSIDL_PRINTERS Printers folder - virtual folder containing installed
printers.
CSIDL_PROGRAMS File system directory that contains the user's program groups
(which are also file system directories).
CSIDL_RECENT File system directory that contains the user's most recently
used documents.
CSIDL_SENDTO File system directory that contains Send To menu items.
CSIDL_STARTMENU File system directory containing Start menu items.
CSIDL_STARTUP File system directory that corresponds to the user's Startup
program group.
CSIDL_TEMPLATES File system directory that serves as a common repository for
document templates.

**************************************
Note that you must include shlobj & shellapi in your form's header uses
declaration.
I've seen a way to open one those special folders without the need to
retrieve the path
(just using ID) but I can't remember how...

Regards,
aPons

Other Threads