From d17440a86259544ba5e48645e74136c892dc0c79 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Mon, 17 Jun 2024 17:16:58 +0800 Subject: [PATCH] Disable the IME --- DSView/pv/winnativewidget.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DSView/pv/winnativewidget.cpp b/DSView/pv/winnativewidget.cpp index 9b523669..eb449e66 100644 --- a/DSView/pv/winnativewidget.cpp +++ b/DSView/pv/winnativewidget.cpp @@ -53,6 +53,7 @@ typedef HPOWERNOTIFY(WINAPI* PFN_REGISTER_SUSPEND_RESUME_NOTIFICATION)(HANDLE, DWORD); typedef BOOL(WINAPI* PFN_UNREGISTER_SUSPEND_RESUME_NOTIFICATION)(HPOWERNOTIFY); +typedef HIMC (WINAPI* FN_ImmAssociateContext)(HWND,HIMC); namespace pv { @@ -181,6 +182,17 @@ WinNativeWidget::WinNativeWidget(const int x, const int y, const int width, } InitCapturePowerEvent(_hWnd); + + //Disabled the IMME. + HMODULE hImm32Dll = LoadLibraryW(L"imm32.dll"); + if (hImm32Dll != NULL){ + FN_ImmAssociateContext fnImm = (FN_ImmAssociateContext)GetProcAddress(hImm32Dll, "ImmAssociateContext"); + + if (fnImm){ + fnImm(_hWnd, NULL); + } + FreeLibrary(hImm32Dll); + } } WinNativeWidget::~WinNativeWidget()