Autor Beitrag
mderinger@netcom.de
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Di 01.08.06 08:41 
Die Shell32.Dll exportiert die Funktionen ShSetFolderPathA (231) und SHSetFolderPathW (232). Die Funktionen werden jedoch nicht per namen exportiert sondern können nur über ihren Index (Ordinary-Value) erreicht werden.

1. Versuch:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  Procedure shSetFolderPath(Clsid:DWord; hToken:THandle; DWFlags:DWord; pszPath:pChar);
            StdCallexternal 'Shell32.dll' index 232;

  //Der Aufruf dieser Funktion tut nichts!?!


2. Versuch:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
  var hshell32dll:THandle;
      pShsetFolderPath
            :procedure(Clsid:DWord;hToken:THandle;DWFlags:DWord;pszPath:pChar);
begin
    hshell32dll:=GetModuleHandle(pchar('shell32.dll'));
    @pShSetFolderPath:=getProcAddress((hshell32dll, ??lpProcName??));
end;

// ????? Wie muss ich hier den lpProcName als ordinal-Wert angeben??
// Die MSDN schreibt dazu:
//[out] Pointer to a null-terminated string containing the function name, or specifies 
//the function's ordinal value. If this parameter is an ordinal value, it must be in the 
//low-order word; the high-order word must be zero.


Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 01.08.06 09:05 
Moin und :welcome: im Forum!

Steht doch da:
MSDN hat folgendes geschrieben:
Pointer to a null-terminated string containing the function name, [highlight]or specifies
//the function's ordinal value. If this parameter is an ordinal value, it must be in the
//low-order word[/highlight]; the high-order word must be zero.

Also:
ausblenden Delphi-Quelltext
1:
@pShSetFolderPath:=getProcAddress(hshell32dll,Pointer(232));					

cu
Narses

PS: Nimm doch nächstes mal bitte die Delphi-Tags, kann man den Code besser lesen. ;)

_________________
There are 10 types of people - those who understand binary and those who don´t.