Einzelnen Beitrag anzeigen

Jonas

Registriert seit: 5. Feb 2005
266 Beiträge
 
Delphi 2007 Professional
 
#14

Re: EnumWindowsProc -> EAccessError, OutOfResources

  Alt 31. Jul 2006, 11:28
Ähm, naja ich benutz ja keine Listbox. Ich erstelle die Labels und Images ja direkt aus WindowList ohne vorher 'ne Listbox zu benutzten.
Delphi-Quellcode:
procedure TForm2.Tasks();
var
i: Integer;
begin
  SetLength(WindowList, 0);

  EnumWindows(@EnumWindowsProc, Integer(@WindowList));

  if oldCount <> high(WindowList) then begin

    oldCount := high(WindowList);
    for i := 0 to high(Blabel) do
    Blabel[i].Free;
    for i := 0 to high(task) do
    task[i].Free;
    for i := 0 to high(taskicon) do
    taskicon[i].Free;



For i := Low(WindowList) To High(WindowList) Do
begin
taskhandle[i]:= WindowList[I].Handle;
end;

For i := Low(WindowList) To High(WindowList) Do
begin
task[i]:= TImageEx.Create(nil);
Komischerweise meckert er erst wenn ich das 2. Fenster schließe.


Außerdem hab ich noch ne Frage. Wie unterscheidet sich For i := Low(WindowList) To High(WindowList) Do genau von for i := 0 to Length(WindowList) - 1 do ?
  Mit Zitat antworten Zitat