Solved

iInputMethod & word completion

Posted on 2004-04-15
14
411 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Android Samsung Galaxy S4 Cyanogenmod boot loop 5 343
Samsung Galaxy S4 Port Forwarding? 1 169
Migrating From Parse To AWS 8 162
android app layout 7 101
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…
I recently asked a question (http://www.experts-exchange.com/Programming/Smartphones/Android/Q_28684946.html) about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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