![]() |
Title bar close button NOT greyed when disabled |
Post Reply
|
| Author | |
brianh
Groupie
Joined: 30 April 2004 Location: United Kingdom Status: Offline Points: 83 |
Post Options
Thanks(0)
Quote Reply
Topic: Title bar close button NOT greyed when disabledPosted: 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.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 October 2007 at 10:14am |
|
Hi,
Just set MF_DISABLED instead of MF_GRAYED.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
brianh
Groupie
Joined: 30 April 2004 Location: United Kingdom Status: Offline Points: 83 |
Post Options
Thanks(0)
Quote Reply
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.
![]() |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 October 2007 at 5:10am |
|
Yes, its changed :)
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |