Вот из-за Вас полез разбираться
Цитата:
IsWindow function
...
Remarks
A thread should not use IsWindow for a window that it did not create because the window could be destroyed after this function was called. Further, because window handles are recycled the handle could even point to a different window.
MSDN
|
Иными словами, не ты создал окно - нечего в него пальцем тыкать.