I want to know Is the system menu (in the top-left corner of form) open? and if yes Close it. How can I do it in .NET?
Asked
Active
Viewed 154 times
0
-
Can you modify the code of the form you want to close it's main menu? – Hamid Pourjam May 02 '16 at 12:02
-
Your process? Another process? Do you have the source code or is it not under your control? – IInspectable May 02 '16 at 12:02
-
Override with your own, then close it, see https://stackoverflow.com/questions/4615940/how-can-i-customize-the-system-menu-of-a-windows-form for further detail. – MathuSum Mut May 02 '16 at 12:08
-
this issue is discussed in many pages like this: http://stackoverflow.com/questions/19918264/how-i-could-cancel-opening-the-system-menu-of-an-application but I want to Close this menu – sde.mahdi May 02 '16 at 12:10
-
MathuSum Mut, can you help me by code? – sde.mahdi May 02 '16 at 12:29
-
in Menu Functions I don't see a functions for close system menu : https://msdn.microsoft.com/en-us/library/windows/desktop/ms646977%28v=vs.85%29.aspx – sde.mahdi May 02 '16 at 12:32
-
You can call [EndMenu](https://msdn.microsoft.com/en-us/library/windows/desktop/ms647637.aspx) to *"end the calling thread's active menu"*. – IInspectable May 02 '16 at 17:00