|
Post by u9 on Jul 28, 2006 18:18:47 GMT -5
I need to be able to check whether my window has focus or not in order to stop execution when focus is lost. Try the racer game in windowed mode. I can select menu items by accident when I am doing something totally different in another program. It's a bit of a problem
|
|
|
Post by Guilect on Jul 28, 2006 18:42:06 GMT -5
ya I know, that's why its already in there. v1.2 and I quote from the change log: "added -- command system.GotFocus, returns wether or not the Brutus2D window has focus."
|
|
|
Post by u9 on Jul 28, 2006 19:00:54 GMT -5
hehe maybe it's time I update
|
|
|
Post by Guilect on Jul 29, 2006 8:39:10 GMT -5
Ok there is a bug in the built-in system.gotfocus command. It has been fixed and will be in v1.3.
in the meantime you can use this function:
Function GotFocus Dim Ret Ret = dll.CallAPI("user32", "GetActiveWindow") If Ret = system.Gethwnd then GotFocus = True Else GotFocus = False End If End Function
|
|