If you wish to disable right clicking anywhere on the desktop, then all you need to use Windows registry Editor.
1.) Start > Run > regedit
2.) Now, navigate to HKEY_CURRENT_USER\software\Microsoft\Windows\CurrentVersion\Policies\Explorer.
3.) Right click in the right plane and create a new DWORD value. name this DWORD key “NoViewContextMenu”.
4.) Double click on this DWORD and set its value to
1.
5.) In the same registry key as above, again right click in the right pane and create another DWORD value. Name this DWORD “NoTrayContextmenu”.
6.) Double click on this DWORD and set its value to
1.
7.) Now, we will have to disable the context menu for the taskbar, to do this navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced.
8.) Right click in the right pane and create a new DWORD value before. Name this DWORD “TaskbarContextMenu”. This new DWORD will have a Value of 0.
That’s it. You are done. Exit the Registry editor and Restart your PC to take effect. Now you can try to right clicking anywhere but you would now be able to do.
To restore the context menues, repeat the above procedures, and simply change back the values from
0 to 1 and
1 to 0 as necessary.
Source: Tweaking Windows