Borderless Graphicbox


'Demo to remove border from graphicbox
'in Liberty BASIC 3+, and display a bitmap
'in the graphicbox.
'
'Alyce Watson, 2002, public domain

if val(Version$)<3 then end

nomainwin

filedialog "Choose Bmp","*.bmp",bmp$
if bmp$="" then end

loadbmp "pic",bmp$

graphicbox #1.g, 10,10,100,100
open "Test" for window_nf as #1
hGbox=hwnd(#1.g)    'graphicbox handle

hStyle=GetWindowLong(hGbox,_GWL_STYLE)
hNewStyle=SetWindowLong(hGbox,_GWL_STYLE, hStyle XOR _WS_BORDER)

print #1.g, "down;drawbmp pic 0 0;flush"

unloadbmp "pic"
WAIT


Function GetWindowLong(hWin, type)
    calldll #user32,"GetWindowLongA",_
        hWin As long,_
        type As long,_
        GetWindowLong as long
    End Function

Function SetWindowLong(hWin, type, newVal)
    calldll #user32, "SetWindowLongA",_
        hWin as long,_
        type as long,_
        newVal as long,_
        SetWindowLong as long
    End Function 


Home

Source Code

Utilities

Internet

Games

Graphics

Media Demos

Snippets

DLL's

API Resources

Freeware

LB 4 Companion

Mastering LB 3

LB Workshop

Game Workshop

Links

Index