Is it safe to use IsWindow(hWnd) to check if a window has closed?
Or can a new window be assigned the same hWnd by the OS in the time be开发者_开发技巧tween the window closing and my code checking?
No, it is not safe because window handles are recycled.
It's not safe to use handles that have been destroyed.
Instead you could check if the window exists by looking for a class name.
精彩评论