This is some old DBC code, but it should be valid. The main change might be the binary OR operator '||' as opposed to '|'
set window on
sync on
user32=1
load dll "user32.dll",user32
gosub _winapi_constants
rem make the window always on top
hwnd=call dll(user32,"GetActiveWindow")
x=0
y=0
xwidth=0
yheight=0
result=call dll(user32, "SetWindowPos", hwnd, HWND_TOPMOST, x, y, xwidth, yheight, SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE)
if result=0
break "the function call failed"
delete dll user32
end
endif
do
text 0,100,"I'm On Top!!!"
sync
loop
end
_winapi_constants:
SWP_FRAMECHANGED = 32
SWP_DRAWFRAME = SWP_FRAMECHANGED
SWP_HIDEWINDOW = 128
SWP_NOACTIVATE = 16
SWP_NOCOPYBITS = 256
SWP_NOMOVE = 2
SWP_NOOWNERZORDER = 512
SWP_NOREDRAW = 8
SWP_NOREPOSITION = SWP_NOOWNERZORDER
SWP_NOSIZE = 1
SWP_NOZORDER = 4
SWP_SHOWWINDOW = 64
HWND_BOTTOM = 1
HWND_BROADCAST = 65535
HWND_DESKTOP = 0
HWND_NOTOPMOST = -2
HWND_TOP = 0
HWND_TOPMOST = -1
return
Enjoy your day.