Freigeben über


IIMECheckDefaultInputProfile

 

Microsoft Corporation

August 2003

Summary: This document describes the IIMECheckDefaultInputProfile interface specification for Microsoft IME 2003, Japanese version. IIMECheckDefaultInputProfile is an extended interface of Microsoft Japanese keyboard text service that provides several services for the keyboard text service. (5 printed pages)

Contents

What Is IIMECheckDefaultInputProfile?
Class ID (CLSID)
Interface
IsTipActive
ActivateTIP
GetDescription
GetIcon

What Is IIMECheckDefaultInputProfile?

IIMECheckDefaultInputProfile is an extended interface of Microsoft® Japanese keyboard text service and provides the following services:

  • Checks the default keyboard text service
  • Provides a name for the text service
  • Provides an icon for the text service
  • Sets the default keyboard text service on the Common Text Framework

Note   If the client application does not enable Common Text Framework, a high percentage of method calls will fail.

Class ID (CLSID)

Class ID and interface IDs are defined in a header file "msimetip.h." Another way of obtaining a class ID is to get the CLSID string from HKEY_CLASSES_ROOT\IMECheckDefaultInputProfile.x.y, where x is the country name and y is the version number. For the Japanese input method, the country name is "Japan" and the version number is 1. CLSIDFromProgID Windows API will help you easily obtain a class ID. Including the "initguid.h" file (provided by Windows SDK) before "msimetip.h" defines class IDs as static data for a DLL or an executable. The initguid.h file is only included once.

Interface

#if defined(__cplusplus) && !defined(CINTERFACE)
    
    MIDL_INTERFACE("1C4661AE-05A2-4f63-A548-7943FACCED21")
    IIMECheckDefaultInputProfile : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE IsTipActive( 
            /* [in] */ REFCLSID rclsid,  // Reserved
            /* [out] */ DWORD __RPC_FAR *pdwReason) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE ActivateTip(DWORD dwTIPType) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE GetDescription( 
            /* [in] */ LANGID langid,
            /* [out] */ WCHAR __RPC_FAR *wsz,
            /* [out] */ UINT __RPC_FAR *pcch) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE GetIcon( 
            /* [in] */ BOOL fSmall,
            /* [out] */ HICON __RPC_FAR *phIcon) = 0;
        
    };
 #endif

IsTipActive

IsTipActive checks to see if the Text Service wants to change the default input profile.

Parameters:

[in] REFCLSID rclsid – Reserved must be NULL.

[out] DWORD* pdwReason – result value is stored by the interface provider.

If the Text Service was activated already, the return value is S_OK and this stores one of following values into *pdwReason.

typedef enum {
           TIPTYPE_DEFAULT         = 0,
           TIPTYPE_SEAMLESS       = 0x1,
           TIPTYPE_CLASSIC         = 0x2
} TIPTYPE;

It returns S_FALSE if the Text Service was not activated, and stores one of following values into *pdwReason.

typedef enum {
// unknown error 
ISTIPACTIVEERR_ERRORUNKNOWN,
 
// Common Text Framework default language is not the same as the Text Service language ISTIPACTIVEERR_CURLANGISDIFFERENT,
 
// The Text Service is not a default keyboard Text Service
ISTIPACTIVEERR_NOTDEFAULT,
 
// The Text Service is not registered or not found in the keyboard category ISTIPACTIVEERR_NOTFOUND,
} ISTIPACTIVATE;

ActivateTIP

Activates TIP and sets keyboard Text Service as the default.

Parameters:

[in] DWORD dwTIPType – TIP type

typedef enum {

           TIPTYPE_DEFAULT         = 0,

           TIPTYPE_SEAMLESS       = 0x1,

           TIPTYPE_CLASSIC         = 0x2

} TIPTYPE;

Note This function will fail if the current input language and the supporting language in this interface are not the same. A return value is the same as with the ActivateLanguageProfile() method in the CLSID_TFInputProcessorProfiles interface.

GetDescription

This function retrieves Text Service's title.

Parameters:

 [in] LANGID langid—The language ID

 [out] WCHAR *wsz—Pointer to the buffer that will stored the Text Service's title

 [out] UINT *pcch—Pointer to store the length in characters.

GetIcon

This function retrieves Text Service's icon.

Parameters:

[in] BOOL fSmall—Stores small icon if TRUE, Otherwise, stores large icon

[out] HICON *phIcon—Pointer to the handle that will stored Text Service's icon