mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTUSER][IMM32_APITEST] Associate HIMC to WND (#4451)
- Set the default input context to WND at IntCreateWindow function. - Add more tests to the himc testcase of imm32_apitest. CORE-11700
This commit is contained in:
parent
f848343bff
commit
3820744a18
2 changed files with 46 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "precomp.h"
|
||||
|
||||
START_TEST(himc)
|
||||
static void Test1(void)
|
||||
{
|
||||
DWORD style;
|
||||
HWND hwndEdit, hwndStatic;
|
||||
|
@ -152,3 +152,44 @@ START_TEST(himc)
|
|||
DestroyWindow(hwndEdit);
|
||||
DestroyWindow(hwndStatic);
|
||||
}
|
||||
|
||||
static void Test2(void)
|
||||
{
|
||||
static const LPCSTR apszClasses[] =
|
||||
{
|
||||
"BUTTON",
|
||||
"COMBOBOX",
|
||||
"EDIT",
|
||||
"LISTBOX",
|
||||
"SCROLLBAR",
|
||||
"STATIC"
|
||||
};
|
||||
size_t i;
|
||||
HIMC hIMC;
|
||||
HWND hwnd;
|
||||
|
||||
for (i = 0; i < _countof(apszClasses); ++i)
|
||||
{
|
||||
LPCSTR pszClass = apszClasses[i];
|
||||
hwnd = CreateWindowA(pszClass, NULL, WS_VISIBLE, 0, 0, 0, 0, NULL, NULL,
|
||||
GetModuleHandle(NULL), NULL);
|
||||
ok(hwnd != NULL, "CreateWindow failed\n");
|
||||
|
||||
hIMC = ImmGetContext(hwnd);
|
||||
|
||||
if (lstrcmpiA(pszClass, "BUTTON") == 0)
|
||||
ok(hIMC == NULL, "hIMC was %p\n", hIMC);
|
||||
else
|
||||
ok(hIMC != NULL, "hIMC was NULL\n");
|
||||
|
||||
ImmReleaseContext(hwnd, hIMC);
|
||||
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
START_TEST(himc)
|
||||
{
|
||||
Test1();
|
||||
Test2();
|
||||
}
|
||||
|
|
|
@ -1866,6 +1866,10 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
|
|||
pWnd->ExStyle = Cs->dwExStyle;
|
||||
pWnd->cbwndExtra = pWnd->pcls->cbwndExtra;
|
||||
pWnd->pActCtx = acbiBuffer;
|
||||
|
||||
if (pti->spDefaultImc && Class->atomClassName != gpsi->atomSysClass[ICLS_BUTTON])
|
||||
pWnd->hImc = UserHMGetHandle(pti->spDefaultImc);
|
||||
|
||||
pWnd->InternalPos.MaxPos.x = pWnd->InternalPos.MaxPos.y = -1;
|
||||
pWnd->InternalPos.IconPos.x = pWnd->InternalPos.IconPos.y = -1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue