Einzelnen Beitrag anzeigen

Benutzerbild von mOzZzI
mOzZzI

Registriert seit: 11. Nov 2005
Ort: Bamberg
320 Beiträge
 
Delphi 2006 Professional
 
#2

Re: Arbeitsplatz öffnen mit Delphi-App

  Alt 17. Feb 2006, 16:09
Hi das geht glaub ich so,

Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ShellAPI, StdCtrls, ShlOBJ;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  Info: ShellExecuteInfo;
  List: PItemIDList;

begin
  SHGetSpecialFolderLocation(GetActiveWindow, CSIDL_DRIVES, List);

  ZeroMemory(@Info, SizeOf(ShellExecuteInfo));
  Info.cbSize := SizeOf(ShellExecuteInfo);
  Info.lpVerb := 'explore'; //Diese Zeile kannst du auch entfernen, wenn du die TreeView anzeige nicht haben möchtest...
  Info.Wnd := GetActiveWindow;
  Info.fMask := SEE_MASK_IDLIST;
  Info.lpIDList := List;
  Info.nShow := SW_SHOWMAXIMIZED; //auch veränderbar ;-)

  ShellExecuteEx(@Info)
end;

end.
Damit kann man auch EigeneDateien öffnenund mehr...

Gruß Philipp
--Mfg mozZzI--------------
Get & Test my ToolBar (550 KB)
Thread & Comments Here
------------------------------
  Mit Zitat antworten Zitat