How Can you Tell if Mouse is outside Window?
Blitz3D Forums/Blitz3D Programming/How Can you Tell if Mouse is outside Window?| 
 | ||
| I did a search on the site since I thought this was an obvious thing, but couldn't find any reference to it. In Blitz3D windowed mode, is there a way of telling if the mouse is pointing somewhere outside the window? MouseX/Y just shows the last available position from inside the window, and I'd like to blend out the game's mousepointer if the user is outside the window. Is this possible? | 
| 
 | ||
| you'll probably need to use some winapi commands to check that. | 
| 
 | ||
| Yep. | 
| 
 | ||
| when you say leaving the blitz3d window, you mean while still active? if so! heres one possable method. you would need to create a .decls .lib "user32.dll" GetCursorPos%(lppoint*):"GetCursorPos" WindowFromPoint%(lppoint*):"WindowFromPoint" now get the blitz3d hwnd pointer using SystemProperty("AppHwnd") and check against the hwnd pointer returned from the api call WindowFromPoint() 
bank = createbank(8)
GetCursorPos(bank)
hwnd_under_pointer = WindowFromPoint(bank)
blitz3d_hwnd = SystemProperty("AppHwnd")
this is untested but should work. kev | 
| 
 | ||
| When my cat is really interested at something outside, there might be a mouse outside the window... ba-dump-bump! | 
| 
 | ||
| if the mousex() and mousey() is > gaphicswidth() and graphicsheight() then it is gone | 
| 
 | ||
| @blitz monkey: That doesn't work. When the mouse leaves the window, MouseX() and MouseY() stop updating. | 
| 
 | ||
| ya ya i just tested it opps... i feel stupid |