Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

iInputMethod & word completion

How is it possible to enable word completion for custom implementation of iInputMethod interface?
0
OMC2000
Asked:
OMC2000
  • 7
  • 7
1 Solution
 
Mikal613Commented:
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
 
OMC2000Author Commented:
Thanks a lot for your reply,
what is the numeric value of SIPF_ENABLECOMPLETION flag. I can't find in available headers.
0
 
Mikal613Commented:
If you didnt set SIPF_DISABLECOMPLETION
Then "SIPF_ENABLECOMPLETION "  not really a value is the default. so Word completion is set.
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
OMC2000Author Commented:
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
 
Mikal613Commented:
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
 
Mikal613Commented:
Because you have to restart the InputPanel to have the Changes in effect
0
 
OMC2000Author Commented:
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
 
Mikal613Commented:
did you try just writing the text ?

did you get an error?
0
 
OMC2000Author Commented:
yes, I tried, everything works fine, the only problem is lack of word completion window
0
 
Mikal613Commented:
SIPF_ENABLECOMPLETION  = 1
0
 
OMC2000Author Commented:
Thanks, I'll try it tomorrow, I have to go now.
0
 
Mikal613Commented:
have fun
0
 
OMC2000Author Commented:
1 is SIPF_ON. It does not work.
0
 
OMC2000Author Commented:
Your input was useless, the reason was in incorrect event generation.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

  • 7
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now