Customised Caption

Can someone provide me with some codes on the ways of drawing a customised caption, with different graphics for the caption bar, minimize icon, maximize icon etc.
Thanks
RodneyYeoAsked:
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.

chensuCommented:
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
RodneyYeoAuthor Commented:
If I need to draw a customise window minimise button other than the one provided by windows, how do I do it? The article seems to only provide means of drawing the entire caption.
0
chensuCommented:
Don't call DefWindowProc in the WM_NCPAINT handler.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

RodneyYeoAuthor Commented:
How do I handle the messages for the minimise/maximise/close button in this case?
0
chensuCommented:
Process the WM_NCLBUTTONDOWN / WM_NCLBUTTONUP messages.
0
RodneyYeoAuthor Commented:
I have this codes under the OnNCLButtonDown

CRect rect;
GetButtonRect(rect);
if (rect.PtInRect(point))
{
//draw the button
DrawMaximiseButton();
....
....
}

Should I do a repaint or send message to the window requesting for a repaint,
like SendMessage(WM_NCPAINT)?
0
RodneyYeoAuthor Commented:
What is also the codes for closing a window, minimize/maximise a window? I have turn off SYS_MENU and now I need to handle certain message if the user click on my custom close button. How can I go about doing it. Thanks for your patience :)
0
chensuCommented:
>Should I do a repaint or send message to the window requesting for a repaint, like SendMessage(WM_NCPAINT)?

Yes, use PostMessage(WM_NCPAINT).

>What is also the codes for closing a window, minimize/maximise a window?

Closing - PostMessage(WM_CLOSE)

Minimizing - ShowWindow(SW_MINIMIZE)

Maximizing - ShowWindow(SW_MAXIMIZE)

You may also post the WM_SYSCOMMAND message.
0
RodneyYeoAuthor Commented:
Thanks, I finally got it working :)
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.