Answered by:
WPF Kiosk app Disable edge swipe on windows 8.1 devices

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); pPropStore->Release(); } 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); InitializeComponent(); }
What could i be doing wrong?
Thanks
- Edited by Will Leonard Monday, September 8, 2014 8:35 PM
Monday, September 8, 2014 4:07 PM
Answers
-
If it's a kiosk app then doesn't that mean it's the only thing running on the device?
http://winaero.com/blog/how-to-disable-charms-bar-completely-in-windows-8-1/
Those settings must be stored in the registry somewhere.
Edit:
Ahah!
http://en.kioskea.net/faq/29733-windows-8-1-prevent-the-automatic-display-of-the-charms-bar
Hope that helps
Please don't forget to up vote answers you like or which help you and mark one(s) which answer your question.
- Edited by Andy ONeill Monday, September 8, 2014 6:59 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Friday, December 4, 2015 5:05 AM
Monday, September 8, 2014 6:57 PM -
We have the same issue und hier is our solution:
add Microsoft Windows API code pack with shell extention
using following code:
static PropertyKey PKEY_EdgeGesture_DisableTouchWhenFullscreen = new PropertyKey("32CE38B2-2C9A-41B1-9BC5-B3784394AA44", 2); ... WindowProperties.SetWindowProperty(this, PKEY_EdgeGesture_DisableTouchWhenFullscreen, "-1");
I hope it helps.
cheers
- Proposed as answer by Andy ONeill Thursday, May 7, 2015 12:34 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Friday, December 4, 2015 5:05 AM
Thursday, May 7, 2015 12:28 PM -
I don't have a win8.1 touch screen device to experiment on, I'm afraid.
This article here
http://www.tomshardware.co.uk/faq/id-2082953/disable-swipe-windows.html
Seems to claim switching off that "when I point to the upper right corner...." setting turns swipe off.
That's the first tick box on that first link I posted.
Did you try that?
Hope that helps
Please don't forget to up vote answers you like or which help you and mark one(s) which answer your question.- Marked as answer by Ed Price - MSFTMicrosoft employee Friday, December 4, 2015 5:05 AM
Tuesday, September 9, 2014 7:07 AM
All replies
-
If it's a kiosk app then doesn't that mean it's the only thing running on the device?
http://winaero.com/blog/how-to-disable-charms-bar-completely-in-windows-8-1/
Those settings must be stored in the registry somewhere.
Edit:
Ahah!
http://en.kioskea.net/faq/29733-windows-8-1-prevent-the-automatic-display-of-the-charms-bar
Hope that helps
Please don't forget to up vote answers you like or which help you and mark one(s) which answer your question.
- Edited by Andy ONeill Monday, September 8, 2014 6:59 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Friday, December 4, 2015 5:05 AM
Monday, September 8, 2014 6:57 PM -
Thanks for the info.
it definitely helps, however what that does (at least for me) is disable the showing of the charms bar from the mouse over hotspots in top and bottom corners of the screen.
You can still get charms to show up via swiping into the screen from the right hand side (touchscreen device).
It will normally be the only application running on the device.
- Edited by Will Leonard Monday, September 8, 2014 8:42 PM
Monday, September 8, 2014 8:35 PM -
I don't have a win8.1 touch screen device to experiment on, I'm afraid.
This article here
http://www.tomshardware.co.uk/faq/id-2082953/disable-swipe-windows.html
Seems to claim switching off that "when I point to the upper right corner...." setting turns swipe off.
That's the first tick box on that first link I posted.
Did you try that?
Hope that helps
Please don't forget to up vote answers you like or which help you and mark one(s) which answer your question.- Marked as answer by Ed Price - MSFTMicrosoft employee Friday, December 4, 2015 5:05 AM
Tuesday, September 9, 2014 7:07 AM -
We have the same issue und hier is our solution:
add Microsoft Windows API code pack with shell extention
using following code:
static PropertyKey PKEY_EdgeGesture_DisableTouchWhenFullscreen = new PropertyKey("32CE38B2-2C9A-41B1-9BC5-B3784394AA44", 2); ... WindowProperties.SetWindowProperty(this, PKEY_EdgeGesture_DisableTouchWhenFullscreen, "-1");
I hope it helps.
cheers
- Proposed as answer by Andy ONeill Thursday, May 7, 2015 12:34 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Friday, December 4, 2015 5:05 AM
Thursday, May 7, 2015 12:28 PM -
Great stuff.
Thanks for providing a solution.
Thursday, May 7, 2015 12:35 PM