xref: /reactos/win32ss/user/user32/misc/imm.c (revision c45a6e15)
1c2c66affSColin Finck /*
2c2c66affSColin Finck  * COPYRIGHT:       See COPYING in the top level directory
3c2c66affSColin Finck  * PROJECT:         ReactOS user32.dll
4c2c66affSColin Finck  * FILE:            win32ss/user/user32/misc/imm.c
5c2c66affSColin Finck  * PURPOSE:         User32.dll Imm functions
6c2c66affSColin Finck  * PROGRAMMER:      Dmitry Chapyshev (dmitry@reactos.org)
7c2c66affSColin Finck  * UPDATE HISTORY:
8c2c66affSColin Finck  *      01/27/2009  Created
9c2c66affSColin Finck  */
10c2c66affSColin Finck 
11c2c66affSColin Finck #include <user32.h>
12c2c66affSColin Finck 
13c2c66affSColin Finck #include <winnls32.h>
14c2c66affSColin Finck 
15c2c66affSColin Finck #include <wine/debug.h>
16c2c66affSColin Finck #include <strsafe.h>
17c2c66affSColin Finck 
18c2c66affSColin Finck WINE_DEFAULT_DEBUG_CHANNEL(user32);
19c2c66affSColin Finck 
20c2c66affSColin Finck #define IMM_INIT_MAGIC 0x19650412
21c2c66affSColin Finck 
22c2c66affSColin Finck 
23c2c66affSColin Finck Imm32ApiTable gImmApiEntries = {0};
24c2c66affSColin Finck HINSTANCE ghImm32 = NULL;
25c2c66affSColin Finck BOOL bImmInitializing = FALSE;
26c2c66affSColin Finck BOOL ImmApiTableZero = TRUE;
27c2c66affSColin Finck 
28c2c66affSColin Finck 
29c2c66affSColin Finck /*
30c2c66affSColin Finck  *  This function should not be implemented, it is used,
31c2c66affSColin Finck  *  if you can not load function from imm32.dll
32c2c66affSColin Finck  */
33c2c66affSColin Finck BOOL WINAPI IMM_ImmIsIME(HKL hKL) { return 0; }
34c2c66affSColin Finck HIMC WINAPI IMM_ImmAssociateContext(HWND hwnd, HIMC himc) { return 0; }
35c2c66affSColin Finck BOOL WINAPI IMM_ImmReleaseContext(HWND hwnd, HIMC himc) { return 0; }
36c2c66affSColin Finck LRESULT WINAPI IMM_ImmEscapeAW(HKL hkl, HIMC himc, UINT uint, LPVOID lpvoid) { return 0; }
37c2c66affSColin Finck LONG WINAPI IMM_ImmGetCompositionStringAW(HIMC himc, DWORD dword1, LPVOID lpvoid, DWORD dword2) { return 0; }
38c2c66affSColin Finck BOOL WINAPI IMM_ImmGetCompositionFontA(HIMC himc, LPLOGFONTA lplf) { return 0; }
39c2c66affSColin Finck BOOL WINAPI IMM_ImmGetCompositionFontW(HIMC himc, LPLOGFONTW lplf) { return 0; }
40c2c66affSColin Finck BOOL WINAPI IMM_ImmSetCompositionFontA(HIMC himc, LPLOGFONTA lplf) { return 0; }
41c2c66affSColin Finck BOOL WINAPI IMM_ImmSetCompositionFontW(HIMC himc, LPLOGFONTW lplf) { return 0; }
42c2c66affSColin Finck BOOL WINAPI IMM_ImmSetGetCompositionWindow(HIMC himc, LPCOMPOSITIONFORM lpcf) { return 0; }
43c2c66affSColin Finck HIMC WINAPI IMM_ImmGetContext(HWND hwnd) { return 0; }
44c2c66affSColin Finck HWND WINAPI IMM_ImmGetDefaultIMEWnd(HWND hwnd) { return 0; }
45c2c66affSColin Finck BOOL WINAPI IMM_ImmNotifyIME(HIMC himc, DWORD dword1, DWORD dword2, DWORD dword3) { return 0; }
46c2c66affSColin Finck BOOL WINAPI IMM_ImmRegisterClient(PVOID ptr, HINSTANCE hMod) { return 0; }
47c2c66affSColin Finck UINT WINAPI IMM_ImmProcessKey(HWND hwnd, HKL hkl, UINT Vk, LPARAM lParam, DWORD HotKey) { return 0; }
48c2c66affSColin Finck 
49*c45a6e15SJames Tabor HRESULT WINAPI GetImmFileName(PWSTR lpBuffer, UINT uSize)
50*c45a6e15SJames Tabor {
51*c45a6e15SJames Tabor   UINT length;
52*c45a6e15SJames Tabor   STRSAFE_LPWSTR Safe = lpBuffer;
53*c45a6e15SJames Tabor 
54*c45a6e15SJames Tabor   length = GetSystemDirectoryW(lpBuffer, uSize);
55*c45a6e15SJames Tabor   if ( length && length < uSize )
56*c45a6e15SJames Tabor   {
57*c45a6e15SJames Tabor     StringCchCatW(Safe, uSize, L"\\");
58*c45a6e15SJames Tabor     return StringCchCatW(Safe, uSize, L"imm32.dll");
59*c45a6e15SJames Tabor   }
60*c45a6e15SJames Tabor   return StringCchCopyW(Safe, uSize, L"imm32.dll");
61*c45a6e15SJames Tabor }
62*c45a6e15SJames Tabor 
63c2c66affSColin Finck /*
64c2c66affSColin Finck  * @unimplemented
65c2c66affSColin Finck  */
66c2c66affSColin Finck BOOL WINAPI IntInitializeImmEntryTable(VOID)
67c2c66affSColin Finck {
68c2c66affSColin Finck     WCHAR ImmFile[MAX_PATH];
69c2c66affSColin Finck     HMODULE imm32 = ghImm32;
70c2c66affSColin Finck 
71c2c66affSColin Finck     if (gImmApiEntries.pImmIsIME != 0)
72c2c66affSColin Finck     {
73c2c66affSColin Finck        ERR("Imm Api Table Init 1\n");
74c2c66affSColin Finck        return TRUE;
75c2c66affSColin Finck     }
76c2c66affSColin Finck 
77c2c66affSColin Finck     GetImmFileName(ImmFile, sizeof(ImmFile));
78c2c66affSColin Finck     TRACE("File %ws\n",ImmFile);
79c2c66affSColin Finck 
80c2c66affSColin Finck     if (imm32 == NULL)
81c2c66affSColin Finck     {
82c2c66affSColin Finck        imm32 = GetModuleHandleW(ImmFile);
83c2c66affSColin Finck     }
84c2c66affSColin Finck 
85c2c66affSColin Finck     if (imm32 == NULL)
86c2c66affSColin Finck     {
87c2c66affSColin Finck         imm32 = ghImm32 = LoadLibraryW(ImmFile);
88c2c66affSColin Finck         if (imm32 == NULL)
89c2c66affSColin Finck         {
90c2c66affSColin Finck            ERR("Did not load!\n");
91c2c66affSColin Finck            return FALSE;
92c2c66affSColin Finck         }
93c2c66affSColin Finck         return TRUE;
94c2c66affSColin Finck     }
95c2c66affSColin Finck 
96c2c66affSColin Finck     if (ImmApiTableZero)
97c2c66affSColin Finck     {
98c2c66affSColin Finck        ImmApiTableZero = FALSE;
99c2c66affSColin Finck        ZeroMemory(&gImmApiEntries, sizeof(Imm32ApiTable));
100c2c66affSColin Finck     }
101c2c66affSColin Finck 
102c2c66affSColin Finck     gImmApiEntries.pImmIsIME = (BOOL (WINAPI*)(HKL)) GetProcAddress(imm32, "ImmIsIME");
103c2c66affSColin Finck     if (!gImmApiEntries.pImmIsIME)
104c2c66affSColin Finck         gImmApiEntries.pImmIsIME = IMM_ImmIsIME;
105c2c66affSColin Finck 
106c2c66affSColin Finck     gImmApiEntries.pImmEscapeA = (LRESULT (WINAPI*)(HKL, HIMC, UINT, LPVOID)) GetProcAddress(imm32, "ImmEscapeA");
107c2c66affSColin Finck     if (!gImmApiEntries.pImmEscapeA)
108c2c66affSColin Finck         gImmApiEntries.pImmEscapeA = IMM_ImmEscapeAW;
109c2c66affSColin Finck 
110c2c66affSColin Finck     gImmApiEntries.pImmEscapeW = (LRESULT (WINAPI*)(HKL, HIMC, UINT, LPVOID)) GetProcAddress(imm32, "ImmEscapeW");
111c2c66affSColin Finck     if (!gImmApiEntries.pImmEscapeW)
112c2c66affSColin Finck         gImmApiEntries.pImmEscapeW = IMM_ImmEscapeAW;
113c2c66affSColin Finck 
114c2c66affSColin Finck     gImmApiEntries.pImmGetCompositionStringA = (LONG (WINAPI*)(HIMC, DWORD, LPVOID, DWORD)) GetProcAddress(imm32, "ImmGetCompositionStringA");
115c2c66affSColin Finck     if (!gImmApiEntries.pImmGetCompositionStringA)
116c2c66affSColin Finck         gImmApiEntries.pImmGetCompositionStringA = IMM_ImmGetCompositionStringAW;
117c2c66affSColin Finck 
118c2c66affSColin Finck     gImmApiEntries.pImmGetCompositionStringW = (LONG (WINAPI*)(HIMC, DWORD, LPVOID, DWORD)) GetProcAddress(imm32, "ImmGetCompositionStringW");
119c2c66affSColin Finck     if (!gImmApiEntries.pImmGetCompositionStringW)
120c2c66affSColin Finck         gImmApiEntries.pImmGetCompositionStringW = IMM_ImmGetCompositionStringAW;
121c2c66affSColin Finck 
122c2c66affSColin Finck     gImmApiEntries.pImmGetCompositionFontA = (BOOL (WINAPI*)(HIMC, LPLOGFONTA)) GetProcAddress(imm32, "ImmGetCompositionFontA");
123c2c66affSColin Finck     if (!gImmApiEntries.pImmGetCompositionFontA)
124c2c66affSColin Finck         gImmApiEntries.pImmGetCompositionFontA = IMM_ImmGetCompositionFontA;
125c2c66affSColin Finck 
126c2c66affSColin Finck     gImmApiEntries.pImmGetCompositionFontW = (BOOL (WINAPI*)(HIMC, LPLOGFONTW)) GetProcAddress(imm32, "ImmGetCompositionFontW");
127c2c66affSColin Finck     if (!gImmApiEntries.pImmGetCompositionFontW)
128c2c66affSColin Finck         gImmApiEntries.pImmGetCompositionFontW = IMM_ImmGetCompositionFontW;
129c2c66affSColin Finck 
130c2c66affSColin Finck     gImmApiEntries.pImmSetCompositionFontA = (BOOL (WINAPI*)(HIMC, LPLOGFONTA)) GetProcAddress(imm32, "ImmSetCompositionFontA");
131c2c66affSColin Finck     if (!gImmApiEntries.pImmSetCompositionFontA)
132c2c66affSColin Finck         gImmApiEntries.pImmSetCompositionFontA = IMM_ImmSetCompositionFontA;
133c2c66affSColin Finck 
134c2c66affSColin Finck     gImmApiEntries.pImmSetCompositionFontW = (BOOL (WINAPI*)(HIMC, LPLOGFONTW)) GetProcAddress(imm32, "ImmSetCompositionFontW");
135c2c66affSColin Finck     if (!gImmApiEntries.pImmSetCompositionFontW)
136c2c66affSColin Finck         gImmApiEntries.pImmSetCompositionFontW = IMM_ImmSetCompositionFontW;
137c2c66affSColin Finck 
138c2c66affSColin Finck     gImmApiEntries.pImmGetCompositionWindow = (BOOL (WINAPI*)(HIMC, LPCOMPOSITIONFORM)) GetProcAddress(imm32, "ImmGetCompositionWindow");
139c2c66affSColin Finck     if (!gImmApiEntries.pImmGetCompositionWindow)
140c2c66affSColin Finck         gImmApiEntries.pImmGetCompositionWindow = IMM_ImmSetGetCompositionWindow;
141c2c66affSColin Finck 
142c2c66affSColin Finck     gImmApiEntries.pImmSetCompositionWindow = (BOOL (WINAPI*)(HIMC, LPCOMPOSITIONFORM)) GetProcAddress(imm32, "ImmSetCompositionWindow");
143c2c66affSColin Finck     if (!gImmApiEntries.pImmSetCompositionWindow)
144c2c66affSColin Finck         gImmApiEntries.pImmSetCompositionWindow = IMM_ImmSetGetCompositionWindow;
145c2c66affSColin Finck 
146c2c66affSColin Finck     gImmApiEntries.pImmAssociateContext = (HIMC (WINAPI*)(HWND, HIMC)) GetProcAddress(imm32, "ImmAssociateContext");
147c2c66affSColin Finck     if (!gImmApiEntries.pImmAssociateContext)
148c2c66affSColin Finck         gImmApiEntries.pImmAssociateContext = IMM_ImmAssociateContext;
149c2c66affSColin Finck 
150c2c66affSColin Finck     gImmApiEntries.pImmReleaseContext = (BOOL (WINAPI*)(HWND, HIMC)) GetProcAddress(imm32, "ImmReleaseContext");
151c2c66affSColin Finck     if (!gImmApiEntries.pImmReleaseContext)
152c2c66affSColin Finck         gImmApiEntries.pImmReleaseContext = IMM_ImmReleaseContext;
153c2c66affSColin Finck 
154c2c66affSColin Finck     gImmApiEntries.pImmGetContext = (HIMC (WINAPI*)(HWND)) GetProcAddress(imm32, "ImmGetContext");
155c2c66affSColin Finck     if (!gImmApiEntries.pImmGetContext)
156c2c66affSColin Finck         gImmApiEntries.pImmGetContext = IMM_ImmGetContext;
157c2c66affSColin Finck 
158c2c66affSColin Finck     gImmApiEntries.pImmGetDefaultIMEWnd = (HWND (WINAPI*)(HWND)) GetProcAddress(imm32, "ImmGetDefaultIMEWnd");
159c2c66affSColin Finck     if (!gImmApiEntries.pImmGetDefaultIMEWnd)
160c2c66affSColin Finck         gImmApiEntries.pImmGetDefaultIMEWnd = IMM_ImmGetDefaultIMEWnd;
161c2c66affSColin Finck 
162c2c66affSColin Finck     gImmApiEntries.pImmNotifyIME = (BOOL (WINAPI*)(HIMC, DWORD, DWORD, DWORD)) GetProcAddress(imm32, "ImmNotifyIME");
163c2c66affSColin Finck     if (!gImmApiEntries.pImmNotifyIME)
164c2c66affSColin Finck         gImmApiEntries.pImmNotifyIME = IMM_ImmNotifyIME;
165c2c66affSColin Finck 
166c2c66affSColin Finck     /*
167c2c66affSColin Finck      *  TODO: Load more functions from imm32.dll
168c2c66affSColin Finck      *  Function like IMPSetIMEW, IMPQueryIMEW etc. call functions
169c2c66affSColin Finck      *  from imm32.dll through pointers in the structure gImmApiEntries.
170c2c66affSColin Finck      *  I do not know whether it is necessary to initialize a table
171c2c66affSColin Finck      *  of functions to load user32 (DLL_PROCESS_ATTACH)
172c2c66affSColin Finck      */
173c2c66affSColin Finck 
174c2c66affSColin Finck     gImmApiEntries.pImmRegisterClient = (BOOL (WINAPI*)(PVOID, HINSTANCE)) GetProcAddress(imm32, "ImmRegisterClient");
175c2c66affSColin Finck     if (!gImmApiEntries.pImmRegisterClient)
176c2c66affSColin Finck         gImmApiEntries.pImmRegisterClient = IMM_ImmRegisterClient;
177c2c66affSColin Finck 
178c2c66affSColin Finck     gImmApiEntries.pImmProcessKey = (UINT (WINAPI*)(HWND, HKL, UINT, LPARAM, DWORD)) GetProcAddress(imm32, "ImmProcessKey");
179c2c66affSColin Finck     if (!gImmApiEntries.pImmProcessKey)
180c2c66affSColin Finck         gImmApiEntries.pImmProcessKey = IMM_ImmProcessKey;
181c2c66affSColin Finck 
182c2c66affSColin Finck     return TRUE;
183c2c66affSColin Finck }
184c2c66affSColin Finck 
185c2c66affSColin Finck BOOL WINAPI InitializeImmEntryTable(VOID)
186c2c66affSColin Finck {
187c2c66affSColin Finck   bImmInitializing = TRUE;
188c2c66affSColin Finck   return IntInitializeImmEntryTable();
189c2c66affSColin Finck }
190c2c66affSColin Finck 
191c2c66affSColin Finck BOOL WINAPI User32InitializeImmEntryTable(DWORD magic)
192c2c66affSColin Finck {
193*c45a6e15SJames Tabor     TRACE("Imm (%x)\n", magic);
194c2c66affSColin Finck 
195c2c66affSColin Finck     if (magic != IMM_INIT_MAGIC)
196c2c66affSColin Finck         return FALSE;
197c2c66affSColin Finck 
198c2c66affSColin Finck     if (gImmApiEntries.pImmIsIME != 0)
199c2c66affSColin Finck     {
200c2c66affSColin Finck        ERR("Imm Api Table Init 2\n");
201c2c66affSColin Finck        return TRUE;
202c2c66affSColin Finck     }
203c2c66affSColin Finck 
204c2c66affSColin Finck     IntInitializeImmEntryTable();
205c2c66affSColin Finck 
206c2c66affSColin Finck     if (ghImm32 == NULL && !bImmInitializing)
207c2c66affSColin Finck     {
208c2c66affSColin Finck        WCHAR ImmFile[MAX_PATH];
209c2c66affSColin Finck        GetImmFileName(ImmFile, sizeof(ImmFile));
210c2c66affSColin Finck        ghImm32 = LoadLibraryW(ImmFile);
211c2c66affSColin Finck        if (ghImm32 == NULL)
212c2c66affSColin Finck        {
213c2c66affSColin Finck           ERR("Did not load! 2\n");
214c2c66affSColin Finck           return FALSE;
215c2c66affSColin Finck        }
216c2c66affSColin Finck     }
217c2c66affSColin Finck #if 0 // For real Imm32.dll testing!!!!
218c2c66affSColin Finck     if (ghImm32 && !gImmApiEntries.pImmRegisterClient(&gSharedInfo, ghImm32))
219c2c66affSColin Finck     {
220c2c66affSColin Finck        ERR("Wine is stubed!\n");
221c2c66affSColin Finck     }
222c2c66affSColin Finck #endif
223c2c66affSColin Finck     return TRUE;
224c2c66affSColin Finck }
225c2c66affSColin Finck 
226c2c66affSColin Finck LRESULT WINAPI ImeWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode ) // ReactOS
227c2c66affSColin Finck {
228c2c66affSColin Finck     PWND pWnd;
229c2c66affSColin Finck     PIMEUI pimeui;
230c2c66affSColin Finck 
231c2c66affSColin Finck     pWnd = ValidateHwnd(hwnd);
232c2c66affSColin Finck     if (pWnd)
233c2c66affSColin Finck     {
234c2c66affSColin Finck        if (!pWnd->fnid)
235c2c66affSColin Finck        {
236c2c66affSColin Finck           if (msg != WM_NCCREATE)
237c2c66affSColin Finck           {
238c2c66affSColin Finck              if (unicode)
239c2c66affSColin Finck                 return DefWindowProcW(hwnd, msg, wParam, lParam);
240c2c66affSColin Finck              return DefWindowProcA(hwnd, msg, wParam, lParam);
241c2c66affSColin Finck           }
242c2c66affSColin Finck           NtUserSetWindowFNID(hwnd, FNID_IME);
243c2c66affSColin Finck           pimeui = HeapAlloc( GetProcessHeap(), 0, sizeof(IMEUI) );
244c2c66affSColin Finck           SetWindowLongPtrW(hwnd, 0, (LONG_PTR)pimeui);
245c2c66affSColin Finck        }
246c2c66affSColin Finck        else
247c2c66affSColin Finck        {
248c2c66affSColin Finck           if (pWnd->fnid != FNID_IME)
249c2c66affSColin Finck           {
250c2c66affSColin Finck              ERR("Wrong window class for Ime! fnId 0x%x\n",pWnd->fnid);
251c2c66affSColin Finck              return 0;
252c2c66affSColin Finck           }
253c2c66affSColin Finck           pimeui = ((PIMEWND)pWnd)->pimeui;
254c2c66affSColin Finck           if (pimeui == NULL)
255c2c66affSColin Finck           {
256c2c66affSColin Finck              ERR("Window is not set to IME!\n");
257c2c66affSColin Finck              return 0;
258c2c66affSColin Finck           }
259c2c66affSColin Finck        }
260c2c66affSColin Finck     }
261c2c66affSColin Finck 
262c2c66affSColin Finck     if (msg==WM_CREATE || msg==WM_NCCREATE)
263c2c66affSColin Finck         return TRUE;
264c2c66affSColin Finck 
265c2c66affSColin Finck     if (msg==WM_NCDESTROY)
266c2c66affSColin Finck     {
267c2c66affSColin Finck         HeapFree( GetProcessHeap(), 0, pimeui );
268c2c66affSColin Finck         SetWindowLongPtrW(hwnd, 0, 0);
269c2c66affSColin Finck         NtUserSetWindowFNID(hwnd, FNID_DESTROY);
270c2c66affSColin Finck     }
271c2c66affSColin Finck 
272c2c66affSColin Finck     if (unicode)
273c2c66affSColin Finck        return DefWindowProcW(hwnd, msg, wParam, lParam);
274c2c66affSColin Finck     return DefWindowProcA(hwnd, msg, wParam, lParam);
275c2c66affSColin Finck }
276c2c66affSColin Finck 
277c2c66affSColin Finck LRESULT WINAPI ImeWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
278c2c66affSColin Finck {
279c2c66affSColin Finck     return ImeWndProc_common(hwnd, msg, wParam, lParam, FALSE);
280c2c66affSColin Finck }
281c2c66affSColin Finck 
282c2c66affSColin Finck LRESULT WINAPI ImeWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
283c2c66affSColin Finck {
284c2c66affSColin Finck     return ImeWndProc_common(hwnd, msg, wParam, lParam, TRUE);
285c2c66affSColin Finck }
286c2c66affSColin Finck 
287*c45a6e15SJames Tabor BOOL
288*c45a6e15SJames Tabor WINAPI
289*c45a6e15SJames Tabor UpdatePerUserImmEnabling(VOID)
290*c45a6e15SJames Tabor {
291*c45a6e15SJames Tabor   BOOL Ret = NtUserCallNoParam(NOPARAM_ROUTINE_UPDATEPERUSERIMMENABLING);
292*c45a6e15SJames Tabor   if ( Ret )
293*c45a6e15SJames Tabor   {
294*c45a6e15SJames Tabor     if ( gpsi->dwSRVIFlags & SRVINFO_IMM32 )
295*c45a6e15SJames Tabor     {
296*c45a6e15SJames Tabor       HMODULE imm32 = GetModuleHandleW(L"imm32.dll");
297*c45a6e15SJames Tabor       if ( !imm32 )
298*c45a6e15SJames Tabor       {
299*c45a6e15SJames Tabor         imm32 = LoadLibraryW(L"imm32.dll");
300*c45a6e15SJames Tabor         if (!imm32)
301*c45a6e15SJames Tabor         {
302*c45a6e15SJames Tabor            ERR("UPUIE: Imm32 not installed!\n");
303*c45a6e15SJames Tabor            Ret = FALSE;
304*c45a6e15SJames Tabor         }
305*c45a6e15SJames Tabor       }
306*c45a6e15SJames Tabor     }
307*c45a6e15SJames Tabor   }
308*c45a6e15SJames Tabor   return Ret;
309*c45a6e15SJames Tabor }
310*c45a6e15SJames Tabor 
311c2c66affSColin Finck static const WCHAR imeW[] = {'I','M','E',0};
312c2c66affSColin Finck 
313c2c66affSColin Finck BOOL
314c2c66affSColin Finck WINAPI
315c2c66affSColin Finck RegisterIMEClass(VOID)
316c2c66affSColin Finck {
317c2c66affSColin Finck     WNDCLASSEXW WndClass;
318c2c66affSColin Finck     ATOM atom;
319c2c66affSColin Finck 
320c2c66affSColin Finck     ZeroMemory(&WndClass, sizeof(WndClass));
321c2c66affSColin Finck 
322c2c66affSColin Finck     WndClass.cbSize = sizeof(WndClass);
323c2c66affSColin Finck     WndClass.lpszClassName = imeW;
324c2c66affSColin Finck     WndClass.style = CS_GLOBALCLASS;
325c2c66affSColin Finck     WndClass.lpfnWndProc = ImeWndProcW;
326c2c66affSColin Finck     WndClass.cbWndExtra = sizeof(LONG_PTR);
327c2c66affSColin Finck     WndClass.hCursor = LoadCursorW(NULL, IDC_ARROW);
328c2c66affSColin Finck 
329c2c66affSColin Finck     atom = RegisterClassExWOWW( &WndClass,
330c2c66affSColin Finck                                  0,
331c2c66affSColin Finck                                  FNID_IME,
332c2c66affSColin Finck                                  0,
333c2c66affSColin Finck                                  FALSE);
334c2c66affSColin Finck     if (atom)
335c2c66affSColin Finck     {
336c2c66affSColin Finck        RegisterDefaultClasses |= ICLASS_TO_MASK(ICLS_IME);
337*c45a6e15SJames Tabor        TRACE("Register IME Class!\n");
338c2c66affSColin Finck        return TRUE;
339c2c66affSColin Finck     }
340c2c66affSColin Finck     ERR("Failed to register IME Class!\n");
341c2c66affSColin Finck     return FALSE;
342c2c66affSColin Finck }
343c2c66affSColin Finck 
344c2c66affSColin Finck /*
345c2c66affSColin Finck  * @unimplemented
346c2c66affSColin Finck  */
347c2c66affSColin Finck BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKl)
348c2c66affSColin Finck {
349c2c66affSColin Finck   UNIMPLEMENTED;
350c2c66affSColin Finck   return FALSE;
351c2c66affSColin Finck }
352c2c66affSColin Finck 
353c2c66affSColin Finck /*
354c2c66affSColin Finck  * @unimplemented
355c2c66affSColin Finck  */
356c2c66affSColin Finck BOOL
357c2c66affSColin Finck WINAPI
358c2c66affSColin Finck IMPSetIMEW(HWND hwnd, LPIMEPROW ime)
359c2c66affSColin Finck {
360c2c66affSColin Finck     UNIMPLEMENTED;
361c2c66affSColin Finck     return FALSE;
362c2c66affSColin Finck }
363c2c66affSColin Finck 
364c2c66affSColin Finck /*
365c2c66affSColin Finck  * @unimplemented
366c2c66affSColin Finck  */
367c2c66affSColin Finck BOOL
368c2c66affSColin Finck WINAPI
369c2c66affSColin Finck IMPQueryIMEW(LPIMEPROW ime)
370c2c66affSColin Finck {
371c2c66affSColin Finck     UNIMPLEMENTED;
372c2c66affSColin Finck     return FALSE;
373c2c66affSColin Finck }
374c2c66affSColin Finck 
375c2c66affSColin Finck /*
376c2c66affSColin Finck  * @unimplemented
377c2c66affSColin Finck  */
378c2c66affSColin Finck BOOL
379c2c66affSColin Finck WINAPI
380c2c66affSColin Finck IMPGetIMEW(HWND hwnd, LPIMEPROW ime)
381c2c66affSColin Finck {
382c2c66affSColin Finck     UNIMPLEMENTED;
383c2c66affSColin Finck     return FALSE;
384c2c66affSColin Finck }
385c2c66affSColin Finck 
386c2c66affSColin Finck /*
387c2c66affSColin Finck  * @unimplemented
388c2c66affSColin Finck  */
389c2c66affSColin Finck BOOL
390c2c66affSColin Finck WINAPI
391c2c66affSColin Finck IMPSetIMEA(HWND hwnd, LPIMEPROA ime)
392c2c66affSColin Finck {
393c2c66affSColin Finck     UNIMPLEMENTED;
394c2c66affSColin Finck     return FALSE;
395c2c66affSColin Finck }
396c2c66affSColin Finck 
397c2c66affSColin Finck /*
398c2c66affSColin Finck  * @unimplemented
399c2c66affSColin Finck  */
400c2c66affSColin Finck BOOL
401c2c66affSColin Finck WINAPI
402c2c66affSColin Finck IMPQueryIMEA(LPIMEPROA ime)
403c2c66affSColin Finck {
404c2c66affSColin Finck     UNIMPLEMENTED;
405c2c66affSColin Finck     return FALSE;
406c2c66affSColin Finck }
407c2c66affSColin Finck 
408c2c66affSColin Finck /*
409c2c66affSColin Finck  * @unimplemented
410c2c66affSColin Finck  */
411c2c66affSColin Finck BOOL
412c2c66affSColin Finck WINAPI
413c2c66affSColin Finck IMPGetIMEA(HWND hwnd, LPIMEPROA ime)
414c2c66affSColin Finck {
415c2c66affSColin Finck     UNIMPLEMENTED;
416c2c66affSColin Finck     return FALSE;
417c2c66affSColin Finck }
418c2c66affSColin Finck 
419c2c66affSColin Finck /*
420c2c66affSColin Finck  * @unimplemented
421c2c66affSColin Finck  */
422c2c66affSColin Finck LRESULT
423c2c66affSColin Finck WINAPI
424c2c66affSColin Finck SendIMEMessageExW(HWND hwnd, LPARAM lparam)
425c2c66affSColin Finck {
426c2c66affSColin Finck     UNIMPLEMENTED;
427c2c66affSColin Finck     return FALSE;
428c2c66affSColin Finck }
429c2c66affSColin Finck 
430c2c66affSColin Finck /*
431c2c66affSColin Finck  * @unimplemented
432c2c66affSColin Finck  */
433c2c66affSColin Finck LRESULT
434c2c66affSColin Finck WINAPI
435c2c66affSColin Finck SendIMEMessageExA(HWND hwnd, LPARAM lparam)
436c2c66affSColin Finck {
437c2c66affSColin Finck     UNIMPLEMENTED;
438c2c66affSColin Finck     return FALSE;
439c2c66affSColin Finck }
440c2c66affSColin Finck 
441c2c66affSColin Finck /*
442c2c66affSColin Finck  * @unimplemented
443c2c66affSColin Finck  */
444c2c66affSColin Finck BOOL
445c2c66affSColin Finck WINAPI
446c2c66affSColin Finck WINNLSEnableIME(HWND hwnd, BOOL enable)
447c2c66affSColin Finck {
448c2c66affSColin Finck     UNIMPLEMENTED;
449c2c66affSColin Finck     return FALSE;
450c2c66affSColin Finck }
451c2c66affSColin Finck 
452c2c66affSColin Finck /*
453c2c66affSColin Finck  * @unimplemented
454c2c66affSColin Finck  */
455c2c66affSColin Finck BOOL
456c2c66affSColin Finck WINAPI
457c2c66affSColin Finck WINNLSGetEnableStatus(HWND hwnd)
458c2c66affSColin Finck {
459c2c66affSColin Finck     UNIMPLEMENTED;
460c2c66affSColin Finck     return FALSE;
461c2c66affSColin Finck }
462c2c66affSColin Finck 
463c2c66affSColin Finck /*
464c2c66affSColin Finck  * @implemented
465c2c66affSColin Finck  */
466c2c66affSColin Finck UINT
467c2c66affSColin Finck WINAPI
468c2c66affSColin Finck WINNLSGetIMEHotkey(HWND hwnd)
469c2c66affSColin Finck {
470c2c66affSColin Finck     return FALSE;
471c2c66affSColin Finck }
472