user32: Move monitor functions to sysparams.c.
[wine.git] / dlls / user32 / misc.c
blobd28cd9fd055cd20699c7727d781b1587e2d4880e
1 /*
2 * Misc USER functions
4 * Copyright 1995 Thomas Sandford
5 * Copyright 1997 Marcus Meissner
6 * Copyright 1998 Turchanov Sergey
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "config.h"
25 #include <stdarg.h>
27 #include "windef.h"
28 #include "wine/windef16.h"
29 #include "winbase.h"
30 #include "wingdi.h"
31 #include "winuser.h"
32 #include "winnls.h"
33 #include "winternl.h"
34 #include "controls.h"
35 #include "user_private.h"
37 #include "wine/unicode.h"
38 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(win);
42 #define IMM_INIT_MAGIC 0x19650412
43 static HWND (WINAPI *imm_get_ui_window)(HKL);
44 BOOL (WINAPI *imm_register_window)(HWND) = NULL;
45 void (WINAPI *imm_unregister_window)(HWND) = NULL;
47 /* MSIME messages */
48 static UINT WM_MSIME_SERVICE;
49 static UINT WM_MSIME_RECONVERTOPTIONS;
50 static UINT WM_MSIME_MOUSE;
51 static UINT WM_MSIME_RECONVERTREQUEST;
52 static UINT WM_MSIME_RECONVERT;
53 static UINT WM_MSIME_QUERYPOSITION;
54 static UINT WM_MSIME_DOCUMENTFEED;
56 /* USER signal proc flags and codes */
57 /* See UserSignalProc for comments */
58 #define USIG_FLAGS_WIN32 0x0001
59 #define USIG_FLAGS_GUI 0x0002
60 #define USIG_FLAGS_FEEDBACK 0x0004
61 #define USIG_FLAGS_FAULT 0x0008
63 #define USIG_DLL_UNLOAD_WIN16 0x0001
64 #define USIG_DLL_UNLOAD_WIN32 0x0002
65 #define USIG_FAULT_DIALOG_PUSH 0x0003
66 #define USIG_FAULT_DIALOG_POP 0x0004
67 #define USIG_DLL_UNLOAD_ORPHANS 0x0005
68 #define USIG_THREAD_INIT 0x0010
69 #define USIG_THREAD_EXIT 0x0020
70 #define USIG_PROCESS_CREATE 0x0100
71 #define USIG_PROCESS_INIT 0x0200
72 #define USIG_PROCESS_EXIT 0x0300
73 #define USIG_PROCESS_DESTROY 0x0400
74 #define USIG_PROCESS_RUNNING 0x0500
75 #define USIG_PROCESS_LOADED 0x0600
77 /***********************************************************************
78 * SignalProc32 (USER.391)
79 * UserSignalProc (USER32.@)
81 * The exact meaning of the USER signals is undocumented, but this
82 * should cover the basic idea:
84 * USIG_DLL_UNLOAD_WIN16
85 * This is sent when a 16-bit module is unloaded.
87 * USIG_DLL_UNLOAD_WIN32
88 * This is sent when a 32-bit module is unloaded.
90 * USIG_DLL_UNLOAD_ORPHANS
91 * This is sent after the last Win3.1 module is unloaded,
92 * to allow removal of orphaned menus.
94 * USIG_FAULT_DIALOG_PUSH
95 * USIG_FAULT_DIALOG_POP
96 * These are called to allow USER to prepare for displaying a
97 * fault dialog, even though the fault might have happened while
98 * inside a USER critical section.
100 * USIG_THREAD_INIT
101 * This is called from the context of a new thread, as soon as it
102 * has started to run.
104 * USIG_THREAD_EXIT
105 * This is called, still in its context, just before a thread is
106 * about to terminate.
108 * USIG_PROCESS_CREATE
109 * This is called, in the parent process context, after a new process
110 * has been created.
112 * USIG_PROCESS_INIT
113 * This is called in the new process context, just after the main thread
114 * has started execution (after the main thread's USIG_THREAD_INIT has
115 * been sent).
117 * USIG_PROCESS_LOADED
118 * This is called after the executable file has been loaded into the
119 * new process context.
121 * USIG_PROCESS_RUNNING
122 * This is called immediately before the main entry point is called.
124 * USIG_PROCESS_EXIT
125 * This is called in the context of a process that is about to
126 * terminate (but before the last thread's USIG_THREAD_EXIT has
127 * been sent).
129 * USIG_PROCESS_DESTROY
130 * This is called after a process has terminated.
133 * The meaning of the dwFlags bits is as follows:
135 * USIG_FLAGS_WIN32
136 * Current process is 32-bit.
138 * USIG_FLAGS_GUI
139 * Current process is a (Win32) GUI process.
141 * USIG_FLAGS_FEEDBACK
142 * Current process needs 'feedback' (determined from the STARTUPINFO
143 * flags STARTF_FORCEONFEEDBACK / STARTF_FORCEOFFFEEDBACK).
145 * USIG_FLAGS_FAULT
146 * The signal is being sent due to a fault.
148 WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID,
149 DWORD dwFlags, HMODULE16 hModule )
151 FIXME("(%04x, %08x, %04x, %04x)\n",
152 uCode, dwThreadOrProcessID, dwFlags, hModule );
153 /* FIXME: Should chain to GdiSignalProc now. */
154 return 0;
158 /**********************************************************************
159 * SetLastErrorEx [USER32.@]
161 * Sets the last-error code.
163 * RETURNS
164 * None.
166 void WINAPI SetLastErrorEx(
167 DWORD error, /* [in] Per-thread error code */
168 DWORD type) /* [in] Error type */
170 TRACE("(0x%08x, 0x%08x)\n", error,type);
171 switch(type) {
172 case 0:
173 break;
174 case SLE_ERROR:
175 case SLE_MINORERROR:
176 case SLE_WARNING:
177 /* Fall through for now */
178 default:
179 FIXME("(error=%08x, type=%08x): Unhandled type\n", error,type);
180 break;
182 SetLastError( error );
185 /******************************************************************************
186 * GetAltTabInfoA [USER32.@]
188 BOOL WINAPI GetAltTabInfoA(HWND hwnd, int iItem, PALTTABINFO pati, LPSTR pszItemText, UINT cchItemText)
190 FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd, iItem, pati, pszItemText, cchItemText);
191 return FALSE;
194 /******************************************************************************
195 * GetAltTabInfoW [USER32.@]
197 BOOL WINAPI GetAltTabInfoW(HWND hwnd, int iItem, PALTTABINFO pati, LPWSTR pszItemText, UINT cchItemText)
199 FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd, iItem, pati, pszItemText, cchItemText);
200 return FALSE;
203 /******************************************************************************
204 * SetDebugErrorLevel [USER32.@]
205 * Sets the minimum error level for generating debugging events
207 * PARAMS
208 * dwLevel [I] Debugging error level
210 * RETURNS
211 * Nothing.
213 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
215 FIXME("(%d): stub\n", dwLevel);
219 /***********************************************************************
220 * SetWindowStationUser (USER32.@)
222 DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2)
224 FIXME("(0x%08x,0x%08x),stub!\n",x1,x2);
225 return 1;
228 /***********************************************************************
229 * RegisterLogonProcess (USER32.@)
231 DWORD WINAPI RegisterLogonProcess(HANDLE hprocess,BOOL x)
233 FIXME("(%p,%d),stub!\n",hprocess,x);
234 return 1;
237 /***********************************************************************
238 * SetLogonNotifyWindow (USER32.@)
240 DWORD WINAPI SetLogonNotifyWindow(HWINSTA hwinsta,HWND hwnd)
242 FIXME("(%p,%p),stub!\n",hwinsta,hwnd);
243 return 1;
246 static const WCHAR primary_device_name[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
247 static const WCHAR primary_device_string[] = {'X','1','1',' ','W','i','n','d','o','w','i','n','g',' ',
248 'S','y','s','t','e','m',0};
249 static const WCHAR primary_device_deviceid[] = {'P','C','I','\\','V','E','N','_','0','0','0','0','&',
250 'D','E','V','_','0','0','0','0',0};
252 /***********************************************************************
253 * EnumDisplayDevicesA (USER32.@)
255 BOOL WINAPI EnumDisplayDevicesA( LPCSTR lpDevice, DWORD i, LPDISPLAY_DEVICEA lpDispDev,
256 DWORD dwFlags )
258 UNICODE_STRING deviceW;
259 DISPLAY_DEVICEW ddW;
260 BOOL ret;
262 if(lpDevice)
263 RtlCreateUnicodeStringFromAsciiz(&deviceW, lpDevice);
264 else
265 deviceW.Buffer = NULL;
267 ddW.cb = sizeof(ddW);
268 ret = EnumDisplayDevicesW(deviceW.Buffer, i, &ddW, dwFlags);
269 RtlFreeUnicodeString(&deviceW);
271 if(!ret) return ret;
273 WideCharToMultiByte(CP_ACP, 0, ddW.DeviceName, -1, lpDispDev->DeviceName, sizeof(lpDispDev->DeviceName), NULL, NULL);
274 WideCharToMultiByte(CP_ACP, 0, ddW.DeviceString, -1, lpDispDev->DeviceString, sizeof(lpDispDev->DeviceString), NULL, NULL);
275 lpDispDev->StateFlags = ddW.StateFlags;
277 if(lpDispDev->cb >= offsetof(DISPLAY_DEVICEA, DeviceID) + sizeof(lpDispDev->DeviceID))
278 WideCharToMultiByte(CP_ACP, 0, ddW.DeviceID, -1, lpDispDev->DeviceID, sizeof(lpDispDev->DeviceID), NULL, NULL);
279 if(lpDispDev->cb >= offsetof(DISPLAY_DEVICEA, DeviceKey) + sizeof(lpDispDev->DeviceKey))
280 WideCharToMultiByte(CP_ACP, 0, ddW.DeviceKey, -1, lpDispDev->DeviceKey, sizeof(lpDispDev->DeviceKey), NULL, NULL);
282 return TRUE;
285 /***********************************************************************
286 * EnumDisplayDevicesW (USER32.@)
288 BOOL WINAPI EnumDisplayDevicesW( LPCWSTR lpDevice, DWORD i, LPDISPLAY_DEVICEW lpDisplayDevice,
289 DWORD dwFlags )
291 FIXME("(%s,%d,%p,0x%08x), stub!\n",debugstr_w(lpDevice),i,lpDisplayDevice,dwFlags);
293 if (i)
294 return FALSE;
296 memcpy(lpDisplayDevice->DeviceName, primary_device_name, sizeof(primary_device_name));
297 memcpy(lpDisplayDevice->DeviceString, primary_device_string, sizeof(primary_device_string));
299 lpDisplayDevice->StateFlags =
300 DISPLAY_DEVICE_ATTACHED_TO_DESKTOP |
301 DISPLAY_DEVICE_PRIMARY_DEVICE |
302 DISPLAY_DEVICE_VGA_COMPATIBLE;
304 if(lpDisplayDevice->cb >= offsetof(DISPLAY_DEVICEW, DeviceID) + sizeof(lpDisplayDevice->DeviceID))
305 memcpy(lpDisplayDevice->DeviceID, primary_device_deviceid, sizeof(primary_device_deviceid));
306 if(lpDisplayDevice->cb >= offsetof(DISPLAY_DEVICEW, DeviceKey) + sizeof(lpDisplayDevice->DeviceKey))
307 lpDisplayDevice->DeviceKey[0] = 0;
309 return TRUE;
312 /***********************************************************************
313 * QueryDisplayConfig (USER32.@)
315 LONG WINAPI QueryDisplayConfig(UINT32 flags, UINT32 *numpathelements, DISPLAYCONFIG_PATH_INFO *pathinfo,
316 UINT32 *numinfoelements, DISPLAYCONFIG_MODE_INFO *modeinfo,
317 DISPLAYCONFIG_TOPOLOGY_ID *topologyid)
319 FIXME("(%08x %p %p %p %p %p)\n", flags, numpathelements, pathinfo, numinfoelements, modeinfo, topologyid);
320 return ERROR_CALL_NOT_IMPLEMENTED;
323 /***********************************************************************
324 * RegisterSystemThread (USER32.@)
326 void WINAPI RegisterSystemThread(DWORD flags, DWORD reserved)
328 FIXME("(%08x, %08x)\n", flags, reserved);
331 /***********************************************************************
332 * RegisterShellHookWindow [USER32.@]
334 BOOL WINAPI RegisterShellHookWindow(HWND hWnd)
336 FIXME("(%p): stub\n", hWnd);
337 return FALSE;
341 /***********************************************************************
342 * DeregisterShellHookWindow [USER32.@]
344 BOOL WINAPI DeregisterShellHookWindow(HWND hWnd)
346 FIXME("(%p): stub\n", hWnd);
347 return FALSE;
351 /***********************************************************************
352 * RegisterTasklist [USER32.@]
354 DWORD WINAPI RegisterTasklist (DWORD x)
356 FIXME("0x%08x\n",x);
357 return TRUE;
361 /***********************************************************************
362 * RegisterDeviceNotificationA (USER32.@)
364 * See RegisterDeviceNotificationW.
366 HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE hnd, LPVOID notifyfilter, DWORD flags)
368 FIXME("(hwnd=%p, filter=%p,flags=0x%08x) returns a fake device notification handle!\n",
369 hnd,notifyfilter,flags );
370 return (HDEVNOTIFY) 0xcafecafe;
373 /***********************************************************************
374 * RegisterDeviceNotificationW (USER32.@)
376 * Registers a window with the system so that it will receive
377 * notifications about a device.
379 * PARAMS
380 * hRecipient [I] Window or service status handle that
381 * will receive notifications.
382 * pNotificationFilter [I] DEV_BROADCAST_HDR followed by some
383 * type-specific data.
384 * dwFlags [I] See notes
386 * RETURNS
388 * A handle to the device notification.
390 * NOTES
392 * The dwFlags parameter can be one of two values:
393 *| DEVICE_NOTIFY_WINDOW_HANDLE - hRecipient is a window handle
394 *| DEVICE_NOTIFY_SERVICE_HANDLE - hRecipient is a service status handle
396 HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE hRecipient, LPVOID pNotificationFilter, DWORD dwFlags)
398 FIXME("(hwnd=%p, filter=%p,flags=0x%08x) returns a fake device notification handle!\n",
399 hRecipient,pNotificationFilter,dwFlags );
400 return (HDEVNOTIFY) 0xcafeaffe;
403 /***********************************************************************
404 * UnregisterDeviceNotification (USER32.@)
407 BOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY hnd)
409 FIXME("(handle=%p), STUB!\n", hnd);
410 return TRUE;
413 /***********************************************************************
414 * GetAppCompatFlags (USER32.@)
416 DWORD WINAPI GetAppCompatFlags( HTASK hTask )
418 FIXME("(%p) stub\n", hTask);
419 return 0;
422 /***********************************************************************
423 * GetAppCompatFlags2 (USER32.@)
425 DWORD WINAPI GetAppCompatFlags2( HTASK hTask )
427 FIXME("(%p) stub\n", hTask);
428 return 0;
432 /***********************************************************************
433 * AlignRects (USER32.@)
435 BOOL WINAPI AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
437 FIXME("(%p, %d, %d, %d): stub\n", rect, b, c, d);
438 if (rect)
439 FIXME("rect: %s\n", wine_dbgstr_rect(rect));
440 /* Calls OffsetRect */
441 return FALSE;
445 /***********************************************************************
446 * LoadLocalFonts (USER32.@)
448 VOID WINAPI LoadLocalFonts(VOID)
450 /* are loaded. */
451 return;
455 /***********************************************************************
456 * User32InitializeImmEntryTable
458 BOOL WINAPI User32InitializeImmEntryTable(DWORD magic)
460 static const WCHAR imm32_dllW[] = {'i','m','m','3','2','.','d','l','l',0};
461 HMODULE imm32 = GetModuleHandleW(imm32_dllW);
463 TRACE("(%x)\n", magic);
465 if (!imm32 || magic != IMM_INIT_MAGIC)
466 return FALSE;
468 if (imm_get_ui_window)
469 return TRUE;
471 WM_MSIME_SERVICE = RegisterWindowMessageA("MSIMEService");
472 WM_MSIME_RECONVERTOPTIONS = RegisterWindowMessageA("MSIMEReconvertOptions");
473 WM_MSIME_MOUSE = RegisterWindowMessageA("MSIMEMouseOperation");
474 WM_MSIME_RECONVERTREQUEST = RegisterWindowMessageA("MSIMEReconvertRequest");
475 WM_MSIME_RECONVERT = RegisterWindowMessageA("MSIMEReconvert");
476 WM_MSIME_QUERYPOSITION = RegisterWindowMessageA("MSIMEQueryPosition");
477 WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed");
479 /* this part is not compatible with native imm32.dll */
480 imm_get_ui_window = (void*)GetProcAddress(imm32, "__wine_get_ui_window");
481 imm_register_window = (void*)GetProcAddress(imm32, "__wine_register_window");
482 imm_unregister_window = (void*)GetProcAddress(imm32, "__wine_unregister_window");
483 if (!imm_get_ui_window)
484 FIXME("native imm32.dll not supported\n");
485 return TRUE;
488 /**********************************************************************
489 * WINNLSGetIMEHotkey [USER32.@]
492 UINT WINAPI WINNLSGetIMEHotkey(HWND hwnd)
494 FIXME("hwnd %p: stub!\n", hwnd);
495 return 0; /* unknown */
498 /**********************************************************************
499 * WINNLSEnableIME [USER32.@]
502 BOOL WINAPI WINNLSEnableIME(HWND hwnd, BOOL enable)
504 FIXME("hwnd %p enable %d: stub!\n", hwnd, enable);
505 return TRUE; /* success (?) */
508 /**********************************************************************
509 * WINNLSGetEnableStatus [USER32.@]
512 BOOL WINAPI WINNLSGetEnableStatus(HWND hwnd)
514 FIXME("hwnd %p: stub!\n", hwnd);
515 return TRUE; /* success (?) */
518 /**********************************************************************
519 * SendIMEMessageExA [USER32.@]
522 LRESULT WINAPI SendIMEMessageExA(HWND hwnd, LPARAM lparam)
524 FIXME("(%p,%lx): stub\n", hwnd, lparam);
525 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
526 return 0;
529 /**********************************************************************
530 * SendIMEMessageExW [USER32.@]
533 LRESULT WINAPI SendIMEMessageExW(HWND hwnd, LPARAM lparam)
535 FIXME("(%p,%lx): stub\n", hwnd, lparam);
536 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
537 return 0;
540 /**********************************************************************
541 * DisableProcessWindowsGhosting [USER32.@]
544 VOID WINAPI DisableProcessWindowsGhosting(VOID)
546 FIXME(": stub\n");
547 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
548 return;
551 /**********************************************************************
552 * UserHandleGrantAccess [USER32.@]
555 BOOL WINAPI UserHandleGrantAccess(HANDLE handle, HANDLE job, BOOL grant)
557 FIXME("(%p,%p,%d): stub\n", handle, job, grant);
558 return TRUE;
561 /**********************************************************************
562 * RegisterPowerSettingNotification [USER32.@]
564 HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE recipient, const GUID *guid, DWORD flags)
566 FIXME("(%p,%s,%x): stub\n", recipient, debugstr_guid(guid), flags);
567 return (HPOWERNOTIFY)0xdeadbeef;
570 /**********************************************************************
571 * UnregisterPowerSettingNotification [USER32.@]
573 BOOL WINAPI UnregisterPowerSettingNotification(HPOWERNOTIFY handle)
575 FIXME("(%p): stub\n", handle);
576 return TRUE;
579 /*****************************************************************************
580 * GetGestureConfig (USER32.@)
582 BOOL WINAPI GetGestureConfig( HWND hwnd, DWORD reserved, DWORD flags, UINT *count, GESTURECONFIG *config, UINT size )
584 FIXME("(%p %08x %08x %p %p %u): stub\n", hwnd, reserved, flags, count, config, size);
585 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
586 return FALSE;
589 /**********************************************************************
590 * SetGestureConfig [USER32.@]
592 BOOL WINAPI SetGestureConfig( HWND hwnd, DWORD reserved, UINT id, PGESTURECONFIG config, UINT size )
594 FIXME("(%p %08x %u %p %u): stub\n", hwnd, reserved, id, config, size);
595 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
596 return FALSE;
599 /**********************************************************************
600 * IsTouchWindow [USER32.@]
602 BOOL WINAPI IsTouchWindow( HWND hwnd, PULONG flags )
604 FIXME("(%p %p): stub\n", hwnd, flags);
605 return FALSE;
608 /**********************************************************************
609 * IsWindowRedirectedForPrint [USER32.@]
611 BOOL WINAPI IsWindowRedirectedForPrint( HWND hwnd )
613 FIXME("(%p): stub\n", hwnd);
614 return FALSE;
617 /**********************************************************************
618 * GetDisplayConfigBufferSizes [USER32.@]
620 LONG WINAPI GetDisplayConfigBufferSizes(UINT32 flags, UINT32 *num_path_info, UINT32 *num_mode_info)
622 FIXME("(0x%x %p %p): stub\n", flags, num_path_info, num_mode_info);
624 if (!num_path_info || !num_mode_info)
625 return ERROR_INVALID_PARAMETER;
627 *num_path_info = 0;
628 *num_mode_info = 0;
629 return ERROR_NOT_SUPPORTED;
632 /**********************************************************************
633 * RegisterPointerDeviceNotifications [USER32.@]
635 BOOL WINAPI RegisterPointerDeviceNotifications(HWND hwnd, BOOL notifyrange)
637 FIXME("(%p %d): stub\n", hwnd, notifyrange);
638 return TRUE;
641 /**********************************************************************
642 * GetPointerDevices [USER32.@]
644 BOOL WINAPI GetPointerDevices(UINT32 *device_count, POINTER_DEVICE_INFO *devices)
646 FIXME("(%p %p): partial stub\n", device_count, devices);
648 if (!device_count)
649 return FALSE;
651 if (devices)
652 return FALSE;
654 *device_count = 0;
655 return TRUE;
658 /**********************************************************************
659 * RegisterTouchHitTestingWindow [USER32.@]
661 BOOL WINAPI RegisterTouchHitTestingWindow(HWND hwnd, ULONG value)
663 FIXME("(%p %d): stub\n", hwnd, value);
664 return TRUE;
668 static const WCHAR imeW[] = {'I','M','E',0};
669 const struct builtin_class_descr IME_builtin_class =
671 imeW, /* name */
672 0, /* style */
673 WINPROC_IME, /* proc */
674 2*sizeof(LONG_PTR), /* extra */
675 IDC_ARROW, /* cursor */
676 0 /* brush */
679 static BOOL is_ime_ui_msg( UINT msg )
681 switch(msg) {
682 case WM_IME_STARTCOMPOSITION:
683 case WM_IME_ENDCOMPOSITION:
684 case WM_IME_COMPOSITION:
685 case WM_IME_SETCONTEXT:
686 case WM_IME_NOTIFY:
687 case WM_IME_CONTROL:
688 case WM_IME_COMPOSITIONFULL:
689 case WM_IME_SELECT:
690 case WM_IME_CHAR:
691 case WM_IME_REQUEST:
692 case WM_IME_KEYDOWN:
693 case WM_IME_KEYUP:
694 return TRUE;
695 default:
696 if ((msg == WM_MSIME_RECONVERTOPTIONS) ||
697 (msg == WM_MSIME_SERVICE) ||
698 (msg == WM_MSIME_MOUSE) ||
699 (msg == WM_MSIME_RECONVERTREQUEST) ||
700 (msg == WM_MSIME_RECONVERT) ||
701 (msg == WM_MSIME_QUERYPOSITION) ||
702 (msg == WM_MSIME_DOCUMENTFEED))
703 return TRUE;
705 return FALSE;
709 LRESULT WINAPI ImeWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
711 HWND uiwnd;
713 if (msg==WM_CREATE)
714 return TRUE;
716 if (imm_get_ui_window && is_ime_ui_msg(msg))
718 if ((uiwnd = imm_get_ui_window(GetKeyboardLayout(0))))
719 return SendMessageA(uiwnd, msg, wParam, lParam);
720 return FALSE;
723 return DefWindowProcA(hwnd, msg, wParam, lParam);
726 LRESULT WINAPI ImeWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
728 HWND uiwnd;
730 if (msg==WM_CREATE)
731 return TRUE;
733 if (imm_get_ui_window && is_ime_ui_msg(msg))
735 if ((uiwnd = imm_get_ui_window(GetKeyboardLayout(0))))
736 return SendMessageW(uiwnd, msg, wParam, lParam);
737 return FALSE;
740 return DefWindowProcW(hwnd, msg, wParam, lParam);