How do I turn off windows 8.1 gestures and setting charm bar on my touch Screen

前端 未结 3 1373
予麋鹿
予麋鹿 2021-01-16 09:27

I Have an Touch screen Dell and Windows 8.1 Single language installed, When I move my finger from Right edge towards the middle, Windows 8 will bring up setting charm bar OR

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-16 10:06

    I have the same problem. I have used a Windows system properties named : PKEY_EdgeGesture_DisableTouchWhenFullscreen(http://msdn.microsoft.com/en-us/library/windows/desktop/jj553591(v=vs.85).aspx).

    c# --> call dll via P/Invoke --> set PKEY_EdgeGesture_DisableTouchWhenFullscreen property.

    Nota Bene : This solution doesn't work for a Modern UI app. For Modern UI app use kiosk mode : Assigned Access http://technet.microsoft.com/en-us/library/dn465334.aspx .

    Snippet code DLL:

    extern "C" __declspec(dllexport) bool SetTouchDisableProperty(HWND hWnd)
    {
        PROPVARIANT var;
        var.vt = VT_BOOL;
        var.boolVal = VARIANT_TRUE;
        // Get window properties
        IPropertyStore* pPropStore;
        IID_PPV_ARGS(&pPropStore);
        HRESULT hrReturnValue = SHGetPropertyStoreForWindow(hWnd, IID_PPV_ARGS(&pPropStore));
        // set  PKEY_EdgeGesture_DisableTouchWhenFullscreen property
        if (SUCCEEDED(hrReturnValue))
        {
            hrReturnValue = pPropStore->SetValue(PKEY_EdgeGesture_DisableTouchWhenFullscreen, var);
            pPropStore->Release();
        }
        return TRUE;
    }
    

    Snippet code c# to call dll :

     [DllImport("libDisableTouchDll.dll", EntryPoint = "SetTouchDisableProperty"
    , ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
        static extern bool SetTouchDisableProperty(IntPtr hWnd);
    
        static void Main(string[] args)
        {    
            // dirty get inPtr process for firefox 
            IntPtr intPtr = System.Diagnostics.Process.GetProcessesByName("firefox")[0].MainWindowHandle;
            SetTouchDisableProperty(intPtr);
        }
    

提交回复
热议问题