RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TApplication.Handle Property

Provides access to the window handle of the main form (window) of the application.

Pascal
property Handle: HWnd;
C++
__property HWnd Handle;

Use Handle when calling Windows API functions that require a parent window handle. For example, a DLL that displays its own top-level pop-up windows needs a parent window to display its windows in the application. Using the Handle property makes such windows part of the application, so that they are minimized, restored, enabled, and disabled with the application.

Note: When writing a DLL that uses VCL forms, assign the window handle of the host EXE's main window to the DLL's Application.HandleApplication->Handle property. This makes the DLL's form part of the host application. Never assign to the Handle property in an EXE.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!