Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Overflow Error bei EnumChildWindows (https://www.delphipraxis.net/37227-overflow-error-bei-enumchildwindows.html)

Neutral General 2. Jan 2005 18:49


Overflow Error bei EnumChildWindows
 
ich baue eine Komponente die alle ChildWindows eines Fensters anzeigt.

Dazu hab ich eine Function aus der Schweiz (etwas abgeändert,aber nur bei LinesAdd...) :

Delphi-Quellcode:
function EnumProc(wnd: HWND; Lines: TStrings): BOOL; stdcall;
var
  buf, Caption: array[0..255] of char;
  classname : PChar;
begin
  Result := True;
  GetClassName(wnd, buf, SizeOf(buf) - 1);
  SendMessage(wnd, WM_GETTEXT, 256, Integer(@Caption));
  GetClassName(wnd,classname,10);
  Lines.Add(Format(' %s : %d , Caption: %s ',
           [buf, wnd, Caption]));
end;
Die funktioniert auch prima aber meine Komponente hat einen eingebauten Timer in dem etwa das steht :

Delphi-Quellcode:
procedure TMeinControl.Timen(Sender : TObject);
begin
// FControl : TComboBox;
FControl.Clear;
EnumChildWindows(Parent.Handle, @EnumProc, Integer(FControl.Items)); //Parent.Handle nur zur Probe
// Unwichtiges ausgelassen
end;
aber wenn ich diese Komponente auf mein Formular mache bekomme ich nach kurzer ZEit einen OverflowError :gruebel:
Weis jemand woher der kommen kann ?

Neutral General 7. Jan 2005 14:54

Re: Overflow Error bei EnumChildWindows
 
*Auf Antworten warte*


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:48 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz