December 03, 2020, 07:37:41 PM

Author Topic: [bb] full screen by mindstorms [ 1+ years ago ]  (Read 416 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] full screen by mindstorms [ 1+ years ago ]
« on: June 29, 2017, 12:28:42 AM »
Title : full screen
Author : mindstorms
Posted : 1+ years ago

Description : You need to put the commands at the top of the code into user32 in user libs to make this work.  It uses windowed mode but takes up the whole screen, so it looks like full-screen.  Good for LED monitors.  It can work in both 3d and 2d.

Code :
Code: BlitzBasic
  1. ;needed in libs
  2. ;---------------------------------------------------------------------------------
  3. ; User32.decls
  4. ;==============
  5. ;
  6. ;.lib "user32.dll"
  7. ;
  8. ;api_FindWindow%( class$,Text$ ):"FindWindow"
  9. ;api_GetWindowLong%(hwnd%, nIndex%) : "GetWindowLong"
  10. ;api_GetSystemMetrics%(nIndex%) : "GetSystemMetrics"
  11. ;api_MoveWindow%(hwnd%, x%, y%, nWidth%, nHeight%, bRepaint%) : "MoveWindow"
  12. ;api_SetWindowLong%(hwnd%, nIndex%, dwNewLong%) : "SetWindowLong"
  13. ;api_ShowWindow%(hwnd%, nCmdShow%) : "ShowWindow"
  14. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  15.  
  16. Const SM_CXSCREEN               = 0
  17. Const SM_CYSCREEN               = 1
  18. Const WS_VISIBLE                = $10000000
  19. Const GWL_STYLE                 = -16
  20. Const title$ = "anything you want(must be set)(can't see it)"
  21.  
  22. Global width = api_GetSystemMetrics(SM_CXSCREEN)
  23. Global height = api_GetSystemMetrics(SM_CYSCREEN)
  24. Graphics width,height,0,2
  25.  
  26. AppTitle title$
  27.  
  28. blitz_hnd = api_FindWindow("Blitz Runtime Class", title$)
  29.  
  30.  
  31.  
  32. api_SetWindowLong(blitz_hnd, GWL_STYLE, WS_VISIBLE)
  33.  
  34.  
  35. api_MoveWindow(blitz_hnd, (api_GetSystemMetrics(SM_CXSCREEN) - width) / 2, (api_GetSystemMetrics(SM_CYSCREEN) - height) / 2, width, height, 1)


Comments :


Yan(Posted 1+ years ago)

 Wow...Deja vu...


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal