Code archives/Graphics/Real Maximize of B3D Window

This code has been declared by its author to be Public Domain code.

Download source code

Real Maximize of B3D Window by KuRiX2005
This code maximizes the b3d window in the same way Windows does it. Once Maximized the window cannot be moved, it fills all the screen except the start bar.

Enjoy!

P.D: You will need the user32.decls on your userlibs dir.
hwnd=Api_GetActiveWindow()
iStyle=Api_GetWindowLong(hwnd, GWL_STYLE)
Api_SetWindowLong(hwnd, GWL_STYLE, iStyle Or $10000)
Api_ShowWindow(hwnd,3)

Comments

jfk EO-111102006
Thanks, that's better than those older solutions!

BTW here's a version that works right out of the box, for the Api-phobics like me :)

; userlib entries in user32.decls : (must contain at least:)

; .lib "user32.dll"
; GetSystemMetrics% (nIndex%) : "GetSystemMetrics"
; ShowWindow(hwnd%,nCmdShow%)
; GetWindowLong%(hwnd%,gwl%):"GetWindowLongA"
; SetWindowLong%(hwnd%,gwl%,val%):"SetWindowLongA"



Const GWL_STYLE=-16

DeskWidth  = GetSystemMetrics%(0) 
DeskHeight = GetSystemMetrics%(1) 

Graphics DeskWidth, DeskHeight,32,2
SetBuffer BackBuffer()

hwnd=SystemProperty$("AppHWND")
iStyle=GetWindowLong(hwnd,GWL_STYLE)
SetWindowLong(hwnd,GWL_STYLE,iStyle Or $10000)
ShowWindow(hwnd,3)

While KeyDown(1)=0
 Delay 1
Wend



Code Archives Forum