|
-
March 14th, 2006, 12:19 AM
#1
Replace Title/Caption bar min,max,close buttons
Actually i want to place my own bitmap instead of windows xp default close button bitmap.
-> How can i Replace Default Close button without disabling SYS_MENU property ( or )
-> how can i hide the close button in the title bar without changing the System Menu property.
Thanks in Advance
-
March 14th, 2006, 12:44 AM
#2
Re: Replace Title/Caption bar min,max,close buttons
 Originally Posted by venkatapathiraju_t
Actually i want to place my own bitmap instead of windows xp default close button bitmap.
-> How can i Replace Default Close button without disabling SYS_MENU property ( or )
-> how can i hide the close button in the title bar without changing the System Menu property.
Thanks in Advance
I guess you can't hide it, but you can disable it by disabling the SC_CLOSE item in the system menu for the window.
Code:
EnableMenuItem (hMenu, SC_CLOSE, MF_GRAYED);
It takes seconds for rating…that actually compensates the minutes taken for giving answers
The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
Regards, Be generous->Rate people
Jayender!!
-
March 14th, 2006, 12:51 AM
#3
Re: Replace Title/Caption bar min,max,close buttons
EnableMenuItem disables the close button, but i want to replace close button[X] image with my own bitmap, something like skin based applications.
-
March 14th, 2006, 02:30 AM
#4
Re: Replace Title/Caption bar min,max,close buttons
Override OnEraseBkgnd or process WM_ERASEBKGND to draw your own caption using DrawCaption(), and repainting the buttons as you like.
Process WM_NC* (non-client messages), or in MFC, override OnNc* (non-client overrides).
Removing WS_SYSMENU style will remove the close button, but also the system menu of that window.
Disabling close button can be achieved with:
ModifyMenu(hMenu, SC_CLOSE, MF_BYCOMMAND|MF_GRAYED, SC_CLOSE, "Close");
Removing it can be achieved with:
RemoveMenu(hMenu,SC_CLOSE,MF_BYCOMMAND);
Regards,
-
March 14th, 2006, 03:55 AM
#5
Re: Replace Title/Caption bar min,max,close buttons
use this code to disable the close button and remove the close menu in the dialog box(click on the left top of the dialog box).
Code:
BOOL bEnable = TRUE;
UINT menuf = bEnable ? (MF_BYCOMMAND) : (MF_BYCOMMAND | MF_GRAYED | MF_DISABLED);
CMenu* pSM = GetSystemMenu(FALSE);
if(pSM)
{
pSM->RemoveMenu(SC_CLOSE,menuf);
}
If I Helped You, "Rate This Post"
Thanks
Guna
-
March 14th, 2006, 04:27 AM
#6
Re: Replace Title/Caption bar min,max,close buttons
I want to disable the close button only (not close menu).
I want to have the close menu in the dialog box.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|