From: Anagram on
Suppose I wanted to write a function to get miscellaneous information about
a handle, to use that information for debugging that handle. For example,
I might have the following questions about the handle, and want to find the
answers by looking at the information returned by my function.

1. Is it a valid device context handle?
2. Is it a device context for a window client area?
3. What window is it for?
4. What are its coordinates and clipping region?

My question is what Win32 API functions my function would invoke, to get
such information, given the handle. Also what other information might be
useful when debugging a handle.
From: Kellie Fitton on
On Jun 24, 6:00 pm, Anagram <anag...(a)nearmonopolyirkswuss.com> wrote:
> Suppose I wanted to write a function to get miscellaneous information about
> a handle, to use that information for debugging that handle.  For example,
> I might have the following questions about the handle, and want to find the
> answers by looking at the information returned by my function.
>
> 1.  Is it a valid device context handle?
> 2.  Is it a device context for a window client area?
> 3.  What window is it for?
> 4.  What are its coordinates and clipping region?
>
> My question is what Win32 API functions my function would invoke, to get
> such information, given the handle.  Also what other information might be
> useful when debugging a handle.



Hi,

You can use the following APIs to get some limited information
about a handle:

GetObjectType()

GetHandleInformation()

IsWindow()

GetWindowInfo()

http://msdn.microsoft.com/en-us/library/ms533271(VS.85).aspx

http://msdn.microsoft.com/en-us/library/ms724329(VS.85).aspx

http://msdn.microsoft.com/en-us/library/ms633528(VS.85).aspx

http://msdn.microsoft.com/en-us/library/ms633516(VS.85).aspx

Kellie.

From: Gerard on
Kellie Fitton wrote:

> You can use the following APIs to get some limited information
> about a handle:

> GetHandleInformation()


Irrelevant for device context handle.