Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  3 691

•  TDictionary Custom Sort  5 821

•  Fast Watermark Sources  5 623

•  3D Designer  8 257

•  Sik Screen Capture  5 944

•  Patch Maker  6 405

•  Айболит (remote control)  6 400

•  ListBox Drag & Drop  5 253

•  Доска для игры Реверси  94 598

•  Графические эффекты  6 591

•  Рисование по маске  5 670

•  Перетаскивание изображений  4 781

•  Canvas Drawing  5 156

•  Рисование Луны  4 886

•  Поворот изображения  4 432

•  Рисование стержней  3 137

•  Paint on Shape  2 378

•  Генератор кроссвордов  3 247

•  Головоломка Paletto  2 570

•  Теорема Монжа об окружностях  3 348

•  Пазл Numbrix  2 217

•  Заборы и коммивояжеры  2 865

•  Игра HIP  1 840

•  Игра Go (Го)  1 758

•  Симулятор лифта  2 089

•  Программа укладки плитки  1 815

•  Генератор лабиринта  2 256

•  Проверка числового ввода  1 946

•  HEX View  2 244

•  Физический маятник  1 927

 
скрыть

  Форум  

Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Перечислить формы и дочерние формы



Оформил: DeeCo

type
   PWindows = ^TWindows;
   TWindows = record
     WindowHandle: HWND;
     WindowText: string;
   end;

 type
   TForm1 = class(TForm)
     Button1: TButton;
     TreeView1: TTreeView;
     procedure Button1Click(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
   private
     { Private declarations }
   public
     { Public declarations }
   end;

 var
   Form1: TForm1;
   PNode, CNode: TTreeNode;
   AWindows: PWindows;

 implementation

 {$R *.DFM}

 function EnumChildWindowsProc(Wnd: HWnd; Form: TForm1): Bool; export;
   {$ifdef Win32} stdcall; {$endif}
 var
   Buffer: array[0..99] of Char;
 begin
   GetWindowText(Wnd, Buffer, 100);
   //if StrLen(Buffer)  0 then 
  if StrPas(Buffer) = '' then Buffer := 'Empty';
   new(AWindows);
   with AWindows^ do
   begin
     WindowHandle := Wnd;
     WindowText   := StrPas(Buffer);
   end;

   CNode := Form1.TreeView1.Items.AddChildObject(PNode,
                  AWindows^.WindowText + ':' +
                  IntToHex(AWindows^.WindowHandle, 8), AWindows);
   if GetWindow(Wnd, GW_CHILD)  0 then
   begin
     PNode := CNode;
     Enumchildwindows(Wnd, @EnumChildWindowsProc, 0);
   end;
   Result := True;
 end;

 function EnumWindowsProc(Wnd: HWnd; Form: TForm1): Bool;
   export; {$ifdef Win32} stdcall; {$endif}
 var
   Buffer: array[0..99] of Char;
 begin
   GetWindowText(Wnd, Buffer, 100);
   //if StrLen(Buffer)  0 then 
  if StrPas(Buffer) = '' then Buffer := 'Empty';
   new(AWindows);
   with AWindows^ do
   begin
     WindowHandle := Wnd;
     WindowText   := StrPas(Buffer);
   end;

   PNode := Form1.TreeView1.Items.AddObject(nil, AWindows^.WindowText + ':' +
     IntToHex(AWindows^.WindowHandle, 8), AWindows);
   EnumChildWindows(Wnd, @EnumChildWindowsProc, 0);
   Result := True;
 end;

 procedure TForm1.Button1Click(Sender: TObject);
 begin
   EnumWindows(@EnumWindowsProc, Longint(Self));
 end;

 procedure TForm1.FormDestroy(Sender: TObject);
 begin
   Dispose(AWindows);
 end;

 end.


 {**********************************************}
 {  Other Code by NicoDE 
{**********************************************}

 type
   PMyEnumParam = ^TMyEnumParam;
   TMyEnumParam = record
     Nodes: TTreeNodes;
     Current: TTreeNode;
   end;

 function EnumWindowsProc(Wnd: HWND; Param: PMyEnumParam): BOOL; stdcall;
 const
   MyMaxName = 64;
   MyMaxText = 64;
 var
   ParamChild: TMyEnumParam;
   ClassName: string;
   WindowText: string;
 begin
   Result := True;
   SetLength(ClassName, MyMaxName);
   SetLength(ClassName, GetClassName(Wnd, PChar(ClassName), MyMaxName));
   SetLength(WindowText, MyMaxText);
   SetLength(WindowText, SendMessage(Wnd, WM_GETTEXT, MyMaxText, lParam(PChar(WindowText))));
   ParamChild.Nodes   := Param.Nodes;
   ParamChild.Current := Param.Nodes.AddChildObject(Param.Current,
     '[' + ClassName + '] "' + WindowText + '"' + ' Handle: ' + IntToStr(Wnd), Pointer(Wnd));
   EnumChildWindows(Wnd, @EnumWindowsProc, lParam(@ParamChild));
 end;


 procedure TForm1.Button1Click(Sender: TObject);
 var
   Param: TMyEnumParam;
 begin
   Param.Nodes := TreeView1.Items;
   Param.Current := TreeView1.TopItem;
   TreeView1.Items.BeginUpdate;
   EnumWindows(@EnumWindowsProc, lParam(@Param));
   TreeView1.Items.EndUpdate;
 end;







Copyright © 2004-2025 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте