Цитата:
Сообщение от Страдалецъ
Примерно так
|
Я наверное окончательно отупел... но все же.
Я вставил твой код в код моей кнопки. Поставил таймер.
Код подправил под мои формы.
Общий Код получился вот такой:
Код:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
public
end;
var
Form1: TForm1;
n: Integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
function EnumWindowsProc(wHandle: HWND; Param: Pointer): BOOL; stdcall;
var
Title, ClassName: array[0..255] of char;
begin
GetWindowText(wHandle, Title, 255);
GetClassName(wHandle, ClassName, 255);
if IsWindowVisible(wHandle) and (ClassName = 'TForm8')
then begin
Inc(n);
SetWindowText(wHandle, Format('Кукарямба %d', [n]));
end;
Result := True;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
n := 0;
EnumWindows(@EnumWindowsProc, 0);
end;
Возникает такая ошибка:
Expected BEGIN but received the eng of line 49:1
___________
Как быть ?