Preventing user from open start menu

前端 未结 3 1933
渐次进展
渐次进展 2021-01-24 07:22

I have a program that should prevent the user from opening taskmanager and from openinig Start Menu. I have already added code to disable taskmanager and need now to prevent use

相关标签:
3条回答
  • 2021-01-24 07:45

    As far as I know, you can reduce a users access rights so they have almost nothing on the start menu, except shutdown / logoff.

    However for ethical reasons there is no built in way to disable the start menu.

    0 讨论(0)
  • 2021-01-24 07:56

    I'd suggest going with a policy but if you really need to do it programmatically you can try the following (not sure what versions of Windows this supports).

    You'll have to search for the process that is the TaskBar, then you'll have to search through all it's threads to find the start button. This CodeProject article shows how to do it: Hiding the Taskbar and Startmenu (start orb) in Windows Vista

    You might also have to create some keyboard hooks to disable the user opening the start menu via some keyboard combo.

    0 讨论(0)
  • 2021-01-24 07:59
    IntPtr trayHandle = FindWindow("Shell_TrayWnd", null);
    IntPtr buttonHandle = FindWindowEx(trayHandle, IntPtr.Zero, "Button", IntPtr.Zero);
    bool result = EnableWindow(buttonHandle, false);
    

    Those three functions are WinAPI: FindWindow, FindWindowEx and EnableWindow.

    0 讨论(0)
提交回复
热议问题