Removing window borders/title bar

Blitz3D Forums/Blitz3D Programming/Removing window borders/title bar

Any ideas how to do this from B3D?

Tracer

nm, figured it out. Question of hacking the exe.

Tracer

Or you could do it with userlibs.

Everything you need is in there

http://www.blitzbasic.com/codearcs/codearcs.php?code=829

Yeah, that makes the window 640,480 with no way to change it without screwing up.. tried it.

Tracer

You could try modifying this:

AppTitle "testStyle"
Graphics3D 800,600,0,2

SetBuffer BackBuffer()


Type tRect
    Field iLeft
    Field iTop
    Field iRight
    Field iBottom
End Type

Const  GWL_WNDPROC = -4
Const  GWL_HINSTANCE = -6
Const  GWL_HWNDPARENT = -8
Const  GWL_STYLE = -16
Const  GWL_EXSTYLE = -20
Const  GWL_USERDATA = -21
Const  GWL_ID = -12

Const SM_CXSCREEN = 0
Const SM_CYSCREEN = 1

Const SWP_SHOWWINDOW = $40

Const WS_OVERLAPPED = 0
Const WS_POPUP = $80000000
Const WS_CHILD = $40000000
Const WS_MINIMIZE = $20000000
Const WS_VISIBLE = $10000000
Const WS_DISABLED = $8000000
Const WS_CLIPSIBLINGS = $4000000
Const WS_CLIPCHILDREN = $2000000
Const WS_MAXIMIZE = $1000000

Const WS_CAPTION = $C00000
Const WS_BORDER = $800000
Const WS_THICKFRAME = $40000

Global hwndHandle%
Global hMenuHandle%
Global CurrentWindowStyle%
Global sw = api_GetSystemMetrics(SM_CXSCREEN)
Global sh = api_GetSystemMetrics(SM_CYSCREEN)
Global rct.tRect = New tRect
rct\iLeft = 0
rct\iTop = 0
rct\iRight = sw
rct\iBottom = sh

hwndHandle= api_FindWindow("Blitz Runtime Class", "testStyle")

CurrentWindowStyle = api_GetWindowLong(hwndHandle, GWL_STYLE)

CurrentWindowStyle% = CurrentWindowStyle% - WS_VISIBLE
api_SetWindowLong(hwndHandle, GWL_STYLE, CurrentWindowStyle )
api_InvalidateRect(0,rct,True);
 
 
For t = 1 To 10000
Print "test"
Next

api_SetWindowPos(hwndhandle, 0, 50,50, 320, 480 ,SWP_SHOWWINDOW)

CurrentWindowStyle = api_GetWindowLong(hwndHandle, GWL_STYLE)

api_SetWindowLong(hwndHandle, GWL_STYLE, CurrentWindowStyle - WS_THICKFRAME  - WS_BORDER)

api_InvalidateRect(hwndHandle,rct,True)
Print "done... press a key to exit"

WaitKey()

End


I ended up writing a 4kb DLL to do the job :)

Tracer

I didn't say it would do it for you. I managed to get it to work fine in ExGen. If you run ExGen you will see a small splash window at the start that has no border or title bar or anything. That's the blitz runtime window.

Of course now you have a dll it doesn't really matter but it does work... honest