unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls, Menus;
type
TForm1 =
class(TForm)
TreeView1: TTreeView;
PopupMenu1: TPopupMenu;
GetResources1: TMenuItem;
procedure GetResources1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
NewNode: TTreeNode;
Start: TTreeNode;
implementation
{$R *.DFM}
function EnumNamesFunc(hModule:THandle; lpType, lpName:PChar; lParam: DWORD):BOOL;
stdcall;
begin
Result := True;
Form1.TreeView1.Items.AddChild(Start, lpName);
end;
function EnumTypesFunc(
Handle: THandle; lpszType: PChar; lParam: DWORD):BOOL;
stdcall;
// --> Parameter Dekl. korrekt?
begin
Result := True;
Start := Form1.TreeView1.Items.AddChild(NewNode, '
bla');
//Start := Form1.TreeView1.Items.AddChild(NewNode, lpszType); --> funktioniert nicht!
EnumResourceNames(0, lpszType, @EnumNamesFunc, 0);
end;
procedure TForm1.GetResources1Click(Sender: TObject);
begin
TreeView1.Items.BeginUpdate;
TreeView1.Items.Clear;
NewNode := TreeView1.Items.Add(
nil, '
Resources');
EnumResourceTypes(0, @EnumTypesFunc, 0);
TreeView1.FullExpand;
TreeView1.Items.EndUpdate;
end;
end.