WPF Kiosk app Disable edge swipe on windows 8.1 devices RRS feed

  • Question

  • We have a WPF kiosk application that we've had released for a few years now, touch based on windows vista and 7.

    We're looking at moving to running the software on windows 8.1 devices such as the surface pro and some of the newer dell tablets but we've run into a problem.

    We need to be able to disable the charms bar, and the swipe down from top gesture from our application to prevent users from getting to the start page.

    I've looked into the System.EdgeGesture.DisableTouchWhenFullScreen and tried an implementation of it but it seems to have no effect. the edge gestures are still enabled.

    The c++ implementation of the DisableTouchWhenFullScreen is as follows

    extern "C" __declspec(dllexport) bool SetTouchDisableProperty(HWND hwnd, BOOL fDisableTouch)
    	IPropertyStore* pPropStore;
    	HRESULT hrReturnValue = SHGetPropertyStoreForWindow(hwnd, IID_PPV_ARGS(&pPropStore));
    	if (SUCCEEDED(hrReturnValue))
    		PROPVARIANT var;
    		var.vt = VT_BOOL;
    		var.boolVal = fDisableTouch ? VARIANT_TRUE : VARIANT_FALSE;
    		hrReturnValue = pPropStore->SetValue(PKEY_EdgeGesture_DisableTouchWhenFullscreen, var);
    	return TRUE;

    Then in our wpf app we are using dllImport 

    [DllImport("disableFullScreenGesturesDLL.dll", EntryPoint = "SetTouchDisableProperty", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
            static extern bool SetTouchDisableProperty(IntPtr hWnd, bool fDisableTouch);

    and the acctual call

    public KioskNewMain()
                //Name	PID	Status	User name	CPU	Memory (private working set)	Description
                //MethasoftKiosk.vshost.exe	8340	Running	Dave	00 	10,388 K	vshost32.exe
                IntPtr intPtr = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;//.GetProcessesByName("MethasoftKiosk.vshost.exe")[0].MainWindowHandle;
                SetTouchDisableProperty(intPtr, true);

    What could i be doing wrong?


    Monday, September 8, 2014 4:07 PM


All replies