December 04, 2020, 01:43:16 PM

Author Topic: windows mode like fullscreen without tittlebar  (Read 1519 times)

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 283
  • Blitz3d
    • Indiesoft
windows mode like fullscreen without tittlebar
« on: August 09, 2019, 05:36:29 PM »
Hi, I read that you can simulate fullscreen using the window mode. hiding the title bar.

It is not clear to me which of the dll you have to use, or where to get it. Many of the links in the posts are no longer useful.

Do you have to share a link with the info to achieve that modality?

regards

Offline Dabz

  • Sr. Member
  • ****
  • Posts: 273
  • Is it cos I is ginger?
    • dabzy.co.uk
Re: windows mode like fullscreen without tittlebar
« Reply #1 on: August 09, 2019, 07:39:47 PM »
From memory, something like this in B+:-

Code: [Select]
local desktopWidth = gadgetwidth(desktop()), desktopHeight = gadgetheight(desktop())

window=createwindow("Will not be seen",0,0,desktopWidth, desktopHeight,0,0)
canvas=createcanvas(0,0,desktopWidth,desktopHeight,window)
setbuffer canvasbuffer(canvas)
text 0,0,"I love cabbages"
flipcanvas canvas
waitkey

Though I cannot remember if waitkey works with GUI, so it might flash black, then return to the desktop, throw an error or just simply hang... Dunno!

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Offline 3DzForMe

  • Hero Member
  • *****
  • Posts: 1136
Re: windows mode like fullscreen without tittlebar
« Reply #2 on: August 09, 2019, 08:02:37 PM »
From memory - you sir, are a legend ;)

Offline Dabz

  • Sr. Member
  • ****
  • Posts: 273
  • Is it cos I is ginger?
    • dabzy.co.uk
Re: windows mode like fullscreen without tittlebar
« Reply #3 on: August 10, 2019, 04:14:10 AM »
lol, not really, after over a decade and a half using Blitz, you sorta get stuff stuck in there! :D

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 283
  • Blitz3d
    • Indiesoft
Re: windows mode like fullscreen without tittlebar
« Reply #4 on: August 12, 2019, 03:26:32 PM »
 :o Hi, thanks for the reply, but I couldn't understand how to make the code work, should I have a .dll or something like that?

regards!!!

Offline Dabz

  • Sr. Member
  • ****
  • Posts: 273
  • Is it cos I is ginger?
    • dabzy.co.uk
Re: windows mode like fullscreen without tittlebar
« Reply #5 on: August 12, 2019, 03:34:54 PM »
Well, I'm not sure what you are using, that above is for BlitzPlus:-

https://blitzresearch.itch.io/blitzplus

and work straight away.

Though, you should be able to jiggle it for BlitzMax+MaxGUI too, which, again, would work straight away.

If your using Blitz3D, then yes, you will need to use some WinAPI32 functions wrapped up in a DLL, then glue it to B3D with a decls file.

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Offline Dabz

  • Sr. Member
  • ****
  • Posts: 273
  • Is it cos I is ginger?
    • dabzy.co.uk
Re: windows mode like fullscreen without tittlebar
« Reply #6 on: August 12, 2019, 03:51:36 PM »
Just to help you on your way... If your writing a userlib (DLL) to use in B3D for this, you will need to pass your B3D app window handle (hWnd) to a function in your DLL, to get it, use B3D's SystemProperty() command.

Then in your DLL, use the WinAPI32 function SetWindowLongA:-

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowlonga

e.g. SetWindowLong(hWnd, GWL_STYLE, 0)

The hWnd is the handle B3D passed through, the '0' is basically saying you want no styles (e.g. no title bar, no status bar etc etc)

If you dont know how to write a userlib, check the B3D's userlib folder in its root dir (Source code+decls file), theres an example in there on how to do it, remember though, you will have to compile the DLL yourself.

Dabz

Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 283
  • Blitz3d
    • Indiesoft
Re: windows mode like fullscreen without tittlebar
« Reply #7 on: August 20, 2019, 06:00:44 PM »
Hi, thanks Dabz!!

i'm very slow to understand abouts api, dll... but i trying, thanks for the help, and when i make a few step with this info i going to post my results.

thanks!

Offline Dabz

  • Sr. Member
  • ****
  • Posts: 273
  • Is it cos I is ginger?
    • dabzy.co.uk
Re: windows mode like fullscreen without tittlebar
« Reply #8 on: August 20, 2019, 10:05:06 PM »
No worries! ;)

Its actually worth delving into WinAPI for a play around, so try and get the userlib example working yourself, then play from there, you'll learn heaps! :)

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Offline Dan

  • Jr. Member
  • **
  • Posts: 36
Re: windows mode like fullscreen without tittlebar
« Reply #9 on: August 21, 2019, 09:51:28 PM »
This code i'm using for my projects (bb3d).

Basically you need few text files, saved in the user libs folder.

here is a description of how to add the needed decls. (2nd comment)

Code: [Select]
Function Screen(x,y,full=0)
;full <0 = Fulldesktop, borderless window
;full =0 = Fulldesktop
;full =1 = original x,y
;full >1-5 = x*full,y*full size
;full >5 = 0
DeskX=api_GetSystemMetrics(0)
DeskY=api_GetSystemMetrics(1)
If x>DeskX Then x=DeskX
    If x<64 Then x=64
If y>DeskY Then y=DeskY
    If y<64 Then y=64
    bits=api_GetDeviceCaps(api_GetDC( api_GetDesktopWindow()),12)
Graphics x,y,bits,6
Graphics x,y,bits,7
If full<=0 Or full>5
If full<0 Then api_SetWindowLong(api_GetActiveWindow(), -16, $10000000)
api_MoveWindow(api_GetActiveWindow(),0,0,DeskX,DeskY,True)
    EndIf
If full>1 And full<=5 Then api_MoveWindow(api_GetActiveWindow(),0,0,x*full,y*full,True)
End Function
65536 GOTO Back2Basic

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal