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
26 #include "wine/windef16.h"
33 #include "user_private.h"
35 #include "wine/unicode.h"
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(win
);
40 #define IMM_INIT_MAGIC 0x19650412
41 static HWND (WINAPI
*imm_get_ui_window
)(HKL
);
44 static UINT WM_MSIME_SERVICE
;
45 static UINT WM_MSIME_RECONVERTOPTIONS
;
46 static UINT WM_MSIME_MOUSE
;
47 static UINT WM_MSIME_RECONVERTREQUEST
;
48 static UINT WM_MSIME_RECONVERT
;
49 static UINT WM_MSIME_QUERYPOSITION
;
50 static UINT WM_MSIME_DOCUMENTFEED
;
52 /* USER signal proc flags and codes */
53 /* See UserSignalProc for comments */
54 #define USIG_FLAGS_WIN32 0x0001
55 #define USIG_FLAGS_GUI 0x0002
56 #define USIG_FLAGS_FEEDBACK 0x0004
57 #define USIG_FLAGS_FAULT 0x0008
59 #define USIG_DLL_UNLOAD_WIN16 0x0001
60 #define USIG_DLL_UNLOAD_WIN32 0x0002
61 #define USIG_FAULT_DIALOG_PUSH 0x0003
62 #define USIG_FAULT_DIALOG_POP 0x0004
63 #define USIG_DLL_UNLOAD_ORPHANS 0x0005
64 #define USIG_THREAD_INIT 0x0010
65 #define USIG_THREAD_EXIT 0x0020
66 #define USIG_PROCESS_CREATE 0x0100
67 #define USIG_PROCESS_INIT 0x0200
68 #define USIG_PROCESS_EXIT 0x0300
69 #define USIG_PROCESS_DESTROY 0x0400
70 #define USIG_PROCESS_RUNNING 0x0500
71 #define USIG_PROCESS_LOADED 0x0600
73 /***********************************************************************
74 * SignalProc32 (USER.391)
75 * UserSignalProc (USER32.@)
77 * The exact meaning of the USER signals is undocumented, but this
78 * should cover the basic idea:
80 * USIG_DLL_UNLOAD_WIN16
81 * This is sent when a 16-bit module is unloaded.
83 * USIG_DLL_UNLOAD_WIN32
84 * This is sent when a 32-bit module is unloaded.
86 * USIG_DLL_UNLOAD_ORPHANS
87 * This is sent after the last Win3.1 module is unloaded,
88 * to allow removal of orphaned menus.
90 * USIG_FAULT_DIALOG_PUSH
91 * USIG_FAULT_DIALOG_POP
92 * These are called to allow USER to prepare for displaying a
93 * fault dialog, even though the fault might have happened while
94 * inside a USER critical section.
97 * This is called from the context of a new thread, as soon as it
101 * This is called, still in its context, just before a thread is
102 * about to terminate.
104 * USIG_PROCESS_CREATE
105 * This is called, in the parent process context, after a new process
109 * This is called in the new process context, just after the main thread
110 * has started execution (after the main thread's USIG_THREAD_INIT has
113 * USIG_PROCESS_LOADED
114 * This is called after the executable file has been loaded into the
115 * new process context.
117 * USIG_PROCESS_RUNNING
118 * This is called immediately before the main entry point is called.
121 * This is called in the context of a process that is about to
122 * terminate (but before the last thread's USIG_THREAD_EXIT has
125 * USIG_PROCESS_DESTROY
126 * This is called after a process has terminated.
129 * The meaning of the dwFlags bits is as follows:
132 * Current process is 32-bit.
135 * Current process is a (Win32) GUI process.
137 * USIG_FLAGS_FEEDBACK
138 * Current process needs 'feedback' (determined from the STARTUPINFO
139 * flags STARTF_FORCEONFEEDBACK / STARTF_FORCEOFFFEEDBACK).
142 * The signal is being sent due to a fault.
144 WORD WINAPI
UserSignalProc( UINT uCode
, DWORD dwThreadOrProcessID
,
145 DWORD dwFlags
, HMODULE16 hModule
)
147 FIXME("(%04x, %08x, %04x, %04x)\n",
148 uCode
, dwThreadOrProcessID
, dwFlags
, hModule
);
149 /* FIXME: Should chain to GdiSignalProc now. */
154 /**********************************************************************
155 * SetLastErrorEx [USER32.@]
157 * Sets the last-error code.
162 void WINAPI
SetLastErrorEx(
163 DWORD error
, /* [in] Per-thread error code */
164 DWORD type
) /* [in] Error type */
166 TRACE("(0x%08x, 0x%08x)\n", error
,type
);
173 /* Fall through for now */
175 FIXME("(error=%08x, type=%08x): Unhandled type\n", error
,type
);
178 SetLastError( error
);
181 /******************************************************************************
182 * GetAltTabInfoA [USER32.@]
184 BOOL WINAPI
GetAltTabInfoA(HWND hwnd
, int iItem
, PALTTABINFO pati
, LPSTR pszItemText
, UINT cchItemText
)
186 FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd
, iItem
, pati
, pszItemText
, cchItemText
);
190 /******************************************************************************
191 * GetAltTabInfoW [USER32.@]
193 BOOL WINAPI
GetAltTabInfoW(HWND hwnd
, int iItem
, PALTTABINFO pati
, LPWSTR pszItemText
, UINT cchItemText
)
195 FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd
, iItem
, pati
, pszItemText
, cchItemText
);
199 /******************************************************************************
200 * SetDebugErrorLevel [USER32.@]
201 * Sets the minimum error level for generating debugging events
204 * dwLevel [I] Debugging error level
209 VOID WINAPI
SetDebugErrorLevel( DWORD dwLevel
)
211 FIXME("(%d): stub\n", dwLevel
);
215 /***********************************************************************
216 * SetWindowStationUser (USER32.@)
218 DWORD WINAPI
SetWindowStationUser(DWORD x1
,DWORD x2
)
220 FIXME("(0x%08x,0x%08x),stub!\n",x1
,x2
);
224 /***********************************************************************
225 * RegisterLogonProcess (USER32.@)
227 DWORD WINAPI
RegisterLogonProcess(HANDLE hprocess
,BOOL x
)
229 FIXME("(%p,%d),stub!\n",hprocess
,x
);
233 /***********************************************************************
234 * SetLogonNotifyWindow (USER32.@)
236 DWORD WINAPI
SetLogonNotifyWindow(HWINSTA hwinsta
,HWND hwnd
)
238 FIXME("(%p,%p),stub!\n",hwinsta
,hwnd
);
242 static const WCHAR primary_device_name
[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
243 static const WCHAR primary_device_string
[] = {'X','1','1',' ','W','i','n','d','o','w','i','n','g',' ',
244 'S','y','s','t','e','m',0};
245 static const WCHAR primary_device_deviceid
[] = {'P','C','I','\\','V','E','N','_','0','0','0','0','&',
246 'D','E','V','_','0','0','0','0',0};
248 /***********************************************************************
249 * EnumDisplayDevicesA (USER32.@)
251 BOOL WINAPI
EnumDisplayDevicesA( LPCSTR lpDevice
, DWORD i
, LPDISPLAY_DEVICEA lpDispDev
,
254 UNICODE_STRING deviceW
;
259 RtlCreateUnicodeStringFromAsciiz(&deviceW
, lpDevice
);
261 deviceW
.Buffer
= NULL
;
263 ddW
.cb
= sizeof(ddW
);
264 ret
= EnumDisplayDevicesW(deviceW
.Buffer
, i
, &ddW
, dwFlags
);
265 RtlFreeUnicodeString(&deviceW
);
269 WideCharToMultiByte(CP_ACP
, 0, ddW
.DeviceName
, -1, lpDispDev
->DeviceName
, sizeof(lpDispDev
->DeviceName
), NULL
, NULL
);
270 WideCharToMultiByte(CP_ACP
, 0, ddW
.DeviceString
, -1, lpDispDev
->DeviceString
, sizeof(lpDispDev
->DeviceString
), NULL
, NULL
);
271 lpDispDev
->StateFlags
= ddW
.StateFlags
;
273 if(lpDispDev
->cb
>= offsetof(DISPLAY_DEVICEA
, DeviceID
) + sizeof(lpDispDev
->DeviceID
))
274 WideCharToMultiByte(CP_ACP
, 0, ddW
.DeviceID
, -1, lpDispDev
->DeviceID
, sizeof(lpDispDev
->DeviceID
), NULL
, NULL
);
275 if(lpDispDev
->cb
>= offsetof(DISPLAY_DEVICEA
, DeviceKey
) + sizeof(lpDispDev
->DeviceKey
))
276 WideCharToMultiByte(CP_ACP
, 0, ddW
.DeviceKey
, -1, lpDispDev
->DeviceKey
, sizeof(lpDispDev
->DeviceKey
), NULL
, NULL
);
281 /***********************************************************************
282 * EnumDisplayDevicesW (USER32.@)
284 BOOL WINAPI
EnumDisplayDevicesW( LPCWSTR lpDevice
, DWORD i
, LPDISPLAY_DEVICEW lpDisplayDevice
,
287 FIXME("(%s,%d,%p,0x%08x), stub!\n",debugstr_w(lpDevice
),i
,lpDisplayDevice
,dwFlags
);
292 memcpy(lpDisplayDevice
->DeviceName
, primary_device_name
, sizeof(primary_device_name
));
293 memcpy(lpDisplayDevice
->DeviceString
, primary_device_string
, sizeof(primary_device_string
));
295 lpDisplayDevice
->StateFlags
=
296 DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
|
297 DISPLAY_DEVICE_PRIMARY_DEVICE
|
298 DISPLAY_DEVICE_VGA_COMPATIBLE
;
300 if(lpDisplayDevice
->cb
>= offsetof(DISPLAY_DEVICEW
, DeviceID
) + sizeof(lpDisplayDevice
->DeviceID
))
301 memcpy(lpDisplayDevice
->DeviceID
, primary_device_deviceid
, sizeof(primary_device_deviceid
));
302 if(lpDisplayDevice
->cb
>= offsetof(DISPLAY_DEVICEW
, DeviceKey
) + sizeof(lpDisplayDevice
->DeviceKey
))
303 lpDisplayDevice
->DeviceKey
[0] = 0;
308 struct monitor_enum_info
318 /* helper callback for MonitorFromRect */
319 static BOOL CALLBACK
monitor_enum( HMONITOR monitor
, HDC hdc
, LPRECT rect
, LPARAM lp
)
321 struct monitor_enum_info
*info
= (struct monitor_enum_info
*)lp
;
324 if (IntersectRect( &intersect
, rect
, &info
->rect
))
326 /* check for larger intersecting area */
327 UINT area
= (intersect
.right
- intersect
.left
) * (intersect
.bottom
- intersect
.top
);
328 if (area
> info
->max_area
)
330 info
->max_area
= area
;
334 else if (!info
->max_area
) /* if not intersecting, check for min distance */
339 if (info
->rect
.right
<= rect
->left
) x
= rect
->left
- info
->rect
.right
;
340 else if (rect
->right
<= info
->rect
.left
) x
= info
->rect
.left
- rect
->right
;
342 if (info
->rect
.bottom
<= rect
->top
) y
= rect
->top
- info
->rect
.bottom
;
343 else if (rect
->bottom
<= info
->rect
.top
) y
= info
->rect
.top
- rect
->bottom
;
345 distance
= x
* x
+ y
* y
;
346 if (distance
< info
->min_distance
)
348 info
->min_distance
= distance
;
349 info
->nearest
= monitor
;
354 MONITORINFO mon_info
;
355 mon_info
.cbSize
= sizeof(mon_info
);
356 GetMonitorInfoW( monitor
, &mon_info
);
357 if (mon_info
.dwFlags
& MONITORINFOF_PRIMARY
) info
->primary
= monitor
;
362 /***********************************************************************
363 * MonitorFromRect (USER32.@)
365 HMONITOR WINAPI
MonitorFromRect( LPRECT rect
, DWORD flags
)
367 struct monitor_enum_info info
;
371 info
.min_distance
= ~0u;
376 if (IsRectEmpty(&info
.rect
))
378 info
.rect
.right
= info
.rect
.left
+ 1;
379 info
.rect
.bottom
= info
.rect
.top
+ 1;
382 if (!EnumDisplayMonitors( 0, NULL
, monitor_enum
, (LPARAM
)&info
)) return 0;
385 if (flags
& MONITOR_DEFAULTTOPRIMARY
) info
.ret
= info
.primary
;
386 else if (flags
& MONITOR_DEFAULTTONEAREST
) info
.ret
= info
.nearest
;
389 TRACE( "%s flags %x returning %p\n", wine_dbgstr_rect(rect
), flags
, info
.ret
);
393 /***********************************************************************
394 * MonitorFromPoint (USER32.@)
396 HMONITOR WINAPI
MonitorFromPoint( POINT pt
, DWORD flags
)
400 SetRect( &rect
, pt
.x
, pt
.y
, pt
.x
+ 1, pt
.y
+ 1 );
401 return MonitorFromRect( &rect
, flags
);
404 /***********************************************************************
405 * MonitorFromWindow (USER32.@)
407 HMONITOR WINAPI
MonitorFromWindow(HWND hWnd
, DWORD dwFlags
)
412 TRACE("(%p, 0x%08x)\n", hWnd
, dwFlags
);
414 if (IsIconic(hWnd
) && GetWindowPlacement(hWnd
, &wp
))
415 return MonitorFromRect( &wp
.rcNormalPosition
, dwFlags
);
417 if (GetWindowRect( hWnd
, &rect
))
418 return MonitorFromRect( &rect
, dwFlags
);
420 if (!(dwFlags
& (MONITOR_DEFAULTTOPRIMARY
|MONITOR_DEFAULTTONEAREST
))) return 0;
421 /* retrieve the primary */
422 SetRect( &rect
, 0, 0, 1, 1 );
423 return MonitorFromRect( &rect
, dwFlags
);
426 /***********************************************************************
427 * GetMonitorInfoA (USER32.@)
429 BOOL WINAPI
GetMonitorInfoA(HMONITOR hMonitor
, LPMONITORINFO lpMonitorInfo
)
432 MONITORINFOEXA
*miA
= (MONITORINFOEXA
*)lpMonitorInfo
;
435 if((miA
->cbSize
!= sizeof(MONITORINFOEXA
)) && (miA
->cbSize
!= sizeof(MONITORINFO
)))
438 miW
.cbSize
= sizeof(miW
);
440 ret
= GetMonitorInfoW(hMonitor
, (MONITORINFO
*)&miW
);
443 miA
->rcMonitor
= miW
.rcMonitor
;
444 miA
->rcWork
= miW
.rcWork
;
445 miA
->dwFlags
= miW
.dwFlags
;
446 if(miA
->cbSize
== sizeof(MONITORINFOEXA
))
447 WideCharToMultiByte(CP_ACP
, 0, miW
.szDevice
, -1, miA
->szDevice
, sizeof(miA
->szDevice
), NULL
, NULL
);
451 /***********************************************************************
452 * GetMonitorInfoW (USER32.@)
454 BOOL WINAPI
GetMonitorInfoW(HMONITOR hMonitor
, LPMONITORINFO lpMonitorInfo
)
458 if (lpMonitorInfo
->cbSize
!= sizeof(MONITORINFOEXW
) && lpMonitorInfo
->cbSize
!= sizeof(MONITORINFO
))
461 ret
= USER_Driver
->pGetMonitorInfo( hMonitor
, lpMonitorInfo
);
463 TRACE("flags %04x, monitor %s, work %s\n", lpMonitorInfo
->dwFlags
,
464 wine_dbgstr_rect(&lpMonitorInfo
->rcMonitor
),
465 wine_dbgstr_rect(&lpMonitorInfo
->rcWork
));
469 /***********************************************************************
470 * EnumDisplayMonitors (USER32.@)
472 BOOL WINAPI
EnumDisplayMonitors( HDC hdc
, LPRECT rect
, MONITORENUMPROC proc
, LPARAM lp
)
474 return USER_Driver
->pEnumDisplayMonitors( hdc
, rect
, proc
, lp
);
477 /***********************************************************************
478 * RegisterSystemThread (USER32.@)
480 void WINAPI
RegisterSystemThread(DWORD flags
, DWORD reserved
)
482 FIXME("(%08x, %08x)\n", flags
, reserved
);
485 /***********************************************************************
486 * RegisterShellHookWindow [USER32.@]
488 BOOL WINAPI
RegisterShellHookWindow ( HWND hWnd
)
490 FIXME("(%p): stub\n", hWnd
);
495 /***********************************************************************
496 * DeregisterShellHookWindow [USER32.@]
498 HRESULT WINAPI
DeregisterShellHookWindow ( DWORD u
)
500 FIXME("0x%08x stub\n",u
);
506 /***********************************************************************
507 * RegisterTasklist [USER32.@]
509 DWORD WINAPI
RegisterTasklist (DWORD x
)
516 /***********************************************************************
517 * RegisterDeviceNotificationA (USER32.@)
519 * See RegisterDeviceNotificationW.
521 HDEVNOTIFY WINAPI
RegisterDeviceNotificationA(HANDLE hnd
, LPVOID notifyfilter
, DWORD flags
)
523 FIXME("(hwnd=%p, filter=%p,flags=0x%08x) returns a fake device notification handle!\n",
524 hnd
,notifyfilter
,flags
);
525 return (HDEVNOTIFY
) 0xcafecafe;
528 /***********************************************************************
529 * RegisterDeviceNotificationW (USER32.@)
531 * Registers a window with the system so that it will receive
532 * notifications about a device.
535 * hRecipient [I] Window or service status handle that
536 * will receive notifications.
537 * pNotificationFilter [I] DEV_BROADCAST_HDR followed by some
538 * type-specific data.
539 * dwFlags [I] See notes
543 * A handle to the device notification.
547 * The dwFlags parameter can be one of two values:
548 *| DEVICE_NOTIFY_WINDOW_HANDLE - hRecipient is a window handle
549 *| DEVICE_NOTIFY_SERVICE_HANDLE - hRecipient is a service status handle
551 HDEVNOTIFY WINAPI
RegisterDeviceNotificationW(HANDLE hRecipient
, LPVOID pNotificationFilter
, DWORD dwFlags
)
553 FIXME("(hwnd=%p, filter=%p,flags=0x%08x) returns a fake device notification handle!\n",
554 hRecipient
,pNotificationFilter
,dwFlags
);
555 return (HDEVNOTIFY
) 0xcafeaffe;
558 /***********************************************************************
559 * UnregisterDeviceNotification (USER32.@)
562 BOOL WINAPI
UnregisterDeviceNotification(HDEVNOTIFY hnd
)
564 FIXME("(handle=%p), STUB!\n", hnd
);
568 /***********************************************************************
569 * GetAppCompatFlags (USER32.@)
571 DWORD WINAPI
GetAppCompatFlags( HTASK hTask
)
573 FIXME("(%p) stub\n", hTask
);
577 /***********************************************************************
578 * GetAppCompatFlags2 (USER32.@)
580 DWORD WINAPI
GetAppCompatFlags2( HTASK hTask
)
582 FIXME("(%p) stub\n", hTask
);
587 /***********************************************************************
588 * AlignRects (USER32.@)
590 BOOL WINAPI
AlignRects(LPRECT rect
, DWORD b
, DWORD c
, DWORD d
)
592 FIXME("(%p, %d, %d, %d): stub\n", rect
, b
, c
, d
);
594 FIXME("rect: [[%d, %d], [%d, %d]]\n", rect
->left
, rect
->top
, rect
->right
, rect
->bottom
);
595 /* Calls OffsetRect */
600 /***********************************************************************
601 * LoadLocalFonts (USER32.@)
603 VOID WINAPI
LoadLocalFonts(VOID
)
610 /***********************************************************************
611 * User32InitializeImmEntryTable
613 BOOL WINAPI
User32InitializeImmEntryTable(DWORD magic
)
615 static const WCHAR imm32_dllW
[] = {'i','m','m','3','2','.','d','l','l',0};
616 HMODULE imm32
= GetModuleHandleW(imm32_dllW
);
618 TRACE("(%x)\n", magic
);
620 if (!imm32
|| magic
!= IMM_INIT_MAGIC
)
623 if (imm_get_ui_window
)
626 WM_MSIME_SERVICE
= RegisterWindowMessageA("MSIMEService");
627 WM_MSIME_RECONVERTOPTIONS
= RegisterWindowMessageA("MSIMEReconvertOptions");
628 WM_MSIME_MOUSE
= RegisterWindowMessageA("MSIMEMouseOperation");
629 WM_MSIME_RECONVERTREQUEST
= RegisterWindowMessageA("MSIMEReconvertRequest");
630 WM_MSIME_RECONVERT
= RegisterWindowMessageA("MSIMEReconvert");
631 WM_MSIME_QUERYPOSITION
= RegisterWindowMessageA("MSIMEQueryPosition");
632 WM_MSIME_DOCUMENTFEED
= RegisterWindowMessageA("MSIMEDocumentFeed");
634 /* this part is not compatible with native imm32.dll */
635 imm_get_ui_window
= (void*)GetProcAddress(imm32
, "__wine_get_ui_window");
636 if (!imm_get_ui_window
)
637 FIXME("native imm32.dll not supported\n");
641 /**********************************************************************
642 * WINNLSGetIMEHotkey [USER32.@]
645 UINT WINAPI
WINNLSGetIMEHotkey(HWND hwnd
)
647 FIXME("hwnd %p: stub!\n", hwnd
);
648 return 0; /* unknown */
651 /**********************************************************************
652 * WINNLSEnableIME [USER32.@]
655 BOOL WINAPI
WINNLSEnableIME(HWND hwnd
, BOOL enable
)
657 FIXME("hwnd %p enable %d: stub!\n", hwnd
, enable
);
658 return TRUE
; /* success (?) */
661 /**********************************************************************
662 * WINNLSGetEnableStatus [USER32.@]
665 BOOL WINAPI
WINNLSGetEnableStatus(HWND hwnd
)
667 FIXME("hwnd %p: stub!\n", hwnd
);
668 return TRUE
; /* success (?) */
671 /**********************************************************************
672 * SendIMEMessageExA [USER32.@]
675 LRESULT WINAPI
SendIMEMessageExA(HWND hwnd
, LPARAM lparam
)
677 FIXME("(%p,%lx): stub\n", hwnd
, lparam
);
678 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
682 /**********************************************************************
683 * SendIMEMessageExW [USER32.@]
686 LRESULT WINAPI
SendIMEMessageExW(HWND hwnd
, LPARAM lparam
)
688 FIXME("(%p,%lx): stub\n", hwnd
, lparam
);
689 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
693 /**********************************************************************
694 * DisableProcessWindowsGhosting [USER32.@]
697 VOID WINAPI
DisableProcessWindowsGhosting(VOID
)
700 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
704 /**********************************************************************
705 * UserHandleGrantAccess [USER32.@]
708 BOOL WINAPI
UserHandleGrantAccess(HANDLE handle
, HANDLE job
, BOOL grant
)
710 FIXME("(%p,%p,%d): stub\n", handle
, job
, grant
);
714 /**********************************************************************
715 * RegisterPowerSettingNotification [USER32.@]
717 HPOWERNOTIFY WINAPI
RegisterPowerSettingNotification(HANDLE recipient
, const GUID
*guid
, DWORD flags
)
719 FIXME("(%p,%s,%x): stub\n", recipient
, debugstr_guid(guid
), flags
);
720 return (HPOWERNOTIFY
)0xdeadbeef;
723 /**********************************************************************
724 * UnregisterPowerSettingNotification [USER32.@]
726 BOOL WINAPI
UnregisterPowerSettingNotification(HPOWERNOTIFY handle
)
728 FIXME("(%p): stub\n", handle
);
732 /**********************************************************************
733 * SetGestureConfig [USER32.@]
735 BOOL WINAPI
SetGestureConfig( HWND hwnd
, DWORD reserved
, UINT id
, PGESTURECONFIG config
, UINT size
)
737 FIXME("(%p %08x %u %p %u): stub\n", hwnd
, reserved
, id
, config
, size
);
738 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
742 /**********************************************************************
743 * IsTouchWindow [USER32.@]
745 BOOL WINAPI
IsTouchWindow( HWND hwnd
, PULONG flags
)
747 FIXME("(%p %p): stub\n", hwnd
, flags
);
751 /**********************************************************************
752 * IsWindowRedirectedForPrint [USER32.@]
754 BOOL WINAPI
IsWindowRedirectedForPrint( HWND hwnd
)
756 FIXME("(%p): stub\n", hwnd
);
761 static const WCHAR imeW
[] = {'I','M','E',0};
762 const struct builtin_class_descr IME_builtin_class
=
766 WINPROC_IME
, /* proc */
767 2*sizeof(LONG_PTR
), /* extra */
768 IDC_ARROW
, /* cursor */
772 static BOOL
is_ime_ui_msg( UINT msg
)
775 case WM_IME_STARTCOMPOSITION
:
776 case WM_IME_ENDCOMPOSITION
:
777 case WM_IME_COMPOSITION
:
778 case WM_IME_SETCONTEXT
:
781 case WM_IME_COMPOSITIONFULL
:
789 if ((msg
== WM_MSIME_RECONVERTOPTIONS
) ||
790 (msg
== WM_MSIME_SERVICE
) ||
791 (msg
== WM_MSIME_MOUSE
) ||
792 (msg
== WM_MSIME_RECONVERTREQUEST
) ||
793 (msg
== WM_MSIME_RECONVERT
) ||
794 (msg
== WM_MSIME_QUERYPOSITION
) ||
795 (msg
== WM_MSIME_DOCUMENTFEED
))
802 LRESULT WINAPI
ImeWndProcA( HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
806 if (msg
==WM_CREATE
|| msg
==WM_NCCREATE
)
809 if (imm_get_ui_window
&& is_ime_ui_msg(msg
))
811 if ((uiwnd
= imm_get_ui_window(GetKeyboardLayout(0))))
812 return SendMessageA(uiwnd
, msg
, wParam
, lParam
);
816 return DefWindowProcA(hwnd
, msg
, wParam
, lParam
);
819 LRESULT WINAPI
ImeWndProcW( HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
823 if (msg
==WM_CREATE
|| msg
==WM_NCCREATE
)
826 if (imm_get_ui_window
&& is_ime_ui_msg(msg
))
828 if ((uiwnd
= imm_get_ui_window(GetKeyboardLayout(0))))
829 return SendMessageW(uiwnd
, msg
, wParam
, lParam
);
833 return DefWindowProcW(hwnd
, msg
, wParam
, lParam
);