Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Please help: "Active Window" vs. "Foreground Window" vs. "Window with Focus" vs "Selected Window"

2,946 views
Skip to first unread message

Bob Sather

unread,
Jul 31, 2000, 3:00:00 AM7/31/00
to
I'm relatively new to MFC. There seem to be some concepts in the
Microsoft documentation that are not fully explained: "Active Window"
vs. "Foreground Window" vs. "Window with Focus" vs "Selected Window" vs
"Topmost Window". Clearly these are not the same thing, but they are
related. And there are related Wnd:: members, such as
"GetActiveWindow", "GetForegroundWindow", "GetFocus", etc.

Can someone please explain to me the fine distinctions among these
concepts and calls?

Bob Sather
Bracknell, UK


Johan Rosengren

unread,
Jul 31, 2000, 3:00:00 AM7/31/00
to

Bob!

Most of the words are defined in the glossary in the online help:

active window
The window that appears in the foreground with a highlighted title bar or
border to distinguish it from other visible windows.

foreground window
The window with which the user is currently working. The system assigns a
slightly higher priority to the thread used to create the foreground window
than it does to other threads.

focus window
The window that is currently receiving keyboard input. The focus window is
always the active window, a descendent of the active window, or NULL.

top-level window
A window that has no parent window.

'the selected window' is in my experience used for either the foreground
window or the window with focus.

Then, again from the online help (but now the API specs):

SetActiveWindow
This function makes the specified top-level window associated with the
thread calling this function the active window.

...and here you should read the remarks for the difference between this call
and SetForegroundWindow.

SetFocus is a bit different - as you saw above, this is the window that gets
the keyboard input. This is almost always a child of the active window (a
button, editbox etc.) as opposed to the active window itself.

Johan Rosengren
Responsable Informatique
PACTA S.A.

Bob Sather <b...@sather.removethisstring.org> a écrit dans le message :
39856faf...@news.currantbun.com...

0 new messages