2000-08-04 06:21:02 +02:00
|
|
|
/*
|
|
|
|
* Misc USER functions
|
|
|
|
*
|
|
|
|
* Copyright 1995 Thomas Sandford
|
|
|
|
* Copyright 1997 Marcus Meissner
|
2005-06-09 12:07:04 +02:00
|
|
|
* Copyright 1998 Turchanov Sergey
|
2020-05-05 18:25:40 +02:00
|
|
|
* Copyright 2019 Micah N Gorrell for CodeWeavers
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-08-04 06:21:02 +02:00
|
|
|
*/
|
|
|
|
|
2016-03-24 03:46:32 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2000-08-04 06:21:02 +02:00
|
|
|
#include "windef.h"
|
2005-05-25 20:42:37 +02:00
|
|
|
#include "wine/windef16.h"
|
2000-08-04 06:21:02 +02:00
|
|
|
#include "winbase.h"
|
2005-04-27 13:09:55 +02:00
|
|
|
#include "wingdi.h"
|
2014-11-10 13:46:18 +01:00
|
|
|
#include "controls.h"
|
2006-10-23 13:51:30 +02:00
|
|
|
#include "user_private.h"
|
2020-05-05 18:25:40 +02:00
|
|
|
#include "dbt.h"
|
2000-08-04 06:21:02 +02:00
|
|
|
|
2005-06-09 12:07:04 +02:00
|
|
|
#include "wine/unicode.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2000-08-04 06:21:02 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(win);
|
2000-08-04 06:21:02 +02:00
|
|
|
|
2014-11-10 13:46:18 +01:00
|
|
|
#define IMM_INIT_MAGIC 0x19650412
|
|
|
|
static HWND (WINAPI *imm_get_ui_window)(HKL);
|
2016-08-23 15:13:27 +02:00
|
|
|
BOOL (WINAPI *imm_register_window)(HWND) = NULL;
|
|
|
|
void (WINAPI *imm_unregister_window)(HWND) = NULL;
|
2014-11-10 13:46:18 +01:00
|
|
|
|
|
|
|
/* MSIME messages */
|
|
|
|
static UINT WM_MSIME_SERVICE;
|
|
|
|
static UINT WM_MSIME_RECONVERTOPTIONS;
|
|
|
|
static UINT WM_MSIME_MOUSE;
|
|
|
|
static UINT WM_MSIME_RECONVERTREQUEST;
|
|
|
|
static UINT WM_MSIME_RECONVERT;
|
|
|
|
static UINT WM_MSIME_QUERYPOSITION;
|
|
|
|
static UINT WM_MSIME_DOCUMENTFEED;
|
|
|
|
|
2005-05-25 20:42:37 +02:00
|
|
|
/* USER signal proc flags and codes */
|
|
|
|
/* See UserSignalProc for comments */
|
|
|
|
#define USIG_FLAGS_WIN32 0x0001
|
|
|
|
#define USIG_FLAGS_GUI 0x0002
|
|
|
|
#define USIG_FLAGS_FEEDBACK 0x0004
|
|
|
|
#define USIG_FLAGS_FAULT 0x0008
|
|
|
|
|
|
|
|
#define USIG_DLL_UNLOAD_WIN16 0x0001
|
|
|
|
#define USIG_DLL_UNLOAD_WIN32 0x0002
|
|
|
|
#define USIG_FAULT_DIALOG_PUSH 0x0003
|
|
|
|
#define USIG_FAULT_DIALOG_POP 0x0004
|
|
|
|
#define USIG_DLL_UNLOAD_ORPHANS 0x0005
|
|
|
|
#define USIG_THREAD_INIT 0x0010
|
|
|
|
#define USIG_THREAD_EXIT 0x0020
|
|
|
|
#define USIG_PROCESS_CREATE 0x0100
|
|
|
|
#define USIG_PROCESS_INIT 0x0200
|
|
|
|
#define USIG_PROCESS_EXIT 0x0300
|
|
|
|
#define USIG_PROCESS_DESTROY 0x0400
|
|
|
|
#define USIG_PROCESS_RUNNING 0x0500
|
|
|
|
#define USIG_PROCESS_LOADED 0x0600
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SignalProc32 (USER.391)
|
|
|
|
* UserSignalProc (USER32.@)
|
|
|
|
*
|
|
|
|
* The exact meaning of the USER signals is undocumented, but this
|
|
|
|
* should cover the basic idea:
|
|
|
|
*
|
|
|
|
* USIG_DLL_UNLOAD_WIN16
|
|
|
|
* This is sent when a 16-bit module is unloaded.
|
|
|
|
*
|
|
|
|
* USIG_DLL_UNLOAD_WIN32
|
|
|
|
* This is sent when a 32-bit module is unloaded.
|
|
|
|
*
|
|
|
|
* USIG_DLL_UNLOAD_ORPHANS
|
|
|
|
* This is sent after the last Win3.1 module is unloaded,
|
|
|
|
* to allow removal of orphaned menus.
|
|
|
|
*
|
|
|
|
* USIG_FAULT_DIALOG_PUSH
|
|
|
|
* USIG_FAULT_DIALOG_POP
|
|
|
|
* These are called to allow USER to prepare for displaying a
|
|
|
|
* fault dialog, even though the fault might have happened while
|
|
|
|
* inside a USER critical section.
|
|
|
|
*
|
|
|
|
* USIG_THREAD_INIT
|
|
|
|
* This is called from the context of a new thread, as soon as it
|
|
|
|
* has started to run.
|
|
|
|
*
|
|
|
|
* USIG_THREAD_EXIT
|
|
|
|
* This is called, still in its context, just before a thread is
|
|
|
|
* about to terminate.
|
|
|
|
*
|
|
|
|
* USIG_PROCESS_CREATE
|
|
|
|
* This is called, in the parent process context, after a new process
|
|
|
|
* has been created.
|
|
|
|
*
|
|
|
|
* USIG_PROCESS_INIT
|
|
|
|
* This is called in the new process context, just after the main thread
|
|
|
|
* has started execution (after the main thread's USIG_THREAD_INIT has
|
|
|
|
* been sent).
|
|
|
|
*
|
|
|
|
* USIG_PROCESS_LOADED
|
|
|
|
* This is called after the executable file has been loaded into the
|
|
|
|
* new process context.
|
|
|
|
*
|
|
|
|
* USIG_PROCESS_RUNNING
|
|
|
|
* This is called immediately before the main entry point is called.
|
|
|
|
*
|
|
|
|
* USIG_PROCESS_EXIT
|
|
|
|
* This is called in the context of a process that is about to
|
|
|
|
* terminate (but before the last thread's USIG_THREAD_EXIT has
|
|
|
|
* been sent).
|
|
|
|
*
|
|
|
|
* USIG_PROCESS_DESTROY
|
|
|
|
* This is called after a process has terminated.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* The meaning of the dwFlags bits is as follows:
|
|
|
|
*
|
|
|
|
* USIG_FLAGS_WIN32
|
|
|
|
* Current process is 32-bit.
|
|
|
|
*
|
|
|
|
* USIG_FLAGS_GUI
|
|
|
|
* Current process is a (Win32) GUI process.
|
|
|
|
*
|
|
|
|
* USIG_FLAGS_FEEDBACK
|
|
|
|
* Current process needs 'feedback' (determined from the STARTUPINFO
|
|
|
|
* flags STARTF_FORCEONFEEDBACK / STARTF_FORCEOFFFEEDBACK).
|
|
|
|
*
|
|
|
|
* USIG_FLAGS_FAULT
|
|
|
|
* The signal is being sent due to a fault.
|
|
|
|
*/
|
|
|
|
WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID,
|
|
|
|
DWORD dwFlags, HMODULE16 hModule )
|
|
|
|
{
|
2006-09-30 00:25:15 +02:00
|
|
|
FIXME("(%04x, %08x, %04x, %04x)\n",
|
2005-05-25 20:42:37 +02:00
|
|
|
uCode, dwThreadOrProcessID, dwFlags, hModule );
|
|
|
|
/* FIXME: Should chain to GdiSignalProc now. */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-04 06:21:02 +02:00
|
|
|
/**********************************************************************
|
2005-04-20 17:18:42 +02:00
|
|
|
* SetLastErrorEx [USER32.@]
|
|
|
|
*
|
|
|
|
* Sets the last-error code.
|
2000-08-04 06:21:02 +02:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* None.
|
|
|
|
*/
|
|
|
|
void WINAPI SetLastErrorEx(
|
|
|
|
DWORD error, /* [in] Per-thread error code */
|
|
|
|
DWORD type) /* [in] Error type */
|
|
|
|
{
|
2006-09-30 00:25:15 +02:00
|
|
|
TRACE("(0x%08x, 0x%08x)\n", error,type);
|
2000-08-04 06:21:02 +02:00
|
|
|
switch(type) {
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case SLE_ERROR:
|
|
|
|
case SLE_MINORERROR:
|
|
|
|
case SLE_WARNING:
|
|
|
|
/* Fall through for now */
|
|
|
|
default:
|
2006-09-30 00:25:15 +02:00
|
|
|
FIXME("(error=%08x, type=%08x): Unhandled type\n", error,type);
|
2000-08-04 06:21:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
SetLastError( error );
|
|
|
|
}
|
|
|
|
|
2005-04-20 17:18:42 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* GetAltTabInfoA [USER32.@]
|
|
|
|
*/
|
2005-01-03 18:02:34 +01:00
|
|
|
BOOL WINAPI GetAltTabInfoA(HWND hwnd, int iItem, PALTTABINFO pati, LPSTR pszItemText, UINT cchItemText)
|
|
|
|
{
|
|
|
|
FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd, iItem, pati, pszItemText, cchItemText);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2005-04-20 17:18:42 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* GetAltTabInfoW [USER32.@]
|
|
|
|
*/
|
2005-01-03 18:02:34 +01:00
|
|
|
BOOL WINAPI GetAltTabInfoW(HWND hwnd, int iItem, PALTTABINFO pati, LPWSTR pszItemText, UINT cchItemText)
|
|
|
|
{
|
|
|
|
FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd, iItem, pati, pszItemText, cchItemText);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2000-08-04 06:21:02 +02:00
|
|
|
|
|
|
|
/******************************************************************************
|
2001-01-25 23:22:21 +01:00
|
|
|
* SetDebugErrorLevel [USER32.@]
|
2000-08-04 06:21:02 +02:00
|
|
|
* Sets the minimum error level for generating debugging events
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* dwLevel [I] Debugging error level
|
2005-11-09 11:33:40 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
2000-08-04 06:21:02 +02:00
|
|
|
*/
|
|
|
|
VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
|
|
|
|
{
|
2006-09-30 00:25:15 +02:00
|
|
|
FIXME("(%d): stub\n", dwLevel);
|
2000-08-04 06:21:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-27 13:09:55 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* SetWindowStationUser (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2)
|
|
|
|
{
|
2006-09-30 00:25:15 +02:00
|
|
|
FIXME("(0x%08x,0x%08x),stub!\n",x1,x2);
|
2005-04-27 13:09:55 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* RegisterLogonProcess (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI RegisterLogonProcess(HANDLE hprocess,BOOL x)
|
|
|
|
{
|
|
|
|
FIXME("(%p,%d),stub!\n",hprocess,x);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SetLogonNotifyWindow (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI SetLogonNotifyWindow(HWINSTA hwinsta,HWND hwnd)
|
|
|
|
{
|
|
|
|
FIXME("(%p,%p),stub!\n",hwinsta,hwnd);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* RegisterSystemThread (USER32.@)
|
|
|
|
*/
|
|
|
|
void WINAPI RegisterSystemThread(DWORD flags, DWORD reserved)
|
|
|
|
{
|
2006-09-30 00:25:15 +02:00
|
|
|
FIXME("(%08x, %08x)\n", flags, reserved);
|
2005-04-27 13:09:55 +02:00
|
|
|
}
|
2000-08-04 06:21:02 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-01-25 23:22:21 +01:00
|
|
|
* RegisterShellHookWindow [USER32.@]
|
2000-08-04 06:21:02 +02:00
|
|
|
*/
|
2016-09-13 23:10:45 +02:00
|
|
|
BOOL WINAPI RegisterShellHookWindow(HWND hWnd)
|
2000-08-04 06:21:02 +02:00
|
|
|
{
|
2003-01-13 21:36:39 +01:00
|
|
|
FIXME("(%p): stub\n", hWnd);
|
2013-11-05 01:05:02 +01:00
|
|
|
return FALSE;
|
2000-08-04 06:21:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-01-25 23:22:21 +01:00
|
|
|
* DeregisterShellHookWindow [USER32.@]
|
2000-08-04 06:21:02 +02:00
|
|
|
*/
|
2016-09-13 23:10:45 +02:00
|
|
|
BOOL WINAPI DeregisterShellHookWindow(HWND hWnd)
|
2000-08-04 06:21:02 +02:00
|
|
|
{
|
2016-09-13 23:10:45 +02:00
|
|
|
FIXME("(%p): stub\n", hWnd);
|
|
|
|
return FALSE;
|
2000-08-04 06:21:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-01-25 23:22:21 +01:00
|
|
|
* RegisterTasklist [USER32.@]
|
2000-08-04 06:21:02 +02:00
|
|
|
*/
|
2000-11-25 22:43:04 +01:00
|
|
|
DWORD WINAPI RegisterTasklist (DWORD x)
|
2000-08-04 06:21:02 +02:00
|
|
|
{
|
2006-09-30 00:25:15 +02:00
|
|
|
FIXME("0x%08x\n",x);
|
2000-08-04 06:21:02 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
2000-08-06 04:42:46 +02:00
|
|
|
|
2020-05-05 18:25:40 +02:00
|
|
|
static DWORD CALLBACK devnotify_window_callback(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
|
|
|
|
{
|
|
|
|
SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static DWORD CALLBACK devnotify_service_callback(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
|
|
|
|
{
|
|
|
|
FIXME("Support for service handles is not yet implemented!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct device_notification_details
|
|
|
|
{
|
|
|
|
DWORD (CALLBACK *cb)(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header);
|
|
|
|
HANDLE handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern HDEVNOTIFY WINAPI I_ScRegisterDeviceNotification( struct device_notification_details *details,
|
|
|
|
void *filter, DWORD flags );
|
|
|
|
extern BOOL WINAPI I_ScUnregisterDeviceNotification( HDEVNOTIFY handle );
|
2002-07-29 01:48:27 +02:00
|
|
|
|
2005-04-27 13:09:55 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* RegisterDeviceNotificationA (USER32.@)
|
|
|
|
*
|
|
|
|
* See RegisterDeviceNotificationW.
|
|
|
|
*/
|
2020-05-05 18:25:40 +02:00
|
|
|
HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE hRecipient, LPVOID pNotificationFilter, DWORD dwFlags)
|
2005-04-27 13:09:55 +02:00
|
|
|
{
|
2020-05-05 18:25:40 +02:00
|
|
|
TRACE("(hwnd=%p, filter=%p,flags=0x%08x)\n",
|
|
|
|
hRecipient,pNotificationFilter,dwFlags);
|
|
|
|
if (pNotificationFilter)
|
|
|
|
FIXME("The notification filter will requires an A->W when filter support is implemented\n");
|
|
|
|
return RegisterDeviceNotificationW(hRecipient, pNotificationFilter, dwFlags);
|
2005-04-27 13:09:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* RegisterDeviceNotificationW (USER32.@)
|
|
|
|
*/
|
2020-05-05 18:25:40 +02:00
|
|
|
HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE handle, void *filter, DWORD flags )
|
2005-04-27 13:09:55 +02:00
|
|
|
{
|
2020-05-05 18:25:40 +02:00
|
|
|
struct device_notification_details details;
|
|
|
|
|
|
|
|
TRACE("handle %p, filter %p, flags %#x\n", handle, filter, flags);
|
|
|
|
|
|
|
|
if (flags & ~(DEVICE_NOTIFY_SERVICE_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES))
|
|
|
|
FIXME("unhandled flags %#x\n", flags);
|
|
|
|
|
|
|
|
details.handle = handle;
|
|
|
|
|
|
|
|
if (flags & DEVICE_NOTIFY_SERVICE_HANDLE)
|
|
|
|
details.cb = devnotify_service_callback;
|
|
|
|
else
|
|
|
|
details.cb = devnotify_window_callback;
|
|
|
|
|
|
|
|
return I_ScRegisterDeviceNotification( &details, filter, 0 );
|
2005-04-27 13:09:55 +02:00
|
|
|
}
|
|
|
|
|
2005-10-03 12:17:05 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* UnregisterDeviceNotification (USER32.@)
|
|
|
|
*/
|
2020-05-05 18:25:40 +02:00
|
|
|
BOOL WINAPI UnregisterDeviceNotification( HDEVNOTIFY handle )
|
2005-10-03 12:17:05 +02:00
|
|
|
{
|
2020-05-05 18:25:40 +02:00
|
|
|
TRACE("%p\n", handle);
|
|
|
|
|
|
|
|
return I_ScUnregisterDeviceNotification( handle );
|
2005-10-03 12:17:05 +02:00
|
|
|
}
|
|
|
|
|
2002-07-29 01:48:27 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* GetAppCompatFlags (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI GetAppCompatFlags( HTASK hTask )
|
|
|
|
{
|
2007-07-31 05:27:55 +02:00
|
|
|
FIXME("(%p) stub\n", hTask);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetAppCompatFlags2 (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI GetAppCompatFlags2( HTASK hTask )
|
|
|
|
{
|
|
|
|
FIXME("(%p) stub\n", hTask);
|
2002-07-29 01:48:27 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-01-13 21:36:39 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* AlignRects (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
|
|
|
|
{
|
2006-09-30 00:25:15 +02:00
|
|
|
FIXME("(%p, %d, %d, %d): stub\n", rect, b, c, d);
|
2003-01-13 21:36:39 +01:00
|
|
|
if (rect)
|
2016-04-26 20:58:55 +02:00
|
|
|
FIXME("rect: %s\n", wine_dbgstr_rect(rect));
|
2003-01-13 21:36:39 +01:00
|
|
|
/* Calls OffsetRect */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-27 13:09:55 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* LoadLocalFonts (USER32.@)
|
|
|
|
*/
|
|
|
|
VOID WINAPI LoadLocalFonts(VOID)
|
|
|
|
{
|
|
|
|
/* are loaded. */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-01 04:12:41 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* User32InitializeImmEntryTable
|
|
|
|
*/
|
2014-11-10 13:46:18 +01:00
|
|
|
BOOL WINAPI User32InitializeImmEntryTable(DWORD magic)
|
2005-01-07 18:15:30 +01:00
|
|
|
{
|
2014-11-10 13:46:18 +01:00
|
|
|
static const WCHAR imm32_dllW[] = {'i','m','m','3','2','.','d','l','l',0};
|
|
|
|
HMODULE imm32 = GetModuleHandleW(imm32_dllW);
|
|
|
|
|
|
|
|
TRACE("(%x)\n", magic);
|
|
|
|
|
|
|
|
if (!imm32 || magic != IMM_INIT_MAGIC)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (imm_get_ui_window)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
WM_MSIME_SERVICE = RegisterWindowMessageA("MSIMEService");
|
|
|
|
WM_MSIME_RECONVERTOPTIONS = RegisterWindowMessageA("MSIMEReconvertOptions");
|
|
|
|
WM_MSIME_MOUSE = RegisterWindowMessageA("MSIMEMouseOperation");
|
|
|
|
WM_MSIME_RECONVERTREQUEST = RegisterWindowMessageA("MSIMEReconvertRequest");
|
|
|
|
WM_MSIME_RECONVERT = RegisterWindowMessageA("MSIMEReconvert");
|
|
|
|
WM_MSIME_QUERYPOSITION = RegisterWindowMessageA("MSIMEQueryPosition");
|
|
|
|
WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed");
|
|
|
|
|
|
|
|
/* this part is not compatible with native imm32.dll */
|
|
|
|
imm_get_ui_window = (void*)GetProcAddress(imm32, "__wine_get_ui_window");
|
2016-08-23 15:13:27 +02:00
|
|
|
imm_register_window = (void*)GetProcAddress(imm32, "__wine_register_window");
|
|
|
|
imm_unregister_window = (void*)GetProcAddress(imm32, "__wine_unregister_window");
|
2014-11-10 13:46:18 +01:00
|
|
|
if (!imm_get_ui_window)
|
|
|
|
FIXME("native imm32.dll not supported\n");
|
|
|
|
return TRUE;
|
2005-01-07 18:15:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* WINNLSGetIMEHotkey [USER32.@]
|
|
|
|
*
|
|
|
|
*/
|
2011-06-25 00:09:11 +02:00
|
|
|
UINT WINAPI WINNLSGetIMEHotkey(HWND hwnd)
|
2005-01-07 18:15:30 +01:00
|
|
|
{
|
2011-06-25 00:09:11 +02:00
|
|
|
FIXME("hwnd %p: stub!\n", hwnd);
|
2005-01-07 18:15:30 +01:00
|
|
|
return 0; /* unknown */
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* WINNLSEnableIME [USER32.@]
|
|
|
|
*
|
|
|
|
*/
|
2011-06-25 00:09:11 +02:00
|
|
|
BOOL WINAPI WINNLSEnableIME(HWND hwnd, BOOL enable)
|
2005-01-07 18:15:30 +01:00
|
|
|
{
|
2011-06-25 00:09:11 +02:00
|
|
|
FIXME("hwnd %p enable %d: stub!\n", hwnd, enable);
|
2005-01-07 18:15:30 +01:00
|
|
|
return TRUE; /* success (?) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* WINNLSGetEnableStatus [USER32.@]
|
|
|
|
*
|
|
|
|
*/
|
2011-06-25 00:09:11 +02:00
|
|
|
BOOL WINAPI WINNLSGetEnableStatus(HWND hwnd)
|
2005-01-07 18:15:30 +01:00
|
|
|
{
|
2011-06-25 00:09:11 +02:00
|
|
|
FIXME("hwnd %p: stub!\n", hwnd);
|
2005-01-07 18:15:30 +01:00
|
|
|
return TRUE; /* success (?) */
|
2004-04-01 04:12:41 +02:00
|
|
|
}
|
2005-01-20 20:57:58 +01:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* SendIMEMessageExA [USER32.@]
|
|
|
|
*
|
|
|
|
*/
|
2011-06-25 00:09:11 +02:00
|
|
|
LRESULT WINAPI SendIMEMessageExA(HWND hwnd, LPARAM lparam)
|
2005-01-20 20:57:58 +01:00
|
|
|
{
|
2011-06-25 00:09:11 +02:00
|
|
|
FIXME("(%p,%lx): stub\n", hwnd, lparam);
|
2005-01-20 20:57:58 +01:00
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* SendIMEMessageExW [USER32.@]
|
|
|
|
*
|
|
|
|
*/
|
2011-06-25 00:09:11 +02:00
|
|
|
LRESULT WINAPI SendIMEMessageExW(HWND hwnd, LPARAM lparam)
|
2005-01-20 20:57:58 +01:00
|
|
|
{
|
2011-06-25 00:09:11 +02:00
|
|
|
FIXME("(%p,%lx): stub\n", hwnd, lparam);
|
2005-01-20 20:57:58 +01:00
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return 0;
|
|
|
|
}
|
2009-05-27 00:54:34 +02:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* DisableProcessWindowsGhosting [USER32.@]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
VOID WINAPI DisableProcessWindowsGhosting(VOID)
|
|
|
|
{
|
|
|
|
FIXME(": stub\n");
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return;
|
|
|
|
}
|
2013-03-08 09:26:42 +01:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* UserHandleGrantAccess [USER32.@]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
BOOL WINAPI UserHandleGrantAccess(HANDLE handle, HANDLE job, BOOL grant)
|
|
|
|
{
|
|
|
|
FIXME("(%p,%p,%d): stub\n", handle, job, grant);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2014-04-07 07:21:19 +02:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* RegisterPowerSettingNotification [USER32.@]
|
|
|
|
*/
|
|
|
|
HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE recipient, const GUID *guid, DWORD flags)
|
|
|
|
{
|
|
|
|
FIXME("(%p,%s,%x): stub\n", recipient, debugstr_guid(guid), flags);
|
2015-07-17 12:37:01 +02:00
|
|
|
return (HPOWERNOTIFY)0xdeadbeef;
|
2014-04-07 07:21:19 +02:00
|
|
|
}
|
2014-06-15 22:34:49 +02:00
|
|
|
|
2015-07-17 12:36:35 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* UnregisterPowerSettingNotification [USER32.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI UnregisterPowerSettingNotification(HPOWERNOTIFY handle)
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", handle);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-03-07 18:08:41 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* GetGestureConfig (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetGestureConfig( HWND hwnd, DWORD reserved, DWORD flags, UINT *count, GESTURECONFIG *config, UINT size )
|
|
|
|
{
|
|
|
|
FIXME("(%p %08x %08x %p %p %u): stub\n", hwnd, reserved, flags, count, config, size);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2014-06-15 22:34:49 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* SetGestureConfig [USER32.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SetGestureConfig( HWND hwnd, DWORD reserved, UINT id, PGESTURECONFIG config, UINT size )
|
|
|
|
{
|
|
|
|
FIXME("(%p %08x %u %p %u): stub\n", hwnd, reserved, id, config, size);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
2014-11-27 12:17:26 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* IsTouchWindow [USER32.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsTouchWindow( HWND hwnd, PULONG flags )
|
|
|
|
{
|
|
|
|
FIXME("(%p %p): stub\n", hwnd, flags);
|
|
|
|
return FALSE;
|
2014-06-15 22:34:49 +02:00
|
|
|
}
|
2014-11-10 13:46:18 +01:00
|
|
|
|
2015-07-29 11:38:13 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* IsWindowRedirectedForPrint [USER32.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsWindowRedirectedForPrint( HWND hwnd )
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", hwnd);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2018-06-04 15:51:26 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* RegisterPointerDeviceNotifications [USER32.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI RegisterPointerDeviceNotifications(HWND hwnd, BOOL notifyrange)
|
|
|
|
{
|
|
|
|
FIXME("(%p %d): stub\n", hwnd, notifyrange);
|
2018-06-07 23:46:54 +02:00
|
|
|
return TRUE;
|
2018-06-04 15:51:26 +02:00
|
|
|
}
|
|
|
|
|
2018-06-07 23:46:55 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* GetPointerDevices [USER32.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetPointerDevices(UINT32 *device_count, POINTER_DEVICE_INFO *devices)
|
|
|
|
{
|
|
|
|
FIXME("(%p %p): partial stub\n", device_count, devices);
|
|
|
|
|
|
|
|
if (!device_count)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (devices)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
*device_count = 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2018-06-07 23:46:56 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* RegisterTouchHitTestingWindow [USER32.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI RegisterTouchHitTestingWindow(HWND hwnd, ULONG value)
|
|
|
|
{
|
|
|
|
FIXME("(%p %d): stub\n", hwnd, value);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-04-26 14:21:03 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* GetPointerType [USER32.@]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetPointerType(UINT32 id, POINTER_INPUT_TYPE *type)
|
|
|
|
{
|
|
|
|
FIXME("(%d %p): stub\n", id, type);
|
|
|
|
|
|
|
|
if(!id || !type)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*type = PT_MOUSE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2018-06-07 23:46:55 +02:00
|
|
|
|
2014-11-10 13:46:18 +01:00
|
|
|
static const WCHAR imeW[] = {'I','M','E',0};
|
|
|
|
const struct builtin_class_descr IME_builtin_class =
|
|
|
|
{
|
|
|
|
imeW, /* name */
|
|
|
|
0, /* style */
|
|
|
|
WINPROC_IME, /* proc */
|
|
|
|
2*sizeof(LONG_PTR), /* extra */
|
|
|
|
IDC_ARROW, /* cursor */
|
|
|
|
0 /* brush */
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL is_ime_ui_msg( UINT msg )
|
|
|
|
{
|
|
|
|
switch(msg) {
|
|
|
|
case WM_IME_STARTCOMPOSITION:
|
|
|
|
case WM_IME_ENDCOMPOSITION:
|
|
|
|
case WM_IME_COMPOSITION:
|
|
|
|
case WM_IME_SETCONTEXT:
|
|
|
|
case WM_IME_NOTIFY:
|
|
|
|
case WM_IME_CONTROL:
|
|
|
|
case WM_IME_COMPOSITIONFULL:
|
|
|
|
case WM_IME_SELECT:
|
|
|
|
case WM_IME_CHAR:
|
|
|
|
case WM_IME_REQUEST:
|
|
|
|
case WM_IME_KEYDOWN:
|
|
|
|
case WM_IME_KEYUP:
|
|
|
|
return TRUE;
|
|
|
|
default:
|
|
|
|
if ((msg == WM_MSIME_RECONVERTOPTIONS) ||
|
|
|
|
(msg == WM_MSIME_SERVICE) ||
|
|
|
|
(msg == WM_MSIME_MOUSE) ||
|
|
|
|
(msg == WM_MSIME_RECONVERTREQUEST) ||
|
|
|
|
(msg == WM_MSIME_RECONVERT) ||
|
|
|
|
(msg == WM_MSIME_QUERYPOSITION) ||
|
|
|
|
(msg == WM_MSIME_DOCUMENTFEED))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LRESULT WINAPI ImeWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
|
|
|
{
|
|
|
|
HWND uiwnd;
|
|
|
|
|
2016-09-06 17:04:45 +02:00
|
|
|
if (msg==WM_CREATE)
|
2014-11-10 13:46:18 +01:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (imm_get_ui_window && is_ime_ui_msg(msg))
|
|
|
|
{
|
|
|
|
if ((uiwnd = imm_get_ui_window(GetKeyboardLayout(0))))
|
|
|
|
return SendMessageA(uiwnd, msg, wParam, lParam);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return DefWindowProcA(hwnd, msg, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
|
|
|
LRESULT WINAPI ImeWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
|
|
|
{
|
|
|
|
HWND uiwnd;
|
|
|
|
|
2016-09-06 17:04:45 +02:00
|
|
|
if (msg==WM_CREATE)
|
2014-11-10 13:46:18 +01:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (imm_get_ui_window && is_ime_ui_msg(msg))
|
|
|
|
{
|
|
|
|
if ((uiwnd = imm_get_ui_window(GetKeyboardLayout(0))))
|
|
|
|
return SendMessageW(uiwnd, msg, wParam, lParam);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return DefWindowProcW(hwnd, msg, wParam, lParam);
|
|
|
|
}
|