mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:15:52 +00:00
parent
e068c68452
commit
89f5f5bb95
2 changed files with 59 additions and 0 deletions
|
@ -37,9 +37,12 @@
|
|||
#include "winreg.h"
|
||||
#include "wine/list.h"
|
||||
#ifdef __REACTOS__
|
||||
#include <stdlib.h>
|
||||
#include <ndk/umtypes.h>
|
||||
#include <ndk/pstypes.h>
|
||||
#include "../../../win32ss/include/ntuser.h"
|
||||
#include <imm32_undoc.h>
|
||||
#include <strsafe.h>
|
||||
#endif
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(imm);
|
||||
|
@ -1765,6 +1768,22 @@ HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
|
|||
UINT WINAPI ImmGetDescriptionA(
|
||||
HKL hKL, LPSTR lpszDescription, UINT uBufLen)
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
IMEINFOEX info;
|
||||
size_t cch;
|
||||
|
||||
TRACE("ImmGetDescriptionA(%p,%p,%d)\n", hKL, lpszDescription, uBufLen);
|
||||
|
||||
if (!ImmGetImeInfoEx(&info, ImeInfoExKeyboardLayout, &hKL) || !IS_IME_KBDLAYOUT(hKL))
|
||||
return 0;
|
||||
|
||||
StringCchLengthW(info.wszImeDescription, _countof(info.wszImeDescription), &cch);
|
||||
cch = WideCharToMultiByte(CP_ACP, 0, info.wszImeDescription, (INT)cch,
|
||||
lpszDescription, uBufLen, NULL, NULL);
|
||||
if (uBufLen)
|
||||
lpszDescription[cch] = 0;
|
||||
return cch;
|
||||
#else
|
||||
WCHAR *buf;
|
||||
DWORD len;
|
||||
|
||||
|
@ -1793,6 +1812,7 @@ UINT WINAPI ImmGetDescriptionA(
|
|||
return 0;
|
||||
|
||||
return len - 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -1800,6 +1820,21 @@ UINT WINAPI ImmGetDescriptionA(
|
|||
*/
|
||||
UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
IMEINFOEX info;
|
||||
size_t cch;
|
||||
|
||||
TRACE("ImmGetDescriptionW(%p, %p, %d)\n", hKL, lpszDescription, uBufLen);
|
||||
|
||||
if (!ImmGetImeInfoEx(&info, ImeInfoExKeyboardLayout, &hKL) || !IS_IME_KBDLAYOUT(hKL))
|
||||
return 0;
|
||||
|
||||
if (uBufLen != 0)
|
||||
StringCchCopyW(lpszDescription, uBufLen, info.wszImeDescription);
|
||||
|
||||
StringCchLengthW(info.wszImeDescription, _countof(info.wszImeDescription), &cch);
|
||||
return (UINT)cch;
|
||||
#else
|
||||
static const WCHAR name[] = { 'W','i','n','e',' ','X','I','M',0 };
|
||||
|
||||
FIXME("(%p, %p, %d): semi stub\n", hKL, lpszDescription, uBufLen);
|
||||
|
@ -1808,6 +1843,7 @@ UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
|
|||
if (!uBufLen) return lstrlenW( name );
|
||||
lstrcpynW( lpszDescription, name, uBufLen );
|
||||
return lstrlenW( lpszDescription );
|
||||
#endif
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
23
sdk/include/reactos/imm32_undoc.h
Normal file
23
sdk/include/reactos/imm32_undoc.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Kernel
|
||||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||
* PURPOSE: Private header for imm32.dll
|
||||
* COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define KBDLAYOUT_MASK 0xF000
|
||||
#define KBDLAYOUT_IME 0xE000
|
||||
#define IS_IME_KBDLAYOUT(hKL) ((HIWORD(hKL) & KBDLAYOUT_MASK) == KBDLAYOUT_IME)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
BOOL WINAPI
|
||||
ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue