GLBasic forum

Codesnippets => Inline / 3rd party => Topic started by: Schranz0r on 2008-May-12

Title: Unborder the GLB-Window
Post by: Schranz0r on 2008-May-12
Code by Gernot Frisch: :good:

For Win32:

Code (glbasic) Select


Unborder(64,64)

FUNCTION foo:
ENDFUNCTION

INLINE
}
extern "C" int __stdcall GetWindowLongA(void*, int);
extern "C" int __stdcall SetWindowLongA(void*, int, int);
extern "C" int __stdcall SetWindowPos(void*, int, int, int, int, int, int);
#define GWL_STYLE (-16)
#define WS_POPUP            0x80000000L
#define WS_CAPTION          0x00C00000L     /* WS_BORDER | WS_DLGFRAME  */
namespace __GLBASIC__ {
ENDINLINE

FUNCTION Unborder: x,y
LOCAL sx,sy
GETSCREENSIZE sx,sy

INLINE
int style = ::GetWindowLongA(GLBASIC_HWND(), GWL_STYLE);
style &= ~WS_CAPTION;
style |= WS_POPUP;
::SetWindowLongA(GLBASIC_HWND(), GWL_STYLE,  style);
::SetWindowPos(GLBASIC_HWND(), -1, x,y,sx,sy,0);
ENDINLINE
ENDFUNCTION
Title: Re: Unboard the GLB-Window
Post by: D2O on 2008-May-12
Cool  :nw:

Wenn man nun das Fenster selber etwas Transparent machen könnte oder ne bestimmte farbe.
Könnte man coole efekte bzw. Fenster machen.

Z.b ein Spiel laufen lasen und im hintergrund sieht man den Desktop oder ein gefaktes rundes fenster :)

Wir müssten eine separate Code ecke haben wo nur Inline sachen reinkommen.
Title: Re: Unboard the GLB-Window
Post by: Schranz0r on 2008-May-12
Jo finde ich auch :)
Title: Re: Unborder the GLB-Window
Post by: Schranz0r on 2008-May-16
Auch ne gute Idee, werden wir mal besprechen müssen!
Title: Re: Unborder the GLB-Window
Post by: Heiko on 2013-Jun-09
vielleicht noch eine Anmerkung zu unborder...

Code (glbasic) Select
GLOBAL sx, sy, w, h
GETSCREENSIZE sx, sy
GETDESKTOPSIZE w, h
Unborder(w/2-sx/2,h/2-sy/2)


da das Fenster standardmässig mittig gesetzt wird.
sonst taucht es wie im obigen code erst bei position 64,64 (oder whatever) auf und beim beenden nochmal mittig...

leider erscheint beim beenden nochmal kurz der rahmen, aber das ist ja nicht weiter tragisch.
Title: Re: Unborder the GLB-Window
Post by: mentalthink on 2014-Jan-02
Works in win7 X64 too... thanks!!!!  :good:
Title: Re: Unborder the GLB-Window
Post by: Hemlos on 2015-Aug-07
i broke it

if i do this in 2d then later switch to 3d like going into a game....half of the screen gets black
display driver crashed, im using amd

solved the driver crash:
you cant change the input value of unborder...it must remain constant with each frame.