Print Page | Close Window

Title bar close button NOT greyed when disabled

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=8445
Printed Date: 31 October 2024 at 8:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Title bar close button NOT greyed when disabled
Posted By: brianh
Subject: Title bar close button NOT greyed when disabled
Date Posted: 17 October 2007 at 7:55am
When skinning is applied, if I open a dialog and disable the close button in the OnInitDialog() handler, the close button in the title bar remains active!
 
The 'Close' option in the system menu is greyed out, and the 'Close' button does nothing when clicked, but the button itself remains active.  If skinning is removed the button greys out as expected.
 
I use the following command to disable the close button:
 
::EnableMenuItem(GetSystemMenu(hwnd, FALSE), SC_CLOSE, MF_GRAYED);
 
Any ideas on how to fix this? Thanks.



Replies:
Posted By: Oleg
Date Posted: 17 October 2007 at 10:14am
Hi,
 
Just set MF_DISABLED instead of MF_GRAYED.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: brianh
Date Posted: 17 October 2007 at 11:28am
Thanks Oleg, that fixed the problem, although I had to OR MF_DISABLED with MF_GRAYED in order to gray out the menu item too.
 
For the record, the documentation for EnableMenuItem states that MF_GRAYED means "disabled and grayed", and in fact this is what happens when skinning is not being used, so I think you still have a minor issue to fix.


Posted By: Oleg
Date Posted: 18 October 2007 at 5:10am
Yes, its changed :)

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net