locked
[Win8 StoreApp] How to develop Text Services Framework enabled application for Win8 Store App? RRS feed

  • Question

  • Hi,

    Could you help me to find out how we can interact with Text Services Framework for Store App?
    I'm trying to port my app which uses IMM32 for interacting with IME to StoreApp.

    The article below seems to be comprehensive for my needs but it seems some of the functions appear in the code snippets are not supported for StoreApp.

    msdn.microsoft.com/en-us/library/windows/apps/ms629043.aspx
    - CoCreateInstance is not supported for StoreApp (msdn.microsoft.com/en-us/library/windows/apps/ms686615.aspx)
    - ITfThreadMgr::CreateDocumentMgr method is not supported for Store App. (msdn.microsoft.com/en-us/library/windows/apps/ms628981.aspx)

    It may help me a lot if there is a sample application but I couldn't find it.
    Document below seems to explain how to develop IME for StoreApp mode with sample.
    It's good if there is something similar and shows how to use IME from applications.

    msdn.microsoft.com/en-us/library/windows/apps/hh967425.aspx

    Regards,
    Takuji


    • Edited by tkawata5 Tuesday, November 13, 2012 5:28 AM
    Tuesday, November 13, 2012 5:13 AM

Answers

  • Hello Takuji,

    Unfortunately there are no readymade SDK samples that show how your Windows Store app can interact with the Text Service framework.

    However, you can continue to use the samples published in the Win7 Platform SDK and just keep in mind that there are minor adjustments made in TSF for the Windows Store app scenario and a regular desktop scenario.

    For example:

    - ITfThreadMgr2 is the Windows Store app replacement for ITfThreadMgr\ITfThreadMgrEx
    - ITextStoreACP2 is the Windows Store app replacement for ITextStoreACP
    - Some legacy IME-only interfaces were not included in the Windows Store app SDK

    The link you mentioned previously: http://msdn.microsoft.com/en-us/library/windows/apps/ms629043.aspx does give you a starting point on how your Windows Store app can interact with the TSF.

    That link uses CoCreateInstance with IID_ITfThreadMgr/ ITfThreadMgr for regular desktop. For Windows Store app, you need to use the ITfThreadMgr2 interface and adjust your code accordingly. Similarly, the call to CreateContext in Step 4 of that link needs to use ITextStoreACP2 for Windows Store app instead of ITextStoreACP (which is for desktop).

    CoCreateInstance & CreateDocumentMgr are both supported functions with the right interface type - ITfThreadMgr2 used for Windows Store apps. I hope this information will help you move forward with your implementation.

    Thanks,

    Prashant.

    Monday, November 26, 2012 8:34 PM
    Moderator

All replies

  • Wednesday, November 14, 2012 8:00 AM
  • Hi Jesse,

    Thanks!

    I'm sorry if I miss some, but it looks to me the sample code instructs how to develop IME. My purpose is not developping IME but want to use/control IME from my app. For example, I want to query the text IME is compositing and show it in my application with some optimized manner.

    I see we need to operate TSF for this but I can not find the way to get / create the object for my application (developed for StoreApp).

    Regards,

    Takuji

    Wednesday, November 14, 2012 8:43 AM
  • Hello Takuji,

    Unfortunately there are no readymade SDK samples that show how your Windows Store app can interact with the Text Service framework.

    However, you can continue to use the samples published in the Win7 Platform SDK and just keep in mind that there are minor adjustments made in TSF for the Windows Store app scenario and a regular desktop scenario.

    For example:

    - ITfThreadMgr2 is the Windows Store app replacement for ITfThreadMgr\ITfThreadMgrEx
    - ITextStoreACP2 is the Windows Store app replacement for ITextStoreACP
    - Some legacy IME-only interfaces were not included in the Windows Store app SDK

    The link you mentioned previously: http://msdn.microsoft.com/en-us/library/windows/apps/ms629043.aspx does give you a starting point on how your Windows Store app can interact with the TSF.

    That link uses CoCreateInstance with IID_ITfThreadMgr/ ITfThreadMgr for regular desktop. For Windows Store app, you need to use the ITfThreadMgr2 interface and adjust your code accordingly. Similarly, the call to CreateContext in Step 4 of that link needs to use ITextStoreACP2 for Windows Store app instead of ITextStoreACP (which is for desktop).

    CoCreateInstance & CreateDocumentMgr are both supported functions with the right interface type - ITfThreadMgr2 used for Windows Store apps. I hope this information will help you move forward with your implementation.

    Thanks,

    Prashant.

    Monday, November 26, 2012 8:34 PM
    Moderator
  • Hi Prashant,

    Thanks!

    The information does help. I'll follow your instruction and wil try the migration.

    -Takuji

    Thursday, November 29, 2012 5:47 AM