Solved

iInputMethod & word completion

Posted on 2004-04-15
14
431 Views
Last Modified: 2013-12-27
How is it possible to enable word completion for custom implementation of iInputMethod interface?
0
Comment
Question by:OMC2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 10832901
HRESULT IInputMethod::GetInfo (IMINFO *pimi);

The only parameter is a pointer to an IMINFO structure that the IM must fill out to give information back to the SIP. The IMINFO structure is defined as

typedef struct  {
    DWORD cbSize;
    HANDLE hImageNarrow;
    HANDLE hImageWide;
    int iNarrow;
    int iWide;
    DWORD fdwFlags;
    RECT rcSipRect;
} IMINFO;

The first field, cbSize, must be filled with the size of the IMINFO structure. The next two fields, hImageNarrow and hImageWide, should be filled with handles to image lists that contain the bitmaps that will appear on the taskbar SIP button. The Pocket PC’s menu bar uses the narrow image. However, for embedded systems, the shell has the flexibility to use either the wide 32-by-16-pixel bitmap or the narrow 16-by-16-pixel bitmap, depending on its needs. The input method must create these image lists and pass the handles in this structure. The IM is responsible for destroying the image lists when a user or an application unloads it. You can create these image lists in the GetInfo method as long as you design your application to know not to create the image lists twice if GetInfo is called more than once. Another strategy is to create the image lists in the Select method and store the handles as member variables of the IInputMethod object. Then when GetInfo is called, you can pass the handles of the already created image lists to the input panel.

The next two fields, iNarrow and iWide, should be set to the index in the image lists for the bitmap you want the SIP to use. For example, you might have two different bitmaps for the SIP button, depending on whether your IM is docked or floating. You can then have an image list with two bitmaps, and you can specify the index depending on the state of your IM.

The fdwFlags field should be set to  SIPF_ENABLECOMPLETION to set the word completion.
0
 
LVL 15

Author Comment

by:OMC2000
ID: 10833013
Thanks a lot for your reply,
what is the numeric value of SIPF_ENABLECOMPLETION flag. I can't find in available headers.
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 10833107
If you didnt set SIPF_DISABLECOMPLETION
Then "SIPF_ENABLECOMPLETION "  not really a value is the default. so Word completion is set.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 15

Author Comment

by:OMC2000
ID: 10833141
SIPF_DISABLECOMPLETION is not available in the headers as well, I found from somewhere that it has value 8. I don't set SIPF_DISABLECOMPLETION, but Word completion is not set anyway!

Could you look at the header where you have found this SIPF_ENABLECOMPLETION define and let me know its value?
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 10833220
This is code to restore Word completion

                SIPINFO info;
      SHSipInfo(SPI_GETSIPINFO, 0, &info, 0);
      info.fdwFlags = m_dwSipFlasg;
      SHSipInfo(SPI_SETSIPINFO, 0, &info, 0);
      SHSipPreference(m_hWnd, SIP_FORCEDOWN);
      SHSipPreference(m_hWnd, SIP_UP);
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 10833223
Because you have to restart the InputPanel to have the Changes in effect
0
 
LVL 15

Author Comment

by:OMC2000
ID: 10833373
I guess I've read this article from pocketPC development network.
It works for word completion disabling for standard input method, but it does not work for CUSTOM iInputMethod implementation.
My problem is that the word completion window never appears.

what is the value of m_dwSipFlasg?
Or what is the value of  SIPF_ENABLECOMPLETION flag?
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 10833864
did you try just writing the text ?

did you get an error?
0
 
LVL 15

Author Comment

by:OMC2000
ID: 10833998
yes, I tried, everything works fine, the only problem is lack of word completion window
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 10834102
SIPF_ENABLECOMPLETION  = 1
0
 
LVL 15

Author Comment

by:OMC2000
ID: 10834161
Thanks, I'll try it tomorrow, I have to go now.
0
 
LVL 48

Accepted Solution

by:
Mikal613 earned 500 total points
ID: 10834445
have fun
0
 
LVL 15

Author Comment

by:OMC2000
ID: 10876723
1 is SIPF_ON. It does not work.
0
 
LVL 15

Author Comment

by:OMC2000
ID: 11233671
Your input was useless, the reason was in incorrect event generation.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question