?
Solved

Customised Caption

Posted on 1999-12-06
9
Medium Priority
?
227 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:RodneyYeo
  • 5
  • 4
9 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 400 total points
ID: 2260848
0
 

Author Comment

by:RodneyYeo
ID: 2261038
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
 
LVL 23

Expert Comment

by:chensu
ID: 2262586
Don't call DefWindowProc in the WM_NCPAINT handler.
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 

Author Comment

by:RodneyYeo
ID: 2263907
How do I handle the messages for the minimise/maximise/close button in this case?
0
 
LVL 23

Expert Comment

by:chensu
ID: 2264110
Process the WM_NCLBUTTONDOWN / WM_NCLBUTTONUP messages.
0
 

Author Comment

by:RodneyYeo
ID: 2264270
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
 

Author Comment

by:RodneyYeo
ID: 2264394
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
 
LVL 23

Expert Comment

by:chensu
ID: 2265834
>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
 

Author Comment

by:RodneyYeo
ID: 2267192
Thanks, I finally got it working :)
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

598 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