OpenWindow & Maximized state.

Just starting out? Need help? Post your questions and find answers here.
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

OpenWindow & Maximized state.

Post by Thunder93 »

I'm noticing something strange with OpenWindow() with PureBasic 5.44LTS, not sure if it's specific to this release or not.

When I use the flag #PB_Window_Maximize to have it open in Maximized state, it'll cover / Hide Windows Taskbar. I have to specify #PB_Window_MaximizeGadget flag to have it work properly, to have the window maximized and yet still have Windows Taskbar showing.

Is the #PB_Window_MaximizeGadget flag suppose to be an requirement to have PB coded apps to have proper maximized state without the Windows Taskbar being covered up, hidden behind?

If this isn't by design, could this topic be moved to Bugs - Windows forum? Thank you.

If this is by design, could the PB document mention these two Full screen states and the requirement of #PB_Window_MinimizeGadget flag to have a normal maximum state? Thanks :shock:

Code: Select all

; If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_Maximize|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget) ; Maximized, Taskbar present.
If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_Maximize|#PB_Window_MinimizeGadget)   ; Covers / Hides Windows Taskbar
    
  Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_CloseWindow 
      Quit = 1
    EndIf

  Until Quit = 1
  
EndIf

End
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8422
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: OpenWindow & Maximized state.

Post by netmaestro »

Looks like a bug to me as a maximized window should only cover the workarea. If it's actually the expected behavior then the flag should be changed to something like #PB_Window_FullScreen, but I'm guessing it's not.
BERESHEIT
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: OpenWindow & Maximized state.

Post by Thunder93 »

Thanks netmaestro. I'm glad someone else is in agreement with my assessment on this matter. :mrgreen:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: OpenWindow & Maximized state.

Post by chi »

That's not a PB bug... Just the normal Windows behavior. You need to add #PB_Window_SizeGadget to your code and it'll work. Only sizeable windows won't cover the taskbar if maximized!
Et cetera is my worst enemy
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: OpenWindow & Maximized state.

Post by Thunder93 »

Your assessment of this to not being a bug, I don't agree with.

It isn't normal. If I'm specifying #PB_Window_Maximize flag, It should be opening up to normal maximized state like everything else. What's #PB_Window_SizeGadget flag have anything to-do with the other thing? No, I don't want that Window support, I don't want sizing.

If anything, if #PB_Window_Maximize flag requires #PB_Window_MaximizeGadget flag to be present, it should be combined already with #PB_Window_Maximize.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: OpenWindow & Maximized state.

Post by Dude »

chi wrote:That's not a PB bug... Just the normal Windows behavior.
I disagree (sorry) because even without the SizeGadget flag, the maximized window is still BEHIND the taskbar, instead of resting ON it like any maximized window should. Windows 7 here.
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: OpenWindow & Maximized state.

Post by coder14 »

Without #PB_Window_MaximizeGadget I get the full screen covering the taskbar too.

Windows 8.1 - PB 5.60 beta 4 64bit.
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: OpenWindow & Maximized state.

Post by Bisonte »

You are using the constant #PB_Window_Maximize not the right way.

It's not to define the window, it's the window state ! This is the right using :

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget)   ; Covers / Hides Windows Taskbar
  SetWindowState(0, #PB_Window_Maximize)
  
  Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_CloseWindow
      Quit = 1
    EndIf

  Until Quit = 1
 
EndIf

End
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: OpenWindow & Maximized state.

Post by Thunder93 »

Bisonte, you seem to be missing the point. #PB_Window_Maximize is an optional OpenWindow flag, ... just like #PB_Window_MaximizeGadget to have the Maximized gadget to the Window title bar.

Where in the help file do you see PB flag #PB_Window_Maximize needing to be set that in such a way? Where does it show that #PB_Window_Maximize flag needs to be combined with #PB_Window_MaximizeGadget in order to sit above the Taskbar area and have maximized state like how all the other software I have installed works?
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4622
Joined: Sun Apr 12, 2009 6:27 am

Re: OpenWindow & Maximized state.

Post by RASHAD »

For Windows
You should use #WS_OVERLAPPEDWINDOW
It is not a bug but lack of using the right flag
It is been always like that with previous versions

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_SystemMenu |#WS_OVERLAPPEDWINDOW)   
  SetWindowState(0, #PB_Window_Maximize)
 
  Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_CloseWindow
      Quit = 1
    EndIf

  Until Quit = 1
 
EndIf

End
Egypt my love
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: OpenWindow & Maximized state.

Post by Thunder93 »

What's the point of #PB_Window_Maximize native flag, to have open the windows maximized.

.... I shouldn't have to supply #PB_Window_Maximize|#WS_OVERLAPPEDWINDOW
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4622
Joined: Sun Apr 12, 2009 6:27 am

Re: OpenWindow & Maximized state.

Post by RASHAD »

Next is a Window using API with #SW_MAXIMIZE and without #WS_OVERLAPPEDWINDOW
#SW_MAXIMIZE = #PB_Window_Maximize

Code: Select all

Appname$ = "Window Test"

Procedure winCB(Wnd,uMsg,wParam,lParam) 
  Result = DefWindowProc_(Wnd, uMsg, wParam, lParam) 
  Select uMsg 
     Case #WM_CLOSE     
      UnregisterClass_(Appname$,hInstance) 
      PostQuitMessage_(0) 
  EndSelect 
  ProcedureReturn Result
EndProcedure 

w.WNDCLASS 
w\style          =  #CS_VREDRAW | #CS_HREDRAW 
w\lpfnWndProc    =  @winCB() 
w\cbClsExtra     =  0 
w\cbWndExtra     =  0 
w\hInstance      =  hInstance 
w\hIcon          =  LoadIcon_(hInstance, "#1") 
w\hCursor        =  LoadCursor_(0, #IDC_ARROW) 
w\hbrBackground  =  CreateSolidBrush_(GetSysColor_(15)) 
w\lpszMenuName   =  0 
w\lpszClassName  =  @Appname$ 
RegisterClass_(w) 
hWnd = CreateWindowEx_(0,Appname$,Caption$,#WS_CAPTION| #WS_POPUPWINDOW,#CW_USEDEFAULT,0,#CW_USEDEFAULT,0,0,0, hInstance,0)

ShowWindow_(hWnd,#SW_MAXIMIZE)

While GetMessage_(m.MSG, 0, 0, 0) 
  TranslateMessage_(m) 
  DispatchMessage_(m) 
Wend
Egypt my love
Post Reply