Code archives/Graphics/Create a maximized sized window.

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

Download source code

Create a maximized sized window. by Zethrax2004
The code below will create a window that has the same positioning and dimensions (give or take) as a maximized window. The position of the window will not be anchored in place the way normal maximized windows are, though.

You will also need to create a text file called 'user32.decls' with the two lines of code below in it and put the file in the userlibs folder in the Blitz main folder:-

--

.lib "user32.dll"
api_GetSystemMetrics% (nIndex%) : "GetSystemMetrics"
; -- Declare Windows API constants.
Const SM_CXSCREEN_ = 0
Const SM_CYSCREEN_ = 1
Const SM_CYCAPTION_ = 4
Const SM_CYBORDER_ = 6
;^^^^^^

; -- Declare globals.
Global window_caption_bar_height = API_GetSystemMetrics( SM_CYCAPTION_ )
Global window_border_height = API_GetSystemMetrics( SM_CYBORDER_ )
Global desktop_screen_width = API_GetSystemMetrics( SM_CXSCREEN_ )
Global desktop_screen_height = API_GetSystemMetrics( SM_CYSCREEN_ )
;^^^^^^

; Set the graphics mode.
Graphics desktop_screen_width, desktop_screen_height - ( window_caption_bar_height * 2 + window_border_height * 3 ), 0, 2

WaitKey ()
End

Comments

BlackD2004
Very nice. :) I was just writing this program and decided to see if anyone else already had. You saved me work. :D


Code Archives Forum