Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create a hidden window?

5 views
Skip to first unread message

alexwu

unread,
Sep 13, 2004, 2:38:45 AM9/13/04
to
How to create a hidden message window in a worker thread and this window can
be used to receive network messages?

Thanks in advance!


Tim Robinson

unread,
Sep 13, 2004, 6:42:31 AM9/13/04
to
alexwu wrote:
> How to create a hidden message window in a worker thread and this
> window can be used to receive network messages?

Call CreateWindow as normal, but don't specify WS_VISIBLE, and don't call
ShowWindow.

If you're creating windows on more than one thread in a process, be very
careful about inter-thread communication: it's very easy to deadlock in a
situation with more than one UI thread.

General guidelines:
1) Only ever create or use windows from one thread
2) Otherwise, only ever communicate between threads using PostMessage: no
SendMessage or other API calls that take an HWND

--
Tim Robinson (MVP, Windows SDK)
http://mobius.sourceforge.net/


0 new messages