The IsWindow function determines whether the specified window handle identifies an existing window. This is a simple wrapper around Win32 function.
$is_window = IsWindow( $hwnd );
Handle to be verified
TRUE is $hwnd identifies existing window. FALSE otherwise