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
28 #include "wine/windef16.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
;
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.
101 * This is called from the context of a new thread, as soon as it
102 * has started to run.
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
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
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.
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
129 * USIG_PROCESS_DESTROY
130 * This is called after a process has terminated.
133 * The meaning of the dwFlags bits is as follows:
136 * Current process is 32-bit.
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).
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. */
158 /**********************************************************************
159 * SetLastErrorEx [USER32.@]
161 * Sets the last-error code.
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
);
177 /* Fall through for now */
179 FIXME("(error=%08x, type=%08x): Unhandled type\n", error
,type
);
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
);
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
);
203 /******************************************************************************
204 * SetDebugErrorLevel [USER32.@]
205 * Sets the minimum error level for generating debugging events
208 * dwLevel [I] Debugging error level
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
);
228 /***********************************************************************
229 * RegisterLogonProcess (USER32.@)
231 DWORD WINAPI
RegisterLogonProcess(HANDLE hprocess
,BOOL x
)
233 FIXME("(%p,%d),stub!\n",hprocess
,x
);
237 /***********************************************************************
238 * SetLogonNotifyWindow (USER32.@)
240 DWORD WINAPI
SetLogonNotifyWindow(HWINSTA hwinsta
,HWND hwnd
)
242 FIXME("(%p,%p),stub!\n",hwinsta
,hwnd
);
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
,
258 UNICODE_STRING deviceW
;
263 RtlCreateUnicodeStringFromAsciiz(&deviceW
, lpDevice
);
265 deviceW
.Buffer
= NULL
;
267 ddW
.cb
= sizeof(ddW
);
268 ret
= EnumDisplayDevicesW(deviceW
.Buffer
, i
, &ddW
, dwFlags
);
269 RtlFreeUnicodeString(&deviceW
);
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
);
285 /***********************************************************************
286 * EnumDisplayDevicesW (USER32.@)
288 BOOL WINAPI
EnumDisplayDevicesW( LPCWSTR lpDevice
, DWORD i
, LPDISPLAY_DEVICEW lpDisplayDevice
,
291 FIXME("(%s,%d,%p,0x%08x), stub!\n",debugstr_w(lpDevice
),i
,lpDisplayDevice
,dwFlags
);
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;
312 struct monitor_enum_info
322 /* helper callback for MonitorFromRect */
323 static BOOL CALLBACK
monitor_enum( HMONITOR monitor
, HDC hdc
, LPRECT rect
, LPARAM lp
)
325 struct monitor_enum_info
*info
= (struct monitor_enum_info
*)lp
;
328 if (IntersectRect( &intersect
, rect
, &info
->rect
))
330 /* check for larger intersecting area */
331 UINT area
= (intersect
.right
- intersect
.left
) * (intersect
.bottom
- intersect
.top
);
332 if (area
> info
->max_area
)
334 info
->max_area
= area
;
338 else if (!info
->max_area
) /* if not intersecting, check for min distance */
343 if (info
->rect
.right
<= rect
->left
) x
= rect
->left
- info
->rect
.right
;
344 else if (rect
->right
<= info
->rect
.left
) x
= info
->rect
.left
- rect
->right
;
346 if (info
->rect
.bottom
<= rect
->top
) y
= rect
->top
- info
->rect
.bottom
;
347 else if (rect
->bottom
<= info
->rect
.top
) y
= info
->rect
.top
- rect
->bottom
;
349 distance
= x
* x
+ y
* y
;
350 if (distance
< info
->min_distance
)
352 info
->min_distance
= distance
;
353 info
->nearest
= monitor
;
358 MONITORINFO mon_info
;
359 mon_info
.cbSize
= sizeof(mon_info
);
360 GetMonitorInfoW( monitor
, &mon_info
);
361 if (mon_info
.dwFlags
& MONITORINFOF_PRIMARY
) info
->primary
= monitor
;
366 /***********************************************************************
367 * MonitorFromRect (USER32.@)
369 HMONITOR WINAPI
MonitorFromRect( LPRECT rect
, DWORD flags
)
371 struct monitor_enum_info info
;
375 info
.min_distance
= ~0u;
380 if (IsRectEmpty(&info
.rect
))
382 info
.rect
.right
= info
.rect
.left
+ 1;
383 info
.rect
.bottom
= info
.rect
.top
+ 1;
386 if (!EnumDisplayMonitors( 0, NULL
, monitor_enum
, (LPARAM
)&info
)) return 0;
389 if (flags
& MONITOR_DEFAULTTOPRIMARY
) info
.ret
= info
.primary
;
390 else if (flags
& MONITOR_DEFAULTTONEAREST
) info
.ret
= info
.nearest
;
393 TRACE( "%s flags %x returning %p\n", wine_dbgstr_rect(rect
), flags
, info
.ret
);
397 /***********************************************************************
398 * MonitorFromPoint (USER32.@)
400 HMONITOR WINAPI
MonitorFromPoint( POINT pt
, DWORD flags
)
404 SetRect( &rect
, pt
.x
, pt
.y
, pt
.x
+ 1, pt
.y
+ 1 );
405 return MonitorFromRect( &rect
, flags
);
408 /***********************************************************************
409 * MonitorFromWindow (USER32.@)
411 HMONITOR WINAPI
MonitorFromWindow(HWND hWnd
, DWORD dwFlags
)
416 TRACE("(%p, 0x%08x)\n", hWnd
, dwFlags
);
418 wp
.length
= sizeof(wp
);
419 if (IsIconic(hWnd
) && GetWindowPlacement(hWnd
, &wp
))
420 return MonitorFromRect( &wp
.rcNormalPosition
, dwFlags
);
422 if (GetWindowRect( hWnd
, &rect
))
423 return MonitorFromRect( &rect
, dwFlags
);
425 if (!(dwFlags
& (MONITOR_DEFAULTTOPRIMARY
|MONITOR_DEFAULTTONEAREST
))) return 0;
426 /* retrieve the primary */
427 SetRect( &rect
, 0, 0, 1, 1 );
428 return MonitorFromRect( &rect
, dwFlags
);
431 /***********************************************************************
432 * GetMonitorInfoA (USER32.@)
434 BOOL WINAPI
GetMonitorInfoA(HMONITOR hMonitor
, LPMONITORINFO lpMonitorInfo
)
437 MONITORINFOEXA
*miA
= (MONITORINFOEXA
*)lpMonitorInfo
;
440 if((miA
->cbSize
!= sizeof(MONITORINFOEXA
)) && (miA
->cbSize
!= sizeof(MONITORINFO
)))
443 miW
.cbSize
= sizeof(miW
);
445 ret
= GetMonitorInfoW(hMonitor
, (MONITORINFO
*)&miW
);
448 miA
->rcMonitor
= miW
.rcMonitor
;
449 miA
->rcWork
= miW
.rcWork
;
450 miA
->dwFlags
= miW
.dwFlags
;
451 if(miA
->cbSize
== sizeof(MONITORINFOEXA
))
452 WideCharToMultiByte(CP_ACP
, 0, miW
.szDevice
, -1, miA
->szDevice
, sizeof(miA
->szDevice
), NULL
, NULL
);
456 /***********************************************************************
457 * GetMonitorInfoW (USER32.@)
459 BOOL WINAPI
GetMonitorInfoW(HMONITOR hMonitor
, LPMONITORINFO lpMonitorInfo
)
463 if (lpMonitorInfo
->cbSize
!= sizeof(MONITORINFOEXW
) && lpMonitorInfo
->cbSize
!= sizeof(MONITORINFO
))
466 ret
= USER_Driver
->pGetMonitorInfo( hMonitor
, lpMonitorInfo
);
468 TRACE("flags %04x, monitor %s, work %s\n", lpMonitorInfo
->dwFlags
,
469 wine_dbgstr_rect(&lpMonitorInfo
->rcMonitor
),
470 wine_dbgstr_rect(&lpMonitorInfo
->rcWork
));
475 /* Some apps pass a non-stdcall callback to EnumDisplayMonitors,
476 * so we need a small assembly wrapper to call it.
477 * MJ's Help Diagnostic expects that %ecx contains the address to the rect.
479 struct enumdisplaymonitors_lparam
481 MONITORENUMPROC proc
;
485 extern BOOL CALLBACK
enumdisplaymonitors_callback_wrapper(HMONITOR monitor
, HDC hdc
, LPRECT rect
, LPARAM lparam
);
486 __ASM_STDCALL_FUNC( enumdisplaymonitors_callback_wrapper
, 16,
488 __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
489 __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
491 __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
493 "movl 20(%ebp),%eax\n\t" /* struct enumdisplaymonitors_lparam *orig = (struct enumdisplaymonitors_lparam*)lparam */
494 "pushl 4(%eax)\n\t" /* push orig->lparam */
498 "movl 16(%ebp),%ecx\n\t"
499 "call *(%eax)\n\t" /* call orig->proc */
501 __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
502 __ASM_CFI(".cfi_same_value %ebp\n\t")
504 #endif /* __i386__ */
506 /***********************************************************************
507 * EnumDisplayMonitors (USER32.@)
509 BOOL WINAPI
EnumDisplayMonitors( HDC hdc
, LPRECT rect
, MONITORENUMPROC proc
, LPARAM lp
)
512 struct enumdisplaymonitors_lparam orig
= { proc
, lp
};
513 proc
= enumdisplaymonitors_callback_wrapper
;
516 return USER_Driver
->pEnumDisplayMonitors( hdc
, rect
, proc
, lp
);
520 /***********************************************************************
521 * QueryDisplayConfig (USER32.@)
523 LONG WINAPI
QueryDisplayConfig(UINT32 flags
, UINT32
*numpathelements
, DISPLAYCONFIG_PATH_INFO
*pathinfo
,
524 UINT32
*numinfoelements
, DISPLAYCONFIG_MODE_INFO
*modeinfo
,
525 DISPLAYCONFIG_TOPOLOGY_ID
*topologyid
)
527 FIXME("(%08x %p %p %p %p %p)\n", flags
, numpathelements
, pathinfo
, numinfoelements
, modeinfo
, topologyid
);
528 return ERROR_CALL_NOT_IMPLEMENTED
;
531 /***********************************************************************
532 * RegisterSystemThread (USER32.@)
534 void WINAPI
RegisterSystemThread(DWORD flags
, DWORD reserved
)
536 FIXME("(%08x, %08x)\n", flags
, reserved
);
539 /***********************************************************************
540 * RegisterShellHookWindow [USER32.@]
542 BOOL WINAPI
RegisterShellHookWindow(HWND hWnd
)
544 FIXME("(%p): stub\n", hWnd
);
549 /***********************************************************************
550 * DeregisterShellHookWindow [USER32.@]
552 BOOL WINAPI
DeregisterShellHookWindow(HWND hWnd
)
554 FIXME("(%p): stub\n", hWnd
);
559 /***********************************************************************
560 * RegisterTasklist [USER32.@]
562 DWORD WINAPI
RegisterTasklist (DWORD x
)
569 /***********************************************************************
570 * RegisterDeviceNotificationA (USER32.@)
572 * See RegisterDeviceNotificationW.
574 HDEVNOTIFY WINAPI
RegisterDeviceNotificationA(HANDLE hnd
, LPVOID notifyfilter
, DWORD flags
)
576 FIXME("(hwnd=%p, filter=%p,flags=0x%08x) returns a fake device notification handle!\n",
577 hnd
,notifyfilter
,flags
);
578 return (HDEVNOTIFY
) 0xcafecafe;
581 /***********************************************************************
582 * RegisterDeviceNotificationW (USER32.@)
584 * Registers a window with the system so that it will receive
585 * notifications about a device.
588 * hRecipient [I] Window or service status handle that
589 * will receive notifications.
590 * pNotificationFilter [I] DEV_BROADCAST_HDR followed by some
591 * type-specific data.
592 * dwFlags [I] See notes
596 * A handle to the device notification.
600 * The dwFlags parameter can be one of two values:
601 *| DEVICE_NOTIFY_WINDOW_HANDLE - hRecipient is a window handle
602 *| DEVICE_NOTIFY_SERVICE_HANDLE - hRecipient is a service status handle
604 HDEVNOTIFY WINAPI
RegisterDeviceNotificationW(HANDLE hRecipient
, LPVOID pNotificationFilter
, DWORD dwFlags
)
606 FIXME("(hwnd=%p, filter=%p,flags=0x%08x) returns a fake device notification handle!\n",
607 hRecipient
,pNotificationFilter
,dwFlags
);
608 return (HDEVNOTIFY
) 0xcafeaffe;
611 /***********************************************************************
612 * UnregisterDeviceNotification (USER32.@)
615 BOOL WINAPI
UnregisterDeviceNotification(HDEVNOTIFY hnd
)
617 FIXME("(handle=%p), STUB!\n", hnd
);
621 /***********************************************************************
622 * GetAppCompatFlags (USER32.@)
624 DWORD WINAPI
GetAppCompatFlags( HTASK hTask
)
626 FIXME("(%p) stub\n", hTask
);
630 /***********************************************************************
631 * GetAppCompatFlags2 (USER32.@)
633 DWORD WINAPI
GetAppCompatFlags2( HTASK hTask
)
635 FIXME("(%p) stub\n", hTask
);
640 /***********************************************************************
641 * AlignRects (USER32.@)
643 BOOL WINAPI
AlignRects(LPRECT rect
, DWORD b
, DWORD c
, DWORD d
)
645 FIXME("(%p, %d, %d, %d): stub\n", rect
, b
, c
, d
);
647 FIXME("rect: %s\n", wine_dbgstr_rect(rect
));
648 /* Calls OffsetRect */
653 /***********************************************************************
654 * LoadLocalFonts (USER32.@)
656 VOID WINAPI
LoadLocalFonts(VOID
)
663 /***********************************************************************
664 * User32InitializeImmEntryTable
666 BOOL WINAPI
User32InitializeImmEntryTable(DWORD magic
)
668 static const WCHAR imm32_dllW
[] = {'i','m','m','3','2','.','d','l','l',0};
669 HMODULE imm32
= GetModuleHandleW(imm32_dllW
);
671 TRACE("(%x)\n", magic
);
673 if (!imm32
|| magic
!= IMM_INIT_MAGIC
)
676 if (imm_get_ui_window
)
679 WM_MSIME_SERVICE
= RegisterWindowMessageA("MSIMEService");
680 WM_MSIME_RECONVERTOPTIONS
= RegisterWindowMessageA("MSIMEReconvertOptions");
681 WM_MSIME_MOUSE
= RegisterWindowMessageA("MSIMEMouseOperation");
682 WM_MSIME_RECONVERTREQUEST
= RegisterWindowMessageA("MSIMEReconvertRequest");
683 WM_MSIME_RECONVERT
= RegisterWindowMessageA("MSIMEReconvert");
684 WM_MSIME_QUERYPOSITION
= RegisterWindowMessageA("MSIMEQueryPosition");
685 WM_MSIME_DOCUMENTFEED
= RegisterWindowMessageA("MSIMEDocumentFeed");
687 /* this part is not compatible with native imm32.dll */
688 imm_get_ui_window
= (void*)GetProcAddress(imm32
, "__wine_get_ui_window");
689 imm_register_window
= (void*)GetProcAddress(imm32
, "__wine_register_window");
690 imm_unregister_window
= (void*)GetProcAddress(imm32
, "__wine_unregister_window");
691 if (!imm_get_ui_window
)
692 FIXME("native imm32.dll not supported\n");
696 /**********************************************************************
697 * WINNLSGetIMEHotkey [USER32.@]
700 UINT WINAPI
WINNLSGetIMEHotkey(HWND hwnd
)
702 FIXME("hwnd %p: stub!\n", hwnd
);
703 return 0; /* unknown */
706 /**********************************************************************
707 * WINNLSEnableIME [USER32.@]
710 BOOL WINAPI
WINNLSEnableIME(HWND hwnd
, BOOL enable
)
712 FIXME("hwnd %p enable %d: stub!\n", hwnd
, enable
);
713 return TRUE
; /* success (?) */
716 /**********************************************************************
717 * WINNLSGetEnableStatus [USER32.@]
720 BOOL WINAPI
WINNLSGetEnableStatus(HWND hwnd
)
722 FIXME("hwnd %p: stub!\n", hwnd
);
723 return TRUE
; /* success (?) */
726 /**********************************************************************
727 * SendIMEMessageExA [USER32.@]
730 LRESULT WINAPI
SendIMEMessageExA(HWND hwnd
, LPARAM lparam
)
732 FIXME("(%p,%lx): stub\n", hwnd
, lparam
);
733 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
737 /**********************************************************************
738 * SendIMEMessageExW [USER32.@]
741 LRESULT WINAPI
SendIMEMessageExW(HWND hwnd
, LPARAM lparam
)
743 FIXME("(%p,%lx): stub\n", hwnd
, lparam
);
744 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
748 /**********************************************************************
749 * DisableProcessWindowsGhosting [USER32.@]
752 VOID WINAPI
DisableProcessWindowsGhosting(VOID
)
755 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
759 /**********************************************************************
760 * UserHandleGrantAccess [USER32.@]
763 BOOL WINAPI
UserHandleGrantAccess(HANDLE handle
, HANDLE job
, BOOL grant
)
765 FIXME("(%p,%p,%d): stub\n", handle
, job
, grant
);
769 /**********************************************************************
770 * RegisterPowerSettingNotification [USER32.@]
772 HPOWERNOTIFY WINAPI
RegisterPowerSettingNotification(HANDLE recipient
, const GUID
*guid
, DWORD flags
)
774 FIXME("(%p,%s,%x): stub\n", recipient
, debugstr_guid(guid
), flags
);
775 return (HPOWERNOTIFY
)0xdeadbeef;
778 /**********************************************************************
779 * UnregisterPowerSettingNotification [USER32.@]
781 BOOL WINAPI
UnregisterPowerSettingNotification(HPOWERNOTIFY handle
)
783 FIXME("(%p): stub\n", handle
);
787 /*****************************************************************************
788 * GetGestureConfig (USER32.@)
790 BOOL WINAPI
GetGestureConfig( HWND hwnd
, DWORD reserved
, DWORD flags
, UINT
*count
, GESTURECONFIG
*config
, UINT size
)
792 FIXME("(%p %08x %08x %p %p %u): stub\n", hwnd
, reserved
, flags
, count
, config
, size
);
793 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
797 /**********************************************************************
798 * SetGestureConfig [USER32.@]
800 BOOL WINAPI
SetGestureConfig( HWND hwnd
, DWORD reserved
, UINT id
, PGESTURECONFIG config
, UINT size
)
802 FIXME("(%p %08x %u %p %u): stub\n", hwnd
, reserved
, id
, config
, size
);
803 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
807 /**********************************************************************
808 * IsTouchWindow [USER32.@]
810 BOOL WINAPI
IsTouchWindow( HWND hwnd
, PULONG flags
)
812 FIXME("(%p %p): stub\n", hwnd
, flags
);
816 /**********************************************************************
817 * IsWindowRedirectedForPrint [USER32.@]
819 BOOL WINAPI
IsWindowRedirectedForPrint( HWND hwnd
)
821 FIXME("(%p): stub\n", hwnd
);
825 /**********************************************************************
826 * GetDisplayConfigBufferSizes [USER32.@]
828 LONG WINAPI
GetDisplayConfigBufferSizes(UINT32 flags
, UINT32
*num_path_info
, UINT32
*num_mode_info
)
830 FIXME("(0x%x %p %p): stub\n", flags
, num_path_info
, num_mode_info
);
832 if (!num_path_info
|| !num_mode_info
)
833 return ERROR_INVALID_PARAMETER
;
837 return ERROR_NOT_SUPPORTED
;
840 static const WCHAR imeW
[] = {'I','M','E',0};
841 const struct builtin_class_descr IME_builtin_class
=
845 WINPROC_IME
, /* proc */
846 2*sizeof(LONG_PTR
), /* extra */
847 IDC_ARROW
, /* cursor */
851 static BOOL
is_ime_ui_msg( UINT msg
)
854 case WM_IME_STARTCOMPOSITION
:
855 case WM_IME_ENDCOMPOSITION
:
856 case WM_IME_COMPOSITION
:
857 case WM_IME_SETCONTEXT
:
860 case WM_IME_COMPOSITIONFULL
:
868 if ((msg
== WM_MSIME_RECONVERTOPTIONS
) ||
869 (msg
== WM_MSIME_SERVICE
) ||
870 (msg
== WM_MSIME_MOUSE
) ||
871 (msg
== WM_MSIME_RECONVERTREQUEST
) ||
872 (msg
== WM_MSIME_RECONVERT
) ||
873 (msg
== WM_MSIME_QUERYPOSITION
) ||
874 (msg
== WM_MSIME_DOCUMENTFEED
))
881 LRESULT WINAPI
ImeWndProcA( HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
888 if (imm_get_ui_window
&& is_ime_ui_msg(msg
))
890 if ((uiwnd
= imm_get_ui_window(GetKeyboardLayout(0))))
891 return SendMessageA(uiwnd
, msg
, wParam
, lParam
);
895 return DefWindowProcA(hwnd
, msg
, wParam
, lParam
);
898 LRESULT WINAPI
ImeWndProcW( HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
905 if (imm_get_ui_window
&& is_ime_ui_msg(msg
))
907 if ((uiwnd
= imm_get_ui_window(GetKeyboardLayout(0))))
908 return SendMessageW(uiwnd
, msg
, wParam
, lParam
);
912 return DefWindowProcW(hwnd
, msg
, wParam
, lParam
);