AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Windows 7, wie bekomme ich IShellLibrary Interface
Thema durchsuchen
Ansicht
Themen-Optionen

Windows 7, wie bekomme ich IShellLibrary Interface

Ein Thema von marcos · begonnen am 5. Apr 2010 · letzter Beitrag vom 8. Apr 2010
 
marcos

Registriert seit: 6. Mai 2006
50 Beiträge
 
#4

Re: Windows 7, wie bekomme ich IShellLibrary Interface

  Alt 5. Apr 2010, 15:58
SHLoadLibraryFromParsingName wäre wohl die richtige Funktion.
Ich habe versucht die Funktion zu deklarieren (Delphi 2010 scheint die Deklaration noch nicht zu haben).
Leider das Programm kompiliert, aber startet auch nicht - keine Fehlermeldung. Was ist da noch falsch?

marcos

Delphi-Quellcode:
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.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz