Main Menu

News:

SyntaxBoom, now with pwetty syntax highlighted code boxes! \o/ 

https://www.syntaxboom.com/forum/index.php?topic=96

Shoutbox

Jackdaw

Today at 20:00:40
Going to have to try bourbon and beans. That should be an explosive combination.

Baggey

Today at 13:15:42
I sometimes mix a chicken vindaloo and a Tika Masala together. Awesome  :P

Dabzy

Today at 05:49:34
And doing the act was the realisation I went for an indian when out... 20mins I was in the thunderbox waiting for me back chaff to cool down!

Dabzy

Today at 05:48:11
When I was on my "Year On The Blur", aka drinking after getting divorced, I was minging one night, couldnt remember getting home. Anyway, next day, went to work, and needed a poo...

GfK

2025-10-15, 21:39:05
I overdosed on jelly babies once and my arse was like the shooty gun bit at the start of James Bond

Amon

2025-10-15, 20:16:38
lol

Jackdaw

2025-10-15, 19:40:48
Never had a Phall or a tinderloo. But I have heard that your backside feels like that map at the start of every episode of Bonanza.

GfK

2025-10-15, 19:22:25
Never confuse phall with phallus

Baggey

2025-10-15, 18:30:58
My mate ate a phall one night. Even that was to hot for me. I bet he suffered in the morning!  :-[

Dabzy

2025-10-15, 18:02:52
I like nice and toasty bit of fire in my bait as well, I used to eat really red hot gear, but nowadays if I do... Heartburn happens! :(

Members
Stats
  • Total Posts: 1,810
  • Total Topics: 224
  • Online today: 26
  • Online ever: 232 (Oct 08, 2025, 09:18 AM)
Users Online
  • Users: 1
  • Guests: 5
  • Total: 6
  • Amon
Welcome to SyntaxBoom. Please login or sign up.

Recent

Windowed FULLSCREEN

Started by Baggey, Jun 16, 2025, 07:54 AM

Previous topic - Next topic

Baggey

Creating FULL SCREEN

I converted this to work with NG

'Full-screen borderless window (Win32)
'Rough example of creating a full-screen borderless window on Windows


' https://stackoverflow.com/questions/2382464/win32-full-screen-and-hiding-taskbar
' https://stackoverflow.com/questions/2398746/removing-window-border

' Used method in second code box of first link, plus second link for modifying border.

' Just found this method is recommended by Raymond Chen of M$, who knows his stuff:

' http://blogs.msdn.com/b/oldnewthing/archive/2005/05/05/414910.aspx

' converted to BlitzmaxNG by Baggey

SuperStrict

' Used by FindWindow; set to name of your app!

AppTitle = "MY GAME"

' Open window at full size, depth = 0 for windowed mode...

Graphics DesktopWidth (), DesktopHeight (), 0

' Win32 monitor info structure...

Type MONITORINFO

Field cbSize:Int

Field rcMonitorLeft:Int
Field rcMonitorTop:Int
Field rcMonitorRight:Int
Field rcMonitorBottom:Int

Field rcWorkLeft:Int
Field rcWorkTop:Int
Field rcWorkRight:Int
Field rcWorkBottom:Int

Field dwFlags:Int

End Type

' Win32 constants...

Const MONITOR_DEFAULTTONEAREST:Int = 2

Const GWL_STYLE:Int = -16
Const GWL_EXSTYLE:Int = -20

Const HWND_TOP:Int = 0
Const SWP_FRAMECHANGED:Int = $20

Const WS_POPUP:Int = $80000000
Const WS_VISIBLE:Int = $10000000
Const WS_CAPTION:Int = $C00000
Const WS_THICKFRAME:Int = $00040000
Const WS_MINIMIZE:Int = $20000000
Const WS_MAXIMIZE:Int = $01000000
Const WS_SYSMENU:Int = $80000

Const WS_EX_DLGMODALFRAME:Int = $00000001
Const WS_EX_CLIENTEDGE:Int = $200
Const WS_EX_STATICEDGE:Int = $20000

' Win32 function pointers...

Global FindWindow:Int (lpClassName:Byte Ptr, lpWindowName:Byte Ptr) "win32"
Global MonitorFromWindow:Int (hwnd:Int, dwFlags:Int) "win32"
Global GetMonitorInfo (hMonitor:Int, lpmi:Byte Ptr) "win32"
Global GetWindowLong:Long (hwnd:Int, nIndex:Int) "win32"
Global SetWindowLong (hwnd:Int, nIndex:Int, dwNewLong:Int) "win32"
Global SetWindowPos (hWnd:Int, hWndInsertAfter:Int, X:Int, Y:Int, cx:Int, cy:Int, uFlags:Int)

' Set up function pointers...

Local user32:Int Ptr = LoadLibraryA ("user32.dll")

If user32

FindWindow = GetProcAddress (user32, "FindWindowA")
MonitorFromWindow = GetProcAddress (user32, "MonitorFromWindow")
GetMonitorInfo = GetProcAddress (user32, "GetMonitorInfoA")
GetWindowLong = GetProcAddress (user32, "GetWindowLongA")
SetWindowLong = GetProcAddress (user32, "SetWindowLongA")
SetWindowPos = GetProcAddress (user32, "SetWindowPos")

If Not (FindWindow And MonitorFromWindow And GetMonitorInfo And GetWindowLong And SetWindowLong And SetWindowPos)
Print "Missing function!"
End
EndIf

EndIf

' AppTitle allocated as C-string...

Local cbytes:Byte Ptr = AppTitle.ToCString ()

' Find app window...

Local appwindow:Int = FindWindow (Null, cbytes)

' Free C-string memory...

MemFree cbytes

' Find which monitor the app window is on...

Local monitor:Int = MonitorFromWindow (appwindow, MONITOR_DEFAULTTONEAREST)

' Monitor info...

Local mi:MONITORINFO = New MONITORINFO
mi.cbSize = SizeOf (MONITORINFO)

GetMonitorInfo monitor, mi

' Read window style/extended style...

Local style:Int = GetWindowLong (appwindow, GWL_STYLE)
Local exstyle:Int = GetWindowLong (appwindow, GWL_EXSTYLE)

' Prepare to remove unwanted styles...

style = style And Not (WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU)
exstyle = exstyle And Not (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE)

' Remove unwanted styles...

SetWindowLong (appwindow, GWL_STYLE, style | WS_POPUP | WS_VISIBLE | SWP_FRAMECHANGED)
SetWindowLong (appwindow, GWL_EXSTYLE, exstyle)

' Update window...

SetWindowPos appwindow, HWND_TOP, mi.rcMonitorLeft, mi.rcMonitorTop, mi.rcMonitorRight - mi.rcMonitorLeft, mi.rcMonitorBottom - mi.rcMonitorTop, 0

Repeat

Cls

DrawRect MouseX (), MouseY (), 32, 32
Flip

Until KeyHit (KEY_ESCAPE)

End
Running a Pc that just aint. Faster nough. I7-4Ghz, 32Gb Ram, 4Gb Nvidia, 2 x 1Tb SSD's, 2 x 24" LCD's

RETRO everything!

Jesus was only famous because of his Dad

wadmixfm

worked a treat for me :)

the only thing is if you need a screenshot of your app it does not capture it correctly it captures 2 screens and they are both black

lee
yep its definitely me

Baggey

Quote from: wadmixfm on Oct 05, 2025, 02:14 PMworked a treat for me :)

the only thing is if you need a screenshot of your app it does not capture it correctly it captures 2 screens and they are both black

lee


Hmm, I run two screens as a default  :-X
Running a Pc that just aint. Faster nough. I7-4Ghz, 32Gb Ram, 4Gb Nvidia, 2 x 1Tb SSD's, 2 x 24" LCD's

RETRO everything!

Jesus was only famous because of his Dad

wadmixfm

i use just a laptop for programming i tried to do some screenshots for you running breakthru but just gives me a black screen

yep its definitely me

Baggey

Ahh, Ive had this problem also. If your in fullscreen mode Screen capture dosent seem to work!?  ???

Ive tried to show my Emulators in Full Screen but cant do it from BlitzmaxNG.

Anyone else got some ideas why  :-X

Baggey
Running a Pc that just aint. Faster nough. I7-4Ghz, 32Gb Ram, 4Gb Nvidia, 2 x 1Tb SSD's, 2 x 24" LCD's

RETRO everything!

Jesus was only famous because of his Dad

wadmixfm

following up on this baggey , if you press windows key and print screen twice it does get the screenshot

lee
yep its definitely me

Baggey

Quote from: wadmixfm on Oct 11, 2025, 11:57 AMfollowing up on this baggey , if you press windows key and print screen twice it does get the screenshot

lee


 :o  :o  :o Ill be trying that.  ;)
Running a Pc that just aint. Faster nough. I7-4Ghz, 32Gb Ram, 4Gb Nvidia, 2 x 1Tb SSD's, 2 x 24" LCD's

RETRO everything!

Jesus was only famous because of his Dad