unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ShellApi, ShlObj,
ActiveX;
type
TForm1 =
class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
FShellLibrary: IShellLibrary;
public
{ Public declarations }
end;
function SHLoadLibraryFromParsingName( libraryParsingName: PWideChar;
stgmFlags: dword;
const riid: TIID;
var ppv: Pointer): HResult;
stdcall;
var
Form1: TForm1;
implementation
{$R *.dfm}
function SHLoadLibraryFromParsingName;
external shell32
name '
SHLoadLibraryFromParsingName';
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text := '
::{031E4825-7B94-4DC3-B131-E946B44C8DD5}\Documents.library-ms';
// ParsingName für die Dokumente-Bibliothek
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Succeeded(SHLoadLibraryFromParsingName( PWideChar(Edit1.Text),
STGM_READWRITE, IID_IShellLibrary, Pointer(FShellLibrary)) )
then
ShowMessage('
Success');
end;
end.