Kev #1 you could use the api IsWindow() found within user32.dll pass IsWindow() the HWND pointer returned from QueryObject()