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
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.
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.
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.