child window style?

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:

    WS_CHILD | WS_VISIBLE | WS_CAPTION

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!

Thanks!
     
Already_GoogledAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RichieHindleCommented:
Try sending the window a WM_NCACTIVATE message:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowMessages/WM_NCACTIVATE.asp

"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."
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Already_GoogledAuthor Commented:
RichieHindle, you are a genius.

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

Thanks again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.