static BOOL init(void) { WNDCLASSEX wc; HIMC imc; HMODULE hmod,huser; hmod = GetModuleHandleA("imm32.dll"); huser = GetModuleHandleA("user32"); pImmAssociateContextEx = (void*)GetProcAddress(hmod, "ImmAssociateContextEx"); pImmIsUIMessageA = (void*)GetProcAddress(hmod, "ImmIsUIMessageA"); pSendInput = (void*)GetProcAddress(huser, "SendInput"); wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = wndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = GetModuleHandle(0); wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = NULL; wc.lpszClassName = wndcls; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); if (!RegisterClassExA(&wc)) return FALSE; hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, NULL, NULL, GetModuleHandle(0), NULL); if (!hwnd) return FALSE; imc = ImmGetContext(hwnd); if (!imc) { win_skip("IME support not implemented\n"); return FALSE; } ImmReleaseContext(hwnd, imc); ShowWindow(hwnd, SW_SHOWNORMAL); UpdateWindow(hwnd); msg_spy_init(hwnd); return TRUE; }
static int init(void) { WNDCLASSEX wc; HIMC imc; wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = DefWindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = GetModuleHandle(0); wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = NULL; wc.lpszClassName = wndcls; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); if (!RegisterClassExA(&wc)) return 0; hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, NULL, NULL, GetModuleHandle(0), NULL); if (!hwnd) return 0; imc = ImmGetContext(hwnd); if (!imc) { win_skip("IME support not implemented\n"); return 0; } ImmReleaseContext(hwnd, imc); ShowWindow(hwnd, SW_SHOWNORMAL); UpdateWindow(hwnd); msg_spy_init(hwnd); return 1; }