模拟键盘消息
// 输入中文
void InputCH(HWND hWnd, CString cstrInput)
{
DWORD word = 0;
for (int i=0; i < cstrInput.GetLength(); i+=2)
{
memcpy(&word, &cstrInput.GetBuffer(NULL)[i], 2);
SendMessage(hWnd, WM_CHAR, word, 0);
Sleep(10);
}
}
浙公网安备 33010602011771号