Api SetWindowPos and style

BlitzPlus Forums/BlitzPlus Programming/Api SetWindowPos and style

Always on top (mixed in with other code) (note that this is code for B3D and may need some messing around with):
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

Const HWND_TOPMOST = -1

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, HWND_TOPMOST, 50,50, 320, 480 ,SWP_SHOWWINDOW)

;CurrentWindowStyle = api_GetWindowLong(hwndHandle, GWL_STYLE)

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

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

WaitKey()

End