Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Title bar close button NOT greyed when disabled
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Title bar close button NOT greyed when disabled

 Post Reply Post Reply
Author
Message
brianh View Drop Down
Groupie
Groupie


Joined: 30 April 2004
Location: United Kingdom
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote brianh Quote  Post ReplyReply Direct Link To This Post Topic: Title bar close button NOT greyed when disabled
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 17 October 2007 at 10:14am
Hi,
 
Just set MF_DISABLED instead of MF_GRAYED.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
brianh View Drop Down
Groupie
Groupie


Joined: 30 April 2004
Location: United Kingdom
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote brianh Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2007 at 5:10am
Yes, its changed :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.