📄 immenum.cpp
字号:
// IMMEnum.cpp: implementation of the CIMMEnum class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "WMVC.h"
#include "IMMEnum.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//
//下面的头文件引入了imm的相关定义
//并且在#pragma中加入了它的lib库
//
#include <imm.h> //for imm method
#pragma comment(lib, "Imm32.lib")
CIMMEnum::CIMMEnum()
{
m_lpHKL_List = NULL;
UINT uCount = GetKeyboardLayoutList(0, NULL);
if (0 != uCount)
{
m_lpHKL_List = new HKL[uCount];
GetKeyboardLayoutList(uCount, m_lpHKL_List);
TRACE("GetKeyboardLayoutList OK!!\n");
}
else
{
int nErr = GetLastError();
TRACE("Error is %d\n", nErr);
}
CString strLayoutText;
for (UINT i = 0; i < uCount; i++)
{
ImmGetDescription(m_lpHKL_List[i], strLayoutText.GetBuffer(256), 256);
strLayoutText.ReleaseBuffer();
m_strlstIMM.AddTail(strLayoutText);
}
}
CIMMEnum::~CIMMEnum()
{
if (m_lpHKL_List != NULL)
{
delete []m_lpHKL_List;
}
}
const CStringList& CIMMEnum::GetIMMs()
{
return m_strlstIMM;
}
const HKL * CIMMEnum::GetKeyboardLayouts()
{
return m_lpHKL_List;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -