Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validating a Win32 Window Handle

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

like image 850
John Richardson Avatar asked Aug 13 '08 11:08

John Richardson


2 Answers

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

BOOL isRealHandle = IsWindow(unknwodnHandle);

Look at this link for more information.

like image 153
Serge Avatar answered Nov 15 '22 13:11

Serge


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.

like image 23
graham.reeds Avatar answered Nov 15 '22 13:11

graham.reeds