
#PB_Window_Maximize (dont want hide taskbar) !?
#PB_Window_Maximize (dont want hide taskbar) !?
When open a window and using this flag for a windows app, it starts at maximized but it will be in front of the taskbar! Is there any way to maxmize the app at programstart but dont be in front nor behind the taskbar!? (hope you guys know what i mean!? 

va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
ok, i found a way
if someone know another way, please tell me, thx!
EDITED:
When starting this example, the window seems to be 2-3 pixel widther as it should !? (you can notice this on the CLOSE button and its white border on XP)

EDITED:
When starting this example, the window seems to be 2-3 pixel widther as it should !? (you can notice this on the CLOSE button and its white border on XP)
Code: Select all
GetWindowRect_(GetDesktopWindow_(),rect.rect)
Debug "Full-Screen"
Debug rect\left
Debug rect\top
Debug rect\right
Debug rect\bottom
SystemParametersInfo_(#SPI_GETWORKAREA,0,rect.rect,0)
Debug "Desktop-Area"
Debug rect\left
Debug rect\top
Debug rect\right
Debug rect\bottom
lWindowWidth = rect\right
lWindowHeight = rect\bottom
OpenWindow(0,0,0,lwindowWidth, lWindowHeight, #PB_Window_SystemMenu, "Maximize and dont hide Taskbar")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
quit = 1
EndSelect
Until quit
End
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
You need to account for the window caption height as well. When you use width and height in OpenWindow(), you are setting the size of the window client area.
Code: Select all
captionH = GetSystemMetrics_(#SM_CYCAPTION)
SystemParametersInfo_(#SPI_GETWORKAREA, 0, winRect.RECT, 0)
WinWidth = winRect\right - winRect\left - 10
WinHeight = winRect\bottom - winRect\top - captionH - 10
If OpenWindow(0, 0, 0, WinWidth, WinHeight, #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget | #PB_Window_Maximize | #PB_Window_SizeGadget | #PB_Window_SystemMenu, "Maximize and dont hide Taskbar") And CreateGadgetList(WindowID(0))
CreateStatusBar(0, WindowID(0))
StatusBarText(0, 0, "Can you see this statusbar and the taskbar?")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
quit = 1
EndSelect
Until quit
EndIf
End
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
I was curious about that myself and I SWEAR the first couple of time I tried, it wouldn't size to fit. Trying it once again, I see it does indeed size itself to fit. Hmmmm...need to go back and see where I went wrong the first time.
Thanks for waking me up USCode
Everyone can just ignore my code above
Thanks for waking me up USCode

Everyone can just ignore my code above

What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
OK, I see where I confused myself. My first attempts were to open the window to its maximized size without using the #PB_Window_Maximize flag. In other words the window was not actually maximized but yet sized nearly equal to it's maximized state. I then combined my various code and it was all fubar after that. :roll: Sorry for all the confusion. 
On that note, I will say good night.

On that note, I will say good night.

What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
yes, sorry for confusing i.e. ! with your codesnip the widnow is maximized and the taskbar is still visible 
when i talked about "its a bug or a feature (to hide the taskbar)", i mean the #MAXIMIZE flag from purebasic... but now i will go to bed too, good night

when i talked about "its a bug or a feature (to hide the taskbar)", i mean the #MAXIMIZE flag from purebasic... but now i will go to bed too, good night

va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
To maximize a window, it needs to have the MaximizeGadget flag. This is a Windows limitation.
Code: Select all
; Maximized
OpenWindow(0, 0, 0, 400, 300, #PB_Window_MaximizeGadget | #PB_Window_Maximize, "")
; Not maximized but covers the whole screen instead
; OpenWindow(0, 0, 0, 400, 300, #PB_Window_Maximize, "")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
When I try to run that code posted above:
I get the error "Constant not found: #PB_Window_Maximize"
PB doesn't even recognize that that flag exists. What am I doing wrong?
Code: Select all
OpenWindow(0, 0, 0, 400, 300, #PB_Window_MaximizeGadget | #PB_Window_Maximize, "")
PB doesn't even recognize that that flag exists. What am I doing wrong?
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
What version of PB are you running? Most of what gets posted these days is v4.0 beta code, I don't believe that flag exists in 3.94 or the demo version. For 3.94 you may need to maximize the window explicitly with:
or you can use the equivalent windows flag:
Code: Select all
OpenWindow(0, 0, 0, 400, 300, #PB_Window_MaximizeGadget , "")
ShowWindow_(WindowID(0),#SW_MAXIMIZE)
Code: Select all
OpenWindow(0, 0, 0, 400, 300, #PB_Window_MaximizeGadget | #WS_MAXIMIZE , "")
BERESHEIT