Show a caption of a second window as active when the main window gets active and vice versa

75 Views Asked by At

I have a Windows program and I use the Windows API with the MFC.

I have an application with a main window. And I have a second non modal dialog window. This second window is owned by the first window.

If I click in the main window the main window caption is shown as active.

If I click into the second window (dialog), it shows an active caption and the main window caption is inactive.

I want to show both captions as active if my application is active in either window. How to accomplish this?

You can see this effect when you open the Find dialog in Notepad. The dialog gets the active color. Click back into the main window the find dialog gets inactive.

I want to get the effect, that both windows stay with the active color as long as either window is active. And they should get inactive, when another application is active and none of my windows are active.

Edit: As some comments say: "Microsoft only allows 1 window to be active at a time."

You are correct but all programs behave in such a way when we look at floating toolbars and other floating windows. They have an active caption, when the main window is active. My window is such a thing too.

1

There are 1 best solutions below

0
Jeaninez - MSFT On

According to the Doc:Active Window

An active window is the top-level window of the application with which the user is currently working. Only one top-level window in the system is active at a time.