1. WIN32LIB : window style

Hi !

I've noticed a little bug (I think) about opening a window with a 
specific style :
let's define 
create(Window,"test",0,Default,Default,300,320,{WS_DLGFRAME,WS_SYSMENU}) 
   

if later I open it with a 'modal' style, the borders of the window 
disappear, and this isn't the case when I open it with a 'normal' style.

is this a bug ?

Gwen

new topic     » topic index » view message » categorize

2. Re: WIN32LIB : window style

Hi Gwen,

> I've noticed a little bug (I think) about opening a window with a
> specific style :
> let's define
> create(Window,"test",0,Default,Default,300,320,{WS_DLGFRAME,WS_SYSMENU})
>
>
> if later I open it with a 'modal' style, the borders of the window
> disappear, and this isn't the case when I open it with a 'normal' style.
>
> is this a bug ?
>
Sort of, but in Windows not win32lib.

It turns out that WS_DLGFRAME and WS_SYSMENU are mutual exclusive styles
because WS_DLGFRAME is not allowed to have a title bar but WS_SYSMENU needs
a title bar. So Windows alters the WS_DLGFRAME flag to WS_CAPTION when the
window is created. Now, when Win32lib opens a Modal window it makes sure
that the window does NOT have a minimize box. It does this by removing the
WS_MINIMIZEBOX style after the window is created. It your case, there is no
minimize box so the code sets the styles to exactly what they already are!
But that's where Windows seems to get it wrong. This time it takes note of
the WS_DLGFRAME and allows it to have a titlebar and in the process removes
the border that WS_CAPTION implies.

Unfortunately this doesn't explain everything 'cos when I tried to emulate
Windows behaviur I get other weird things happening.

Anyhow, I've "fixed" the next version so that now removeStyle() won't set
the new styles if they are identical to the current style. This now means
that opening Modal and opening Normal keeps the same frame effect.


------
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

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

3. Re: WIN32LIB : window style

Try this...

------------------------
include win32lib_full.ew
without warning

constant mainwin = createEx(Window,"test",0,0,0,300,320,
{WS_DLGFRAME},{WS_EX_STATICEDGE}),
         btnClose = create(Button, "&Close", mainwin, {w32AltEdge,-40}, 0,
40, 20, 0)

procedure toClose()
    closeWindow(mainwin)
end procedure
onClick[btnClose] = routine_id("toClose")

WinMain(mainwin, Modal)


Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

----- Original Message -----
From: "Gwen" <mb11363 at chello.be>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, March 28, 2001 2:58 AM
Subject: RE: WIN32LIB : window style


>
>
> as I understood, playing with the styles of a window give sometimes a
> strange result, can you say me how to create a no-resizeable,
> no-minizeable window wich can not lose focus ?
>
> Gwen
>
> btw, thanks for you help Derek, I appreciate it
>
>
>
>

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

4. Re: WIN32LIB : window style

Derek,

That one can lose focus... Is it possible to prevent losing focus?

-ck

> Try this...
> 
> ------------------------
<some snippage happened>
> WinMain(mainwin, Modal)
> > as I understood, playing with the styles of a window give sometimes a
> > strange result, can you say me how to create a no-resizeable,
> > no-minizeable window wich can not lose focus ?

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

Search



Quick Links

User menu

Not signed in.

Misc Menu