System buttons in the title bar
Rudd Clive -- crudd@softronic.se
Wednesday, October 23, 1996
Environment: VC++ 4.2 on Win95, MSDN
Hi.
I would like to put a extra button biside the system buttons for Maximize,
Minimize and Close in the Title bar, any subjections?
Can anyone point me in the right direction? Is there any sample code
regarding this?
Thanks,
Clive Rudd
crudd@softronic.se
Randy Taylor -- drt@ebt.com
Friday, October 25, 1996
Basically you need to do some of your own painting in the non-client
area of the window. If you study the source code in the MFC source file
c:\msdev\mfc\src\BARDOCK.CPP
you'll see how to do this.
Also, there are fun things in \msdev\include\winuser.h
which are NOT wrapped in the MFC for doing non-client painting.
For example, there are functions like this:
WINUSERAPI BOOL WINAPI DrawEdge(HDC hdc, LPRECT qrc, UINT edge, UINT grfFlags);
WINUSERAPI BOOL WINAPI DrawFrameControl(HDC, LPRECT, UINT, UINT);
WINUSERAPI BOOL WINAPI DrawCaption(HWND, HDC, CONST RECT *, UINT);
Of course, you'll have to trap mouse events on your new button.
Just look up all the window messages which start witn WM_NC
because those are the ones for Non-client stuff.
Setup your message maps, and you're off to the races...
Cheers,
randy_taylor@ebt.com
>Environment: VC++ 4.2 on Win95, MSDN
>
>Hi.
>
>I would like to put a extra button biside the system buttons for Maximize,
>Minimize and Close in the Title bar, any subjections?
>
>Can anyone point me in the right direction? Is there any sample code
>regarding this?
>
>Thanks,
>Clive Rudd
>crudd@softronic.se
>
>
| Вернуться в корень Архива
|