That's a pretty whacky app Beaker, reminds me of stuff I used to do on the Amiga to get an infinite mirror effect.
Unfortunately it won't work for me in my game which is setup like this (code extract, that I have made run)
;windows constants
Const GWL_STYLE = -16
Const WS_MINIMIZE = $00020000
Const WS_SYSMENU = $00080000
Const SWP_NOSIZE = $0001
Const SWP_NOMOVE = $0002
Const SWP_FRAMECHANGED = $0020
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3
Const FULLNAME$ = "TEST"
AppTitle FULLNAME ;do before graphics is called
IniWindowedMode = 1
Local flag = 0
If IniWindowedMode Then
flag = 2
GAME_WIDTH = 768
GAME_HEIGHT = 540
Else
GAME_WIDTH = 800
GAME_HEIGHT = 600
EndIf
;set commoncode vars
ScreenWidth = GAME_WIDTH
ScreenHeight = GAME_HEIGHT
If Ini16BitGraphics Then
Graphics GAME_WIDTH, GAME_HEIGHT, 16, flag
Else
Graphics GAME_WIDTH, GAME_HEIGHT, 32, flag
EndIf
If IniWindowedMode Then
; add minimize button
TheWindow = User32_FindWindowA("",FULLNAME)
Wlong = User32_GetWindowLong(TheWindow, GWL_STYLE)
Wlong = Wlong Or WS_MINIMIZE Or WS_SYSMENU
User32_SetWindowLong(TheWindow, GWL_STYLE, Wlong)
User32_ShowWindow(TheWindow,0) : User32_ShowWindow(TheWindow,1)
Else
TheWindow = User32_FindWindowA("",FULLNAME)
AutoSuspend False ;needed in full screen mode to detect minimize to pause music
EndIf
;always set the icon, as in full-screen mode they might alt+tab
icon=Shell32_ExtractIconA(TheWindow,"fruitola.ico",0)
User32_SetClassLongA(TheWindow,-14,icon)
While KeyDown(1) = 0 ;press escape to quit
Cls
dmx = MouseX()
dmy = MouseY()
Text 0,0,dmx+ " " + dmy
Text 0,20,"press <Escape> to exit>
Flip
Wend
you also need this user32.decls
.lib "user32.dll"
User32_SetWindowLong% (hwnd%, nIndex%, dwNewLong%) : "SetWindowLongA"
User32_GetWindowLong%(hwnd%, nIndex%): "GetWindowLongA"
User32_GetActiveWindow%(): "GetActiveWindow"
User32_FindWindowA%(NullString,WindowText$):"FindWindowA"
User32_SetWindowPos%(hWnd%,hAfter%,x%,y%,cx%,cy%,flags%):"SetWindowPos"
User32_keybd_event%(bVk%, bScan%, dwFlags%, dwExtraInfo%) : "keybd_event"
User32_updatewindow%(hwnd%): "UpdateWindow"
User32_ShowWindow% (hwnd%, nCmdShow%): "ShowWindow"
User32_SetClassLongA%(hWnd%,nIndex%,Value%):"SetClassLongA"
User32_GetWindowPlacement%(hwnd%, pwpl*):"GetWindowPlacement"
User32_GetWindowRect%(hwnd%, prect*):"GetWindowRect"
Basically I'm not using the Blitz gadgets because my windowed mode actually uses the Graphics command and various windows API calls to set it up. So mouseX and MouseY return the coords inside the window only. I can't get the coords relative to the desktop and I really want them! Any ideas?
thanks