I created an application that is set up in a museum as a kiosk. Users are not supposed to be able to interact with anything outside the application itself but because we are using Windows 8.1 they have access to the Charms Bar. We have tried a lot of things including a Native Plugin (which could still work but it is crashing the app right now).
I really need help because the app is live currently and people have accidentally opened the charms bar already.
Also here is the plugin I wrote based off of Microsoft example code. (Currently crashes the app).
Disable.cpp
#include "stdafx.h"
#include <string>
#include <propkey.h>
#include <propsys.h>
#include <cstdlib>
#define DLLExport __declspec (dllexport)
namespace DisableCharms
{
extern "C"
{
DLLExport std::string DisableCharmsBar()
{
HWND window;
window = FindWindow(NULL, TEXT("ABCD"));
std::string msg = "FoundWindow";
if (window != 0)
{
IPropertyStore* pPropStore;
HRESULT hrReturnValue = SHGetPropertyStoreForWindow(window, IID_PPV_ARGS(&pPropStore));
if (SUCCEEDED(hrReturnValue))
{
PROPVARIANT var;
var.vt = VT_BOOL;
var.boolVal = VARIANT_TRUE;
hrReturnValue = pPropStore->SetValue(PKEY_EdgeGesture_DisableTouchWhenFullscreen, var);
pPropStore->Release();
}
}
msg = "Could not find window: ";
msg += winName;
return msg;
}
}
}
CharmsBar.cs
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class CharmsBar : MonoBehaviour {
[DllImport ("DisableDLL")]
private static extern string DisableCharmsBar();
// Use this for initialization
void Awake () {
string log = DisableCharmsBar();
Debug.Log (log);
}
}