March 01, 2021, 11:15:51 PM

Author Topic: [bb] Create a maximized sized window. by Zethrax [ 1+ years ago ]  (Read 417 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
Title : Create a maximized sized window.
Author : Zethrax
Posted : 1+ years ago

Description : 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"


Code :
Code: BlitzBasic
  1. ; -- Declare Windows API constants.
  2. Const SM_CXSCREEN_ = 0
  3. Const SM_CYSCREEN_ = 1
  4. Const SM_CYCAPTION_ = 4
  5. Const SM_CYBORDER_ = 6
  6. ;^^^^^^
  7.  
  8. ; -- Declare globals.
  9. Global window_caption_bar_height = API_GetSystemMetrics( SM_CYCAPTION_ )
  10. Global window_border_height = API_GetSystemMetrics( SM_CYBORDER_ )
  11. Global desktop_screen_width = API_GetSystemMetrics( SM_CXSCREEN_ )
  12. Global desktop_screen_height = API_GetSystemMetrics( SM_CYSCREEN_ )
  13. ;^^^^^^
  14.  
  15. ; Set the graphics mode.
  16. Graphics desktop_screen_width, desktop_screen_height - ( window_caption_bar_height * 2 + window_border_height * 3 ), 0, 2
  17.  
  18. WaitKey ()
  19. End


Comments :


BlackD(Posted 1+ years ago)

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


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal