Solved

How to disable "Move" system menu item

Posted on 2001-06-12
14
734 Views
Last Modified: 2013-11-20
I found:  in the window's system menu, the "Move" menu item can not be disable by the following code:

CMenu *pSysMenu = this->GetSystemMenu(FALSE);
if ( pSysMenu != NULL )
   pSysMenu->EnableMenuItem( SC_MOVE, MF_GRAYED );

The "Move" menu item is still enabled when system menu pops;

And the "Close" menu item is no problem!

Why?
0
Comment
Question by:Loggy_yyj
  • 3
  • 3
  • 3
  • +4
14 Comments
 

Expert Comment

by:mickeer
ID: 6184766
Hi!


use:

pSysMenu->EnableMenuItem( SC_MOVE, MF_DISABLE );

instead.

/Micke

0
 

Expert Comment

by:mickeer
ID: 6184774
Hi again!

sorry but I misspelled, it should be:

pSysMenu->EnableMenuItem( SC_MOVE, MF_DISABLED );

/Micke



0
 

Author Comment

by:Loggy_yyj
ID: 6184851
Thank you!
But in my application, it still doesn't works by replacing your code.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 2

Expert Comment

by:MadYugoslav
ID: 6184883
pSysMenu->EnableMenuItem(SC_MOVE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
0
 
LVL 2

Accepted Solution

by:
GloriousRain earned 19 total points
ID: 6184978
CMenu *pSysMenu = this->GetSystemMenu(FALSE);
pSysMenu->ModifyMenu(SC_MOVE, MF_GRAYED | MF_BYCOMMAND, 0, "&Move");

0
 
LVL 42

Expert Comment

by:sedgwick
ID: 6184994
GloriousRain's comment is working perfectly...
0
 

Author Comment

by:Loggy_yyj
ID: 6185017
Only the
pSysMenu->ModifyMenu(SC_MOVE, MF_GRAYED | MF_BYCOMMAND, 0, "&Move"); calling works;

I don't know why?

Thanks for your helps!

0
 

Expert Comment

by:SrinivasaRao
ID: 6185027
I think its like
pSysMenu->EnableMenuItem( SC_MOVE, MF_BYCOMMAND | MF_DISABLED );
BSR
0
 
LVL 2

Expert Comment

by:MadYugoslav
ID: 6185032
I can't beleive that my comment don't work. It work fine in several places in my apps.
0
 
LVL 2

Expert Comment

by:GloriousRain
ID: 6185043
Have you try with SC_MOVE, MadYuqoslav?
0
 
LVL 2

Expert Comment

by:MadYugoslav
ID: 6185120
Now I try with SC_MOVE and thing don't work. Really don't know why ?
0
 
LVL 2

Expert Comment

by:GloriousRain
ID: 6185178
Hi loqqy_yyi,
I can't give you an exactly reason because i couldn't find document for this issue.
I can only say my opinion is: SC_MOVE was processed by VC to control position of window's frame (->we can do with SC_CLOSE) so we can't do that with EnableMenuItem. I just use ModifyMenu to change SC_MOVE to 0 so it can't be handled anymore.
0
 

Author Comment

by:Loggy_yyj
ID: 6185368
Thank you very much! Mr. GloriousRain!
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9484658
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by : GloriousRain

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate files macro - Errors on larger data set 18 71
has22 challenge 11 96
sum28 challenge 31 112
Problem to open Excel file 15 136
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question