Question

Given a handle of type HWND is it possible to confirm that the handle represents a real window?

Was it helpful?

Solution

There is a function IsWindow which does exactly what you asked for.

BOOL isRealHandle = IsWindow(unknwodnHandle);

Look at this link for more information.

OTHER TIPS

Generally no. By the time you've got confirmation that a Window is valid another process/thread my come along and remove it for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top