Solved

iInputMethod & word completion

Posted on 2004-04-15
14
391 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
  • 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
 
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I think the most popular question in our Windows Mobile Programming zone is about the backlight - we all want to keep it on when our application is running. Few years ago the function SystemIdleTimerReset() did this job. On our side we had to detec…
This article shows how to setup the internet connectivity on Windows Mobile Emulator.   I assume that you already have Microsoft Visual Studio, Microsoft Windows Mobile SDK's and the emulator installed. The emulator is available with Visual Studi…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now