Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# How to programmatically disable Windows 8 specific features

This question is asked alot, but I couldnt find working method / way to do it - except for a third party application.
I am pretty sure, or atleast I am being very hopeful that solution for this problem does exist.

As the title says, I want to disable window 8 gestures just like every third app is doing (SkipMetroSuite, ClassicShellMenu or w/e).

I need it to be built in in my app because I cant install anything on the compter my app is dedicated to but my app itself...

Is there a way to do it in C#?

EDIT:
I personally asked the developer of Classic Shell Menu how his programs works, here is the answer:

The principle is to inject a message hook in the thread of window with class “ApplicationManager_DesktopShellWindow”, then listen for mouse messages sent to windows with class “EdgeUiInputWndClass”, and hide those windows. When my program exists it reshows all windows that it has hidden.

He also mentioned I can find the solution here: Classic Shell src

But there's one problem, the solution is in c++ and I have no Idea how to port it to c# so I would appreciate your help.
The solution is in ClassicStartMenuDLL.cpp which is in ClassicStartMenuDLL Solution.

like image 431
Ron Avatar asked Dec 12 '13 10:12

Ron


1 Answers

The first step to what you want to do is to disable Metro mode (the start screen tiles).

You can achieve this via a registry edit, which you can do programmatically.

The entry of interest is the following:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RPEnabled

You need to set this to 0

Next, you want to disable the 'hot corners'. This is also a registry edit which can be done programmatically.

The entry of interest is the following:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ImmersiveShell

Create a new key called EdgeUI, and under thay key create the following DWORD entries:

  • DisableTLcorner
  • DisableTRcorner (Windows 8.1+)
  • DisableCharmsHint

Set both values to 1

Since these are both HKCU settings (i.e. current user), then a simple log-off is all that is required for them to take effect.

Alternatively you can kill the explorer process, though it is not recommended.

If it is not working for you, try to test it with a ready-made registry file first, since you might be doing something wrong -> Disable Charms & Switcher

like image 187
Stefan Z Camilleri Avatar answered Sep 28 '22 04:09

Stefan Z Camilleri