Hello.

My customers have pocketpc 2003 korean version and 3rd party external
keyboard. But problem exists. Because customers use korean language,
they may have to change IMM input mode-korean or english input mode.
On the screen, there is toggle button. But I can't find the any
external keyboard input for that - somthing like kor/eng toggle
button.

For windows, there is kor/eng toggle button, and it works. If adequate
keyboard driver which is provided by MS is selected, we can change the
input mode by pressing "Shift + Space".

For the external keyboard, there is no kor/eng button, so I'd like to
emulate the button using something like "Shift+Space" or any other
key. I also tested kor/eng button in my PC keyboard using PPC
emulator, and it doesn't work.

I must find the way for customers...so I've tried to make some
program. At the first time, I think about keyboard hooking and luckily
there is hidden function in PocketPC 2003. And I wrote down the code
below.
-----------------------------------------------------
hLibrary = LoadLibrary(L"coredll.dll");
if(hLibrary == NULL)
{
return 0;
}
else
{
m_pfSetWindowsHook = (SetWindowsHookExW)GetProcAddress(hLibrary,
L"SetWindowsHookExW");
if(m_pfSetWindowsHook == NULL)
{
return 0;
}
else
{
HHOOK gHook = m_pfSetWindowsHook(WH_KEYBOARD_LL, (HOOKPROC)
MainWndProc, hInstance, 0);
}
}
-------------------------------------------------------
The hooking seems to works but not perfectly. Because I can get the
keyboard messages but the wparam and lparam value is fixed and
meaningless. How to get the keyboard information precisely?

And I'd like know how to toggle the IMM input mode. For my experience,
the IMM input mode is set for the applications respectively. How to
change the IMM for the currently activated program, not the helper
program(what I want to make).

I think Pocket PC 2003 OS must support the kor/eng toggle key.
If you know any work-around such as using hot-key or others, please
let me know that.

Thank you.

Best Regards,
Hojae Lee

Re: How to change IMM mode with external keyboard? by GB

GB
Fri Feb 18 18:04:20 CST 2005

What it comes down to is this...

// LSp == Korean (Hangul) / English language switching.
keybd_event(VK_HANGUL, 0, 0, 0);
keybd_event(VK_HANGUL, 0, 2, 0);

Korean support is very nice. My hat is off to whoever implemented
that. Japanese IM switching is much uglier.

See also:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcelocal/html/clconKoreanIME97HotKeyRegistrySettings.asp

GB



"hojae" <respect@gmail.com> wrote in message
news:5d068837.0502170716.28f08f2e@posting.google.com...
> Hello.
>
> My customers have pocketpc 2003 korean version and 3rd party external
> keyboard. But problem exists. Because customers use korean language,
> they may have to change IMM input mode-korean or english input mode.
> On the screen, there is toggle button. But I can't find the any
> external keyboard input for that - somthing like kor/eng toggle
> button.
>
> For windows, there is kor/eng toggle button, and it works. If adequate
> keyboard driver which is provided by MS is selected, we can change the
> input mode by pressing "Shift + Space".
>
> For the external keyboard, there is no kor/eng button, so I'd like to
> emulate the button using something like "Shift+Space" or any other
> key. I also tested kor/eng button in my PC keyboard using PPC
> emulator, and it doesn't work.
>
> I must find the way for customers...so I've tried to make some
> program. At the first time, I think about keyboard hooking and luckily
> there is hidden function in PocketPC 2003. And I wrote down the code
> below.
> -----------------------------------------------------
> hLibrary = LoadLibrary(L"coredll.dll");
> if(hLibrary == NULL)
> {
> return 0;
> }
> else
> {
> m_pfSetWindowsHook = (SetWindowsHookExW)GetProcAddress(hLibrary,
> L"SetWindowsHookExW");
> if(m_pfSetWindowsHook == NULL)
> {
> return 0;
> }
> else
> {
> HHOOK gHook = m_pfSetWindowsHook(WH_KEYBOARD_LL, (HOOKPROC)
> MainWndProc, hInstance, 0);
> }
> }
> -------------------------------------------------------
> The hooking seems to works but not perfectly. Because I can get the
> keyboard messages but the wparam and lparam value is fixed and
> meaningless. How to get the keyboard information precisely?
>
> And I'd like know how to toggle the IMM input mode. For my experience,
> the IMM input mode is set for the applications respectively. How to
> change the IMM for the currently activated program, not the helper
> program(what I want to make).
>
> I think Pocket PC 2003 OS must support the kor/eng toggle key.
> If you know any work-around such as using hot-key or others, please
> let me know that.
>
> Thank you.
>
> Best Regards,
> Hojae Lee



Re: How to change IMM mode with external keyboard? by respect

respect
Sun Feb 20 03:21:44 CST 2005

I verified that changing the value of IME_KHOTKEY_ENGLISH works.
The working code snippet is like below.
BOOL bRet = ImmSetHotKey(IME_KHOTKEY_ENGLISH, MOD_SHIFT|MOD_LEFT,
VK_SPACE, NULL);

But there maybe two problems.
First, if I call ImmSetHotkey with 4th argument as
GetKeyboardLayout(NULL), it fails. The system says Invalid Handle. So
I call ImmSetHokey with 4th argument as NULL, it seems that it works,
but originally default value is not NULL. How can I solve it?

Second, Because I would like to toggle key as "Shift + Space", I set
the value of it. It works, but also the system get the space. So if I
press the "Shift + Space", Kor/Eng toggle button changed and also
Space is inserted.

Thanks...

"GB" <nospam_grant@_remove.this.too_genovation.com> wrote in message news:<ue$VkahFFHA.3732@tk2msftngp13.phx.gbl>...
> What it comes down to is this...
>
> // LSp == Korean (Hangul) / English language switching.
> keybd_event(VK_HANGUL, 0, 0, 0);
> keybd_event(VK_HANGUL, 0, 2, 0);
>
> Korean support is very nice. My hat is off to whoever implemented
> that. Japanese IM switching is much uglier.
>
> See also:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcelocal/html/clconKoreanIME97HotKeyRegistrySettings.asp
>
> GB
>
>
>
> "hojae" <respect@gmail.com> wrote in message
> news:5d068837.0502170716.28f08f2e@posting.google.com...
> > Hello.
> >
> > My customers have pocketpc 2003 korean version and 3rd party external
> > keyboard. But problem exists. Because customers use korean language,
> > they may have to change IMM input mode-korean or english input mode.
> > On the screen, there is toggle button. But I can't find the any
> > external keyboard input for that - somthing like kor/eng toggle
> > button.
> >
> > For windows, there is kor/eng toggle button, and it works. If adequate
> > keyboard driver which is provided by MS is selected, we can change the
> > input mode by pressing "Shift + Space".
> >
> > For the external keyboard, there is no kor/eng button, so I'd like to
> > emulate the button using something like "Shift+Space" or any other
> > key. I also tested kor/eng button in my PC keyboard using PPC
> > emulator, and it doesn't work.
> >
> > I must find the way for customers...so I've tried to make some
> > program. At the first time, I think about keyboard hooking and luckily
> > there is hidden function in PocketPC 2003. And I wrote down the code
> > below.
> > -----------------------------------------------------
> > hLibrary = LoadLibrary(L"coredll.dll");
> > if(hLibrary == NULL)
> > {
> > return 0;
> > }
> > else
> > {
> > m_pfSetWindowsHook = (SetWindowsHookExW)GetProcAddress(hLibrary,
> > L"SetWindowsHookExW");
> > if(m_pfSetWindowsHook == NULL)
> > {
> > return 0;
> > }
> > else
> > {
> > HHOOK gHook = m_pfSetWindowsHook(WH_KEYBOARD_LL, (HOOKPROC)
> > MainWndProc, hInstance, 0);
> > }
> > }
> > -------------------------------------------------------
> > The hooking seems to works but not perfectly. Because I can get the
> > keyboard messages but the wparam and lparam value is fixed and
> > meaningless. How to get the keyboard information precisely?
> >
> > And I'd like know how to toggle the IMM input mode. For my experience,
> > the IMM input mode is set for the applications respectively. How to
> > change the IMM for the currently activated program, not the helper
> > program(what I want to make).
> >
> > I think Pocket PC 2003 OS must support the kor/eng toggle key.
> > If you know any work-around such as using hot-key or others, please
> > let me know that.
> >
> > Thank you.
> >
> > Best Regards,
> > Hojae Lee

Re: How to change IMM mode with external keyboard? by respect

respect
Sun Feb 20 03:38:30 CST 2005

There is additional one problem.
If I change the value of IME_KHOTKEY_ENGLISH, toggle button of
SIM(Screen Keyboard) does not work. I think the button generates
VK_HANGUL.

Then what is the alternative method of that? I think if there is
global hot key, it can be successful. Suppose I input the predefined
keyboard combination such as "Shift+Space" and translate it to
VK_HANGUL, it can be successful.

Is there any global Hot Key list which acts like above?

Thanks.

"GB" <nospam_grant@_remove.this.too_genovation.com> wrote in message news:<ue$VkahFFHA.3732@tk2msftngp13.phx.gbl>...
> What it comes down to is this...
>
> // LSp == Korean (Hangul) / English language switching.
> keybd_event(VK_HANGUL, 0, 0, 0);
> keybd_event(VK_HANGUL, 0, 2, 0);
>
> Korean support is very nice. My hat is off to whoever implemented
> that. Japanese IM switching is much uglier.
>
> See also:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcelocal/html/clconKoreanIME97HotKeyRegistrySettings.asp
>
> GB
>
>
>
> "hojae" <respect@gmail.com> wrote in message
> news:5d068837.0502170716.28f08f2e@posting.google.com...
> > Hello.
> >
> > My customers have pocketpc 2003 korean version and 3rd party external
> > keyboard. But problem exists. Because customers use korean language,
> > they may have to change IMM input mode-korean or english input mode.
> > On the screen, there is toggle button. But I can't find the any
> > external keyboard input for that - somthing like kor/eng toggle
> > button.
> >
> > For windows, there is kor/eng toggle button, and it works. If adequate
> > keyboard driver which is provided by MS is selected, we can change the
> > input mode by pressing "Shift + Space".
> >
> > For the external keyboard, there is no kor/eng button, so I'd like to
> > emulate the button using something like "Shift+Space" or any other
> > key. I also tested kor/eng button in my PC keyboard using PPC
> > emulator, and it doesn't work.
> >
> > I must find the way for customers...so I've tried to make some
> > program. At the first time, I think about keyboard hooking and luckily
> > there is hidden function in PocketPC 2003. And I wrote down the code
> > below.
> > -----------------------------------------------------
> > hLibrary = LoadLibrary(L"coredll.dll");
> > if(hLibrary == NULL)
> > {
> > return 0;
> > }
> > else
> > {
> > m_pfSetWindowsHook = (SetWindowsHookExW)GetProcAddress(hLibrary,
> > L"SetWindowsHookExW");
> > if(m_pfSetWindowsHook == NULL)
> > {
> > return 0;
> > }
> > else
> > {
> > HHOOK gHook = m_pfSetWindowsHook(WH_KEYBOARD_LL, (HOOKPROC)
> > MainWndProc, hInstance, 0);
> > }
> > }
> > -------------------------------------------------------
> > The hooking seems to works but not perfectly. Because I can get the
> > keyboard messages but the wparam and lparam value is fixed and
> > meaningless. How to get the keyboard information precisely?
> >
> > And I'd like know how to toggle the IMM input mode. For my experience,
> > the IMM input mode is set for the applications respectively. How to
> > change the IMM for the currently activated program, not the helper
> > program(what I want to make).
> >
> > I think Pocket PC 2003 OS must support the kor/eng toggle key.
> > If you know any work-around such as using hot-key or others, please
> > let me know that.
> >
> > Thank you.
> >
> > Best Regards,
> > Hojae Lee