Dmitry
Dmitry

Reputation: 14632

How to convert Application.ActiveFormHandle to TForm object in Delphi?

We may get THandle of active form by Application.ActiveFormHandle or by GetForegroundWindow when Application.Active = True.

But how to get active form object?

Or how to convert Application.ActiveFormHandle to object on Delphi?

Upvotes: 2

Views: 2531

Answers (1)

Ondrej Kelle
Ondrej Kelle

Reputation: 37221

If you have a window handle and want to get the VCL control to which this handle belongs you can use FindControl. If you just want to get the active form you can use Screen.ActiveForm.

Upvotes: 7

Related Questions