IsScreenActive()
Posted: Tue Dec 22, 2009 4:57 am
I have a WindowedScreen which displays a Mesh nicely and then the Mesh can be rotated etc by dragging the mouse etc. So far so good. However, I want to return focus to the Parent Window (or the Window of any other desktop program) if the mouse position is outside of the WindowedScreen.
So far a test such as:
fMousePosnX = MouseX()
Just about works but the solution is not elegant because the test checks if the mouse is off screen to the right but including a test to see if it is off screen to the left delivers a false positive.
Also, if the mouse is returned to the WindowedScreen, how does one return the focus to the WindowedScreen?
I have also tried IsScreenActive():
IsScreenActive() should return zero if the screen is inactive but I only ever get a return of 1. Perhaps this function only works in Full Screen mode? If so, does anyone know how to emulate it in a WindowedScreen?
So far a test such as:
fMousePosnX = MouseX()
Code: Select all
If ( fMousePosnX > (fScreenWth -2) )
ReleaseMouse(1)
EndIfAlso, if the mouse is returned to the WindowedScreen, how does one return the focus to the WindowedScreen?
I have also tried IsScreenActive():
Code: Select all
RenderWorld()
DisplaySprite(#CursorSprite, MouseX, MouseY)
FlipBuffers()
ClearScreen(RGB(0, 0, 0))
iScreenActive = IsScreenActive()