终于找到怎么解决这个问题了。
Handle m_hkey= CreateFile(_T("key1:"),
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
0);
if (m_hkey == INVALID_HANDLE_VALUE || NULL == m_hkey)
{
::MessageBox(NULL,L"Open userkey Driver error!",NULL,MB_OK);
CloseHandle(m_hkey);
return false;
}
读按键状态
DWORD num;
BYTE b[8];
ReadFile(m_hkey,b,sizeof(b),&num,NULL);