Created
October 4, 2024 22:06
-
-
Save sys9kdr/60a0943fd0e2e7768da3667e229b6976 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <windows.h> | |
#define IME_CONTROL 0x283 | |
#define IMC_GETOPENSTATUS 0x5 | |
#define IMC_SETOPENSTATUS 0x6 | |
int main(int argc, char** argv) { | |
HWND fg = GetForegroundWindow(); | |
if(!fg) return 0; | |
HWND ime = ImmGetDefaultIMEWnd(fg); | |
if(!ime) return 0; | |
LPARAM status; | |
if(argc < 2) { | |
status = SendMessage(ime, WM_IME_CONTROL, IMC_GETOPENSTATUS, 0); | |
} else { | |
status = (LPARAM)atol(argv[1]); | |
SendMessage(ime, IME_CONTROL, IMC_SETOPENSTATUS, status); | |
} | |
printf("%lld", status); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment