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

Create a child window hwnd outside boundaries of parent

618 views
Skip to first unread message

Casey Winn

unread,
Jan 29, 2003, 8:01:36 PM1/29/03
to
I currently have a skinned app that is a circle due to transparencies.
However, I want to have child HWND's that could possibly be over a
transparent area.

Essentially, I need to have a child HWND be able to draw itself even
outside the boundaries of its parent. Does anyone know if this is
possible?

It MUST BE a child window (no titlebar, not movable, and not shown in
the taskbar)...

________
| |
| CHILD |_______________
|_______| |
| |
| PARENT |
| |
|__________________|

Quixote

unread,
Jan 29, 2003, 9:32:37 PM1/29/03
to
Casey Winn wrote:
> I currently have a skinned app that is a circle due to transparencies.
> However, I want to have child HWND's that could possibly be over a
> transparent area.
>
> Essentially, I need to have a child HWND be able to draw itself even
> outside the boundaries of its parent. Does anyone know if this is
> possible?

It is not possible. That is one of the chief defining properties of a child
window. From MSDN:

"A child window has the WS_CHILD style and is confined to the client area of
its parent window."

However, you can create a region of essentially arbitrary complexity (which
may have holes in it or consist of separate parts) and then call
SetWindowRgn to make your parent window have that shape.

Thus you can create a region that is the same size as the child window,
position it where you want (using OffsetRgn), combine it with your circle
region (using CombineRgn), and then call SetWindowRgn. You then draw the
child window in its allocated space.

--

Quixote
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)


Jugoslav Dujic

unread,
Jan 30, 2003, 8:13:02 AM1/30/03
to
"Casey Winn" <clw...@ucsd.edu> wrote in message
news:cbe6854c.03012...@posting.google.com...

What's wrong with a popup window? You can't move a child window out of
parent window's client area. Period. (You can apply Quixote's suggestion,
but it looks complicated and basically it's just a workaround). You can
regulate behaviour of a popup by removing WS_CAPTION style; it is not
shown in the taskbar. You can even handle WM_WINDOWPOSCHANGING and/or
WM_GETMINMAXINFO to confine it to a certain rectangle on the screen.

--
Jugoslav
___________
www.geocities.com/jdujic


Jerry Coffin

unread,
Jan 30, 2003, 4:24:18 PM1/30/03
to
In article <cbe6854c.03012...@posting.google.com>,
clw...@ucsd.edu says...

[ ... ]

> It MUST BE a child window (no titlebar, not movable, and not shown in
> the taskbar)...

No titlebar, not movable and not shown in the task bar does NOT imply
that it must be a child window. A child cannot appear outside the
client area of its parent, but a popup can, and a popup does not
necessarily have to have a title bar -- as long as it doesn't, it won't
show up in the task bar and won't be movable.

--
Later,
Jerry.

The universe is a figment of its own imagination.

0 new messages