Hi.
Quick question:
How can i destroy a window that has been created by another thread?
Quick question:
How can i destroy a window that has been created by another thread?
Use DestroyWindow function. This function uses as parameter the handle of the window you wanna destroy.
Use DestroyWindow function.
Or, if you want to be a lot nicer, send a WM_CLOSE message to that window :) DestroyWindow cannot be used to kill a window created in another thread.
Woot, my post counter just hit triple figures :alright:
you can't use DestroyWindow to destroy a window that was created by another thread. that's why i'm asking how to do that. if it was that easy... :p
that's why i'm asking how to do that.
Go back and read my post.... Use SendMessage to post a WM_QUIT or WM_CLOSE message to the window which you want to close.
If you do not have the handle to the window, there is a variety of functions you can use to find it, like FindWindow, GetWindow, EnumWindows, or EnumChildWindows.
thanks a lot. it works fine now :p