?? 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 + -