开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜