1. [Win] ...two rules.

The current definition for WS_OVERLAPPEDWINDOW in win32lib is wrong, and
should actually just be:

or_all({ WS_CAPTION,
  WS_SYSMENU,
  WS_THICKFRAME,
  WS_MINIMIZEBOX,
  WS_MAXIMIZEBOX})

So why does it work now....
... simply because it  now includes WS_BORDER *and* WS_DLGFRAME,
which...  or_all()'s  to  #C00000, which is,
you guessed it,
actually equivalent to WS_CAPTION.

Here's why it's wrong. ( my *emphasis* )

<from win32.hlp>
WS_DLGFRAME     Creates a window with a double border, a style typically used
with dialog boxes. A window with this style *cannot* have a title bar.

WS_SYSMENU      Creates a window that has a window-menu in its title bar. The
WS_CAPTION style *must* also be specified.

Which leads to a question someone might be able to answer.
The above style is #CF0000 in any case.
So why does:
printf(1,"style %x\n",
{ w32Func(xGetWindowLong,{getHandle(myMain),GWL_STYLE})})
.. always seem to return #4CF0000 ?
Is WS_CLIPSIBLINGS ( I guess ) always a parent window default ?

Wolf

new topic     » topic index » view message » categorize

2. Re: [Win] ...two rules.

Hi Wolf,

> The current definition for WS_OVERLAPPEDWINDOW in win32lib is wrong,

It has the same value as the Microsoft definition in Winuser.h

> Here's why it's wrong. ( my *emphasis* )

This does not mean it is "wrong", just a poor choice of coding style. As
WS_BORDER describes a specific look for window frames and WS_DLGFRAME
describes a different window frame look, one would normally assume that
these two styles are mutually exclusive. However, Microsoft has decided to
"reuse" these values by saying that if you *do* have both then it means
something else entirely different - namely that you want a title bar!

> Is WS_CLIPSIBLINGS ( I guess ) always a parent window default ?

Again, Microsoft in its wisdom has decided that if we create a window that
has child windows, that WS_CLIPSIBLINGS should be used. So therefore if we
don't specify it, Windows will add it in for us. I suspect that if we
actually don't want this style flag, we must explicitly remove the style
after the window has been created.

------
Derek Parnell
Melbourne, Australia
(Vote [1] The Cheshire Cat for Internet Mascot)

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu