Hi:
I'm having trouble with this simple FindWindow example
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
HandleId: HWND;
begin
HandleId := FindWindow('TForm1', 'Form1');
if HandleId <> 0 then
ShowMessage('Found');
end;
The window is not found.
The same code ported to delphi is working fine, so I don't think that it should be windows 11 related.
Any tips?