Advertisement

Destroying a window

Started by May 29, 2001 04:23 PM
3 comments, last by Tornado 23 years, 8 months ago
I was just wondering if anyone knows how I can destroy a window that doesn''t belong to the current thread. I know WM_DESTROY won''t work since it can''t be send to a window that wasn''t created using the current thread. Any ideas? Thanks! - Goblineye Entertainment The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction
Sure you can. Perform a FindWindow or somehow locate the HWND then use SendMessage or PostMessage to send the message to the window...whether its WM_CLOSE or WM_DESTROY, or what have you.



Advertisement
There is a fonction call PostThreadMessage which is exactly like post message but for threads.

In WIN32, every threads has it's own message queue. SendMessage sends the messages to the current thread message queue, and PostThreadMessage will send the message to another thread message queue.

Edited by - Gorg on May 31, 2001 9:28:04 AM
Still doesn''t work!
No WM_CLOSE, WM_DESTROY will work.
Tried with SendMessage/PostMessage/PostThreadMessage etc.
Really weird...
Any idea why?



- Goblineye Entertainment
The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction
Hmmm nevermind.
Found an easier way to destroy the window.
I just terminate the process that created it.

Thanks again!



- Goblineye Entertainment
The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction

This topic is closed to new replies.

Advertisement