Board index » cppbuilder » One question, srs!

One question, srs!

Good day, ALL!

How can I receive the handle of currently active window, created by VCL
classes? I need it for the API function GetDC to retrieve a handle of a
display device context. It's necessery to be able to get the handle without
specifying window by myself.

Please mail to Galaxy2000...@atlant.ru

A lot of thanks in advance,
Mike

 

Re:One question, srs!


HWND GetActiveWindow(VOID)

This function is in the Win32 Programmer's reference help that came with BCB3

Quote
Crazy Mike wrote:
> Good day, ALL!

> How can I receive the handle of currently active window, created by VCL
> classes? I need it for the API function GetDC to retrieve a handle of a
> display device context. It's necessery to be able to get the handle without
> specifying window by myself.

> Please mail to Galaxy2000...@atlant.ru

> A lot of thanks in advance,
> Mike

Re:One question, srs!


Quote
> How can I receive the handle of currently active window, created by VCL
> classes? I need it for the API function GetDC to retrieve a handle of a

All VCL components that are descendents of TWinControl have a Handle property
that is the HWND that you need.  But most also have a Canvas property that
you can use to draw to them instead of using GetDC.  And if they don't have
a canvas property, you can use a component found in the Ziegler Collection to
add one to any component:

http://www.zieglersoft.com

+===================================================+
| Jonathan Arnold (mailto:jdarn...@buddydog.org)    |
| Senior Engineer           Roger Wagner Publishing |
| http://people.ne.mediaone.net/jdarnold            |
+===================================================+

"There is no psychiatrist in the world like a puppy{*word*180}ing your
 face." -- Ben Williams

Other Threads