이것은 vs2010 MFC 대화 상자 응용 프로그램과 함께 사용됩니다. 아래의 코드 외에도 다음 libs, ehstorguids.lib Uuid.Lib을 포함하여 시도했습니다. 최종 목표는 윈도우 8 Charms Bar를 죽이는 것입니다. 이 선언되지 않은 식별자를 발생시키기 위해 나는 무엇을 놓쳤습니다.PKEY_EdgeGesture_DisableTouchWhenFullscreen 선언되지 않은 식별자
#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <propsys.h>
#include <propkey.h>
using namespace std;
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;
}
BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam)
{
TCHAR title[500];
ZeroMemory(title, sizeof(title));
GetWindowText(hWnd, title, sizeof(title)/sizeof(title[0]));
if (!_tcscmp(title, _T("helloworld")))
{
SetTouchDisableProperty(hWnd,true);
}
return TRUE;
}
void mymfcdialog::ObBnClickedOk()
{
EnumWindows(MyEnumProc, 0);
}