OpenWindow(... with flag of $80000

Just starting out? Need help? Post your questions and find answers here.
BillNee
User
User
Posts: 93
Joined: Thu Jan 29, 2004 6:01 am
Location: Homosassa, FL

OpenWindow(... with flag of $80000

Post by BillNee »

Hi - what is OpenWindow using only a flag of $80000 doing? I see that the $80000 is part of the SystemMenu value of $C80000, which adds the TitleBar. Also $80000,$80001 and $80002 all work just as well. Guess this is because a full screen is centered.
It seems that with this flag I can open a window 1280x1024 and get that size including the borders. If I open a window with the same dimensions using SystemMenu the right and bottom border get cut off. This will eliminate my using MoveWindow_(.
Is this a valid PB constant? Does it have a name? Will it probably always work?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

>> Is this a valid PB constant?
for sure not, because PB-Constants are Cross-Platform. ;)

... perhaps you'll find something about the function of bit16 on the MSDN?
oh... and have a nice day.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

It is the #WS_EX_LAYERED extended style; useful for setting transparency etc.
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Couple of points:

1. Sticking a value of $80000 in the OpenWindow command doesn't give you a window with the style set to $80000 as there are already style bits set. You actually get a style of $14C80000.

2. Using unsupported values instead of PB constants here is bad practice on several levels and you should resist the temptation to code this way. I'm guilty of doing it myself in the past but freak showed me the light and now I'm innocent of this coding misdemeanor.

3. While $80000 is indeed the value of #WS_EX_LAYERED, this extended style cannot be applied in this way. SetWindowLongPtr_() is necessary.
BERESHEIT
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

funny thing:

you can use#PB_Any to set every StyleBit #True, the styles seem to contradict heavily.
there will be no window in the Tasks, only the Process, no GadgetList but the EventQueue...

Code: Select all

OpenWindow( 0, 0,0, 800,600, "test" , #PB_Any )

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
oh... and have a nice day.
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

@NetMaestro

I really agree with your 3 rules! But I'm not sure you are innocent...

Ollivier
Post Reply