把当前 focus 所在窗口的输入法状态设为中文
HWND hWnd = GetForegroundWindow();ASSERT(IsWindow(hWnd))
// Get Target Thread ID and Attach Thread Input
DWORD ProcID;
DWORD ThreadID = GetWindowThreadProcessId(hWnd, &ProcID);
AttachThreadInput(GetCurrentThreadId(), ThreadID, TRUE);
// Get Target Window
HWND hWndFocus = GetFocus();
// Post Input Messages
ASSERT(IsWindow(hWndFocus));
// Change Input Language
PostMessage(hWndFocus, WM_INPUTLANGCHANGEREQUEST, (WPARAM)TRUE, (LPARAM)g_hklRPC); // Use Language ID 0x0804(Chinese PRC)
// Detach Thread Input
AttachThreadInput(GetCurrentThreadId(), ThreadID, FALSE); 还是C++? 希望楼主该成易语言
页:
[1]