Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


child window style?

Posted on 2004-10-21
Medium Priority
Last Modified: 2013-11-20
I want to make a child window that is clipped by the main app window (its parent) and it should move with the main app window when the user moves it. This is exactly how the child documents behave in an MDI application. I can't use MFC though.

I have reproduced this same functionality by specifying the following window style for the child:


However, the title bar of this child is always greyed out. I cannot find any combination of styles that will allow the title bar to be active. I tried artificially setting the focus when the user clicks on the child using
SetFocus(), EnableWindow(), ShowWindow(), but to no avail, the title bar is still greyed out! This is more a stylistic annoyance than anything else as the functionality is there, please can someone tell me how to correct this!

Question by:Already_Googled
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 14

Accepted Solution

RichieHindle earned 880 total points
ID: 12371571
Try sending the window a WM_NCACTIVATE message:


"The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state. [...] The DefWindowProc function draws the title bar or icon title in its active colors when the wParam parameter is TRUE and in its inactive colors when wParam is FALSE."

Author Comment

ID: 12371599
RichieHindle, you are a genius.

Thank you.. I have been looking for a solution for so long.

Thanks again.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question