Page 1 of 1
OpenWindow(... with flag of $80000
Posted: Fri Jul 17, 2009 5:41 am
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?
Posted: Fri Jul 17, 2009 8:24 am
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?
Posted: Fri Jul 17, 2009 9:33 am
by srod
It is the #WS_EX_LAYERED extended style; useful for setting transparency etc.
Posted: Fri Jul 17, 2009 1:21 pm
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.
Posted: Fri Jul 17, 2009 1:36 pm
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
Posted: Fri Jul 17, 2009 11:11 pm
by Ollivier
@NetMaestro
I really agree with your 3 rules! But I'm not sure you are innocent...
Ollivier