Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d3442690
Commit
d3442690
authored
Dec 07, 2000
by
Hidenori Takeshima
Committed by
Alexandre Julliard
Dec 07, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added handlers for some IME messages in DefWindowProc.
parent
6bbf46a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
0 deletions
+121
-0
defwnd.c
windows/defwnd.c
+121
-0
No files found.
windows/defwnd.c
View file @
d3442690
...
...
@@ -22,6 +22,7 @@
#include "winnls.h"
#include "wine/unicode.h"
#include "wine/winuser16.h"
#include "imm.h"
DEFAULT_DEBUG_CHANNEL
(
win
);
...
...
@@ -213,6 +214,72 @@ static void DEFWND_Print(
SendMessageA
(
wndPtr
->
hwndSelf
,
WM_PRINTCLIENT
,
(
WPARAM
)
hdc
,
PRF_CLIENT
);
}
/*
* helpers for calling IMM32
*
* WM_IME_* messages are generated only by IMM32,
* so I assume imm32 is already LoadLibrary-ed.
*/
static
HWND
DEFWND_ImmGetDefaultIMEWnd
(
HWND
hwnd
)
{
HINSTANCE
hInstIMM
=
GetModuleHandleA
(
"imm32"
);
HWND
(
WINAPI
*
pFunc
)(
HWND
);
HWND
hwndRet
=
NULL
;
if
(
!
hInstIMM
)
{
ERR
(
"cannot get IMM32 handle
\n
"
);
return
NULL
;
}
pFunc
=
(
void
*
)
GetProcAddress
(
hInstIMM
,
"ImmGetDefaultIMEWnd"
);
if
(
pFunc
!=
NULL
)
hwndRet
=
(
*
pFunc
)(
hwnd
);
return
hwndRet
;
}
static
BOOL
DEFWND_ImmIsUIMessageA
(
HWND
hwndIME
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HINSTANCE
hInstIMM
=
GetModuleHandleA
(
"imm32"
);
BOOL
(
WINAPI
*
pFunc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
BOOL
fRet
=
FALSE
;
if
(
!
hInstIMM
)
{
ERR
(
"cannot get IMM32 handle
\n
"
);
return
FALSE
;
}
pFunc
=
(
void
*
)
GetProcAddress
(
hInstIMM
,
"ImmIsUIMessageA"
);
if
(
pFunc
!=
NULL
)
fRet
=
(
*
pFunc
)(
hwndIME
,
msg
,
wParam
,
lParam
);
return
fRet
;
}
static
BOOL
DEFWND_ImmIsUIMessageW
(
HWND
hwndIME
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HINSTANCE
hInstIMM
=
GetModuleHandleA
(
"imm32"
);
BOOL
(
WINAPI
*
pFunc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
BOOL
fRet
=
FALSE
;
if
(
!
hInstIMM
)
{
ERR
(
"cannot get IMM32 handle
\n
"
);
return
FALSE
;
}
pFunc
=
(
void
*
)
GetProcAddress
(
hInstIMM
,
"ImmIsUIMessageW"
);
if
(
pFunc
!=
NULL
)
fRet
=
(
*
pFunc
)(
hwndIME
,
msg
,
wParam
,
lParam
);
return
fRet
;
}
/***********************************************************************
* DEFWND_DefWinProc
*
...
...
@@ -710,6 +777,46 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam,
result
=
1
;
/* success. FIXME: check text length */
break
;
/* for far east users (IMM32) - <hidenori@a2.ctktv.ne.jp> */
case
WM_IME_CHAR
:
{
CHAR
chChar1
=
(
CHAR
)(
(
wParam
>>
8
)
&
0xff
);
CHAR
chChar2
=
(
CHAR
)(
wParam
&
0xff
);
SendMessageA
(
hwnd
,
WM_CHAR
,
(
WPARAM
)
chChar1
,
lParam
);
if
(
IsDBCSLeadByte
(
chChar1
)
)
SendMessageA
(
hwnd
,
WM_CHAR
,
(
WPARAM
)
chChar2
,
lParam
);
}
break
;
case
WM_IME_KEYDOWN
:
result
=
SendMessageA
(
hwnd
,
WM_KEYDOWN
,
wParam
,
lParam
);
break
;
case
WM_IME_KEYUP
:
result
=
SendMessageA
(
hwnd
,
WM_KEYUP
,
wParam
,
lParam
);
break
;
case
WM_IME_STARTCOMPOSITION
:
case
WM_IME_COMPOSITION
:
case
WM_IME_ENDCOMPOSITION
:
case
WM_IME_SELECT
:
{
HWND
hwndIME
;
hwndIME
=
DEFWND_ImmGetDefaultIMEWnd
(
hwnd
);
if
(
hwndIME
!=
NULL
)
result
=
SendMessageA
(
hwndIME
,
msg
,
wParam
,
lParam
);
}
break
;
case
WM_IME_SETCONTEXT
:
{
HWND
hwndIME
;
hwndIME
=
DEFWND_ImmGetDefaultIMEWnd
(
hwnd
);
if
(
hwndIME
!=
NULL
)
result
=
DEFWND_ImmIsUIMessageA
(
hwndIME
,
msg
,
wParam
,
lParam
);
}
break
;
default:
result
=
DEFWND_DefWinProc
(
wndPtr
,
msg
,
wParam
,
lParam
);
break
;
...
...
@@ -767,6 +874,20 @@ LRESULT WINAPI DefWindowProcW(
result
=
1
;
/* success. FIXME: check text length */
break
;
/* for far east users (IMM32) - <hidenori@a2.ctktv.ne.jp> */
case
WM_IME_CHAR
:
SendMessageW
(
hwnd
,
WM_CHAR
,
wParam
,
lParam
);
break
;
case
WM_IME_SETCONTEXT
:
{
HWND
hwndIME
;
hwndIME
=
DEFWND_ImmGetDefaultIMEWnd
(
hwnd
);
if
(
hwndIME
!=
NULL
)
result
=
DEFWND_ImmIsUIMessageW
(
hwndIME
,
msg
,
wParam
,
lParam
);
}
break
;
default:
result
=
DefWindowProcA
(
hwnd
,
msg
,
wParam
,
lParam
);
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment