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

Child Windows & WM_ACTIVATE

163 views
Skip to first unread message

Bill D. Baldasti

unread,
Jun 18, 1998, 3:00:00 AM6/18/98
to

Does anyone know how to enable windows of type CHILDWINDOW to receive
WM_ACTIVATE messages (or a suitable equivalent)? I want to draw
something in the child window whenever it is clicked on/activated and
remove the drawing when it's deselected.

Please help!

Thanks.
Bill


Agent

unread,
Jun 19, 1998, 3:00:00 AM6/19/98
to

Bill D. Baldasti wrote in message
<35895C6F...@NOSPAM.ca.ibm.com>...

>Does anyone know how to enable windows of type CHILDWINDOW to receive
>WM_ACTIVATE messages (or a suitable equivalent)? I want to draw
>something in the child window whenever it is clicked on/activated and
>remove the drawing when it's deselected.


You can use MDIActivate for MDI windows, but only top-level windows can
get WM_ACTIVATE; you know this, of course. Maybe what you want is a
WM_SETFOCUS handler.


Norman Bullen

unread,
Jun 19, 1998, 3:00:00 AM6/19/98
to Bill D. Baldasti

Bill D. Baldasti wrote:
>
> Does anyone know how to enable windows of type CHILDWINDOW to receive
> WM_ACTIVATE messages (or a suitable equivalent)? I want to draw
> something in the child window whenever it is clicked on/activated and
> remove the drawing when it's deselected.
>
> Please help!
>
> Thanks.
> Bill

As you have discovered, activation does not apply to child (WS_CHILD)
windows. The equivalent, for child windows, is focus. See the
documentaion for WM_SETFOCUS, WM_KILLFOCUS, and SetFocus.

This is necessary because there can be only one active window; your main
window (or a dialog window) becomes active and remains active while
focus moves between its child windows.

Norm

0 new messages