How to disable all touch/gesture inputs for a C++ MFC Windows application?

Viewed 99

I have a MFC application which shows a full screen dialog. While the application is running, I want to disable all user inputs. I tried to disable touch inputs, but edge swiping and some touch inputs are still working. I tried the following code to disable touch gestures:

HRESULT 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);
        pPropStore->Release();
    }
    return hrReturnValue;
}

I am using an IPC panel. Please share your ideas how to disable all the touch interactions.

0 Answers
Related