device->isWindowActive() and device->isWindowFocused()

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
tewe76
Posts: 42
Joined: Wed Jan 21, 2009 10:56 am
Location: Spain
Contact:

device->isWindowActive() and device->isWindowFocused()

Post by tewe76 »

What is the difference between device->isWindowActive() and device->isWindowFocused()? Aren't they the same thing? Probably not :roll:

Thanks :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, one is the subset of the other, but on some windowing systems it might be the same.
tewe76
Posts: 42
Joined: Wed Jan 21, 2009 10:56 am
Location: Spain
Contact:

Post by tewe76 »

Ok, they are quite similar, then. Could you think of a real case in which a window is active but has no focus (or viceversa)? Something to do with Alt+Tab, maybe? Or this is just not possible on Windows, only on Linux or Mac?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

On Windows the implementation uses GetFocus() and GetActiveWindow(). It seems to me that they are quite different if the window in question is not a top level window.

Travis
tewe76
Posts: 42
Joined: Wed Jan 21, 2009 10:56 am
Location: Spain
Contact:

Post by tewe76 »

A "NON top level window" is a window inside another window? Maybe it has something to do with things like tutorial "14.Win32Window"?
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

A top-level-window is a window like the task manager that always stays on top of other windows even if they have the focus.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
tewe76
Posts: 42
Joined: Wed Jan 21, 2009 10:56 am
Location: Spain
Contact:

Post by tewe76 »

Ah, i thought that was an "always-on-top", not a "top-level-window". Anyway, i'm afraid this discussion is going nowhere :roll: :wink:
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

In Windows, everything is a "Window" a button is a window, a text box is a window, a window is a window, etc.

GetFocus checks if the Irrlicht View"Window" is in focus, this is not the same as the window that the Irrlich Window is in having focus.

Focus = Mouse and keyboard events go to that object. (EG: Having your cursor in the subject text box as opposed to the message body text box.)
Active = The parent Window is active that that element is in.

Unless you are embedding your Irrlicht Window in another Win32 window instead of letting Irrlicht create one for you, the diffrence is virtually nothing.

~DtD
tewe76
Posts: 42
Joined: Wed Jan 21, 2009 10:56 am
Location: Spain
Contact:

Post by tewe76 »

Thank you very much, DtD, a very good explanation 8)
Post Reply