Win32 API 日本語リファレンス
ホームUI.TabletPC › ITextInputPanel

ITextInputPanel

COM
IID6b6a65a5-6af3-46c2-b6ea-56cd1f80df71継承元IUnknown自前メソッド開始 vtbl3

公式ドキュメント

Tablet PC 入力パネルの外観と動作を制御します。

解説(Remarks)

ITextInputPanel Interface は、PenInputPanel Class よりも入力パネルの状態に関する多くの制御と情報をアプリケーション開発者に提供します。ITextInputPanel Interface は、入力パネルをプログラムから操作するための推奨される仕組みとして PenInputPanel Class に代わるものです。

ITextInputPanel Interface は次の機能を提供します。

ITextInputPanel InterfacePenInputPanel Class のプログラム機能のほぼすべてを引き続き提供するため、PenInputPanel Class に取って代わります。

この要素は Peninputpanel.h で宣言されています。

メソッド 25

vtbl = vtable インデックス(0始まり)。HSP等からCOMメソッドをインデックス指定で呼ぶ際に使用します。0〜2 は IUnknown。

vtbl 3 HRESULT get_AttachedEditWindow(HWND* AttachedEditWindow)

ITextInputPanel オブジェクトがアタッチされているオブジェクトのウィンドウハンドルを取得または設定します。(Get)

AttachedEditWindowHWND*out入力パネルが関連付けられている編集ウィンドウのハンドルを受け取る出力ポインタである。

解説(Remarks)

オブジェクトのウィンドウハンドルは変化する場合があります。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 4 HRESULT put_AttachedEditWindow(HWND AttachedEditWindow)

ITextInputPanel オブジェクトがアタッチされているオブジェクトのウィンドウハンドルを取得または設定します。(Put)

AttachedEditWindowHWNDin入力パネルを関連付ける編集ウィンドウのハンドルを指定する。

解説(Remarks)

オブジェクトのウィンドウハンドルは変化する場合があります。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 5 HRESULT get_CurrentInteractionMode(InteractionMode* CurrentInteractionMode)

InteractionMode 列挙型で指定される、Tablet PC 入力パネルの配置を取得します。

CurrentInteractionModeInteractionMode*out入力パネルの現在の操作モード(In-Place か Docked か等)を受け取る出力ポインタである。

解説(Remarks)

現在の対話モードはユーザーによって決まります。ただし、InteractionMode_InPlace モードは、アプリケーションがフィールド単位で無効にできます。

この C++ の例では、Edit コントロール IDC_EDIT3EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、TRACE マクロを使用して、いくつかの ITextInputPanel Interface プロパティの値をデバッグ出力に報告します。

void CCOMTIPDlg::OnEnSetFocusEdit3()
{
    if (NULL != g_pTip)
    {
        CorrectionMode mode;

        if (SUCCEEDED(g_pTip->get_CurrentCorrectionMode(&mode)))
        {
            TRACE("CurrentCorrectionMode: %d\n", mode);
        }

        InPlaceState state;

        if (SUCCEEDED(g_pTip->get_CurrentInPlaceState(&state)))
        {
            TRACE("CurrentInPlaceState: %d\n", state);
        }

        PanelInputArea area;

        if (SUCCEEDED(g_pTip->get_CurrentInputArea(&area)))
        {
            TRACE("CurrentInputArea: %d\n", area);
        }

        InteractionMode iMode;

        if (SUCCEEDED(g_pTip->get_CurrentInteractionMode(&iMode)))
        {
            TRACE("CurrentInteractionMode: %d\n", iMode);
        }

        RECT rect;

        if (SUCCEEDED(g_pTip->get_InPlaceBoundingRectangle(&rect)))
        {
            TRACE("InPlaceBoundingRectangle.top: %d\n", rect.top);
            TRACE("InPlaceBoundingRectangle.left: %d\n", rect.left);
            TRACE("InPlaceBoundingRectangle.bottom: %d\n", rect.bottom);
            TRACE("InPlaceBoundingRectangle.right: %d\n", rect.right);
        }

        int nHeight;

        if (SUCCEEDED(g_pTip->get_PopDownCorrectionHeight(&nHeight)))
        {
            TRACE("PopDownCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->get_PopUpCorrectionHeight(&nHeight)))
        {
            TRACE("PopUpCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->SetInPlacePosition(300, 300, CorrectionPosition_Bottom)))
        {
            TRACE("Call to SetInPlacePosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlacePosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}
vtbl 6 HRESULT get_DefaultInPlaceState(InPlaceState* State)

InPlaceState 列挙型で指定される既定のインプレース状態を取得または設定します。(Get)

StateInPlaceState*outインプレース入力パネルの既定の表示状態を受け取る出力ポインタである。

解説(Remarks)

ユーザーがホバーターゲットをタップしなくても入力パネルが開くようにするには、このプロパティに InPlaceState_Expanded を設定します。既定の状態に InPlaceState_HoverTarget を設定すると、展開状態を維持するかどうかを判断する入力パネルのヒューリスティックが上書きされます。フィールドを切り替える際に既定値を設定しておくと、フォーカスの変更後、入力パネルは折りたたみ状態またはホバー状態に強制されます。システムの既定値は InPlaceState_Auto です。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、ITextInputPanel::DefaultInPlaceState Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 7 HRESULT put_DefaultInPlaceState(InPlaceState State)

InPlaceState 列挙型で指定される既定のインプレース状態を取得または設定します。(Put)

StateInPlaceStateinインプレース入力パネルの既定の表示状態を指定する。

解説(Remarks)

ユーザーがホバーターゲットをタップしなくても入力パネルが開くようにするには、このプロパティに InPlaceState_Expanded を設定します。既定の状態に InPlaceState_HoverTarget を設定すると、展開状態を維持するかどうかを判断する入力パネルのヒューリスティックが上書きされます。フィールドを切り替える際に既定値を設定しておくと、フォーカスの変更後、入力パネルは折りたたみ状態またはホバー状態に強制されます。システムの既定値は InPlaceState_Auto です。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、ITextInputPanel::DefaultInPlaceState Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 8 HRESULT get_CurrentInPlaceState(InPlaceState* State)

InPlaceState 列挙型で指定される現在のインプレース状態を取得します。

StateInPlaceState*outインプレース入力パネルの現在の表示状態を受け取る出力ポインタである。

解説(Remarks)

Tablet PC 入力パネルが閉じられるか非表示になると、現在のインプレース状態は既定の状態にリセットされます。ただし、既定の状態が Auto の場合、現在のインプレース状態は Hover にリセットされます。

この C++ の例では、Edit コントロール IDC_EDIT3EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、TRACE マクロを使用して、いくつかの ITextInputPanel Interface プロパティの値をデバッグ出力に報告します。

void CCOMTIPDlg::OnEnSetFocusEdit3()
{
    if (NULL != g_pTip)
    {
        CorrectionMode mode;

        if (SUCCEEDED(g_pTip->get_CurrentCorrectionMode(&mode)))
        {
            TRACE("CurrentCorrectionMode: %d\n", mode);
        }

        InPlaceState state;

        if (SUCCEEDED(g_pTip->get_CurrentInPlaceState(&state)))
        {
            TRACE("CurrentInPlaceState: %d\n", state);
        }

        PanelInputArea area;

        if (SUCCEEDED(g_pTip->get_CurrentInputArea(&area)))
        {
            TRACE("CurrentInputArea: %d\n", area);
        }

        InteractionMode iMode;

        if (SUCCEEDED(g_pTip->get_CurrentInteractionMode(&iMode)))
        {
            TRACE("CurrentInteractionMode: %d\n", iMode);
        }

        RECT rect;

        if (SUCCEEDED(g_pTip->get_InPlaceBoundingRectangle(&rect)))
        {
            TRACE("InPlaceBoundingRectangle.top: %d\n", rect.top);
            TRACE("InPlaceBoundingRectangle.left: %d\n", rect.left);
            TRACE("InPlaceBoundingRectangle.bottom: %d\n", rect.bottom);
            TRACE("InPlaceBoundingRectangle.right: %d\n", rect.right);
        }

        int nHeight;

        if (SUCCEEDED(g_pTip->get_PopDownCorrectionHeight(&nHeight)))
        {
            TRACE("PopDownCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->get_PopUpCorrectionHeight(&nHeight)))
        {
            TRACE("PopUpCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->SetInPlacePosition(300, 300, CorrectionPosition_Bottom)))
        {
            TRACE("Call to SetInPlacePosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlacePosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}

vtbl 9 HRESULT get_DefaultInputArea(PanelInputArea* Area)

PanelInputArea 列挙型で指定される既定の入力領域を取得または設定します。(Get)

AreaPanelInputArea*out入力パネルの既定の入力領域(手書き入力や文字パッド等)を受け取る出力ポインタである。

解説(Remarks)

システムの既定値は PanelInputArea_Auto ですが、パスワードフィールドではシステムの既定値は PanelInputArea_Keyboard です。既定の入力領域を設定すると、あらゆる場合にシステムの既定値が上書きされます。ただし、現在の認識エンジンがそのモードをサポートしていない、または現在の入力言語に対応する認識エンジンが存在しないために入力領域を利用できない場合は除きます。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、ITextInputPanel::DefaultInputArea Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}

vtbl 10 HRESULT put_DefaultInputArea(PanelInputArea Area)

PanelInputArea 列挙型で指定される既定の入力領域を取得または設定します。(Put)

AreaPanelInputAreain入力パネルの既定の入力領域を指定する。

解説(Remarks)

システムの既定値は PanelInputArea_Auto ですが、パスワードフィールドではシステムの既定値は PanelInputArea_Keyboard です。既定の入力領域を設定すると、あらゆる場合にシステムの既定値が上書きされます。ただし、現在の認識エンジンがそのモードをサポートしていない、または現在の入力言語に対応する認識エンジンが存在しないために入力領域を利用できない場合は除きます。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、ITextInputPanel::DefaultInputArea Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}

vtbl 11 HRESULT get_CurrentInputArea(PanelInputArea* Area)

PanelInputArea 列挙型で指定される現在の入力領域を取得します。

AreaPanelInputArea*out入力パネルで現在表示されている入力領域を受け取る出力ポインタである。

解説(Remarks)

ユーザーが明示的に入力領域を切り替えた場合、現在の入力領域は既定の入力領域と異なります。また、現在の認識エンジンがそのモードをサポートしていない、または現在の入力言語に対応する認識エンジンが存在しないために既定の入力領域を利用できない場合も異なります。Tablet PC 入力パネルが閉じられるか非表示になると、現在の入力領域は既定の入力領域と同じ値にリセットされます。ただし、既定の状態が Auto の場合はリセットされず、最後に表示されていた入力領域を表します。

この C++ の例では、Edit コントロール IDC_EDIT3EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、TRACE マクロを使用して、いくつかの ITextInputPanel Interface プロパティの値をデバッグ出力に報告します。

void CCOMTIPDlg::OnEnSetFocusEdit3()
{
    if (NULL != g_pTip)
    {
        CorrectionMode mode;

        if (SUCCEEDED(g_pTip->get_CurrentCorrectionMode(&mode)))
        {
            TRACE("CurrentCorrectionMode: %d\n", mode);
        }

        InPlaceState state;

        if (SUCCEEDED(g_pTip->get_CurrentInPlaceState(&state)))
        {
            TRACE("CurrentInPlaceState: %d\n", state);
        }

        PanelInputArea area;

        if (SUCCEEDED(g_pTip->get_CurrentInputArea(&area)))
        {
            TRACE("CurrentInputArea: %d\n", area);
        }

        InteractionMode iMode;

        if (SUCCEEDED(g_pTip->get_CurrentInteractionMode(&iMode)))
        {
            TRACE("CurrentInteractionMode: %d\n", iMode);
        }

        RECT rect;

        if (SUCCEEDED(g_pTip->get_InPlaceBoundingRectangle(&rect)))
        {
            TRACE("InPlaceBoundingRectangle.top: %d\n", rect.top);
            TRACE("InPlaceBoundingRectangle.left: %d\n", rect.left);
            TRACE("InPlaceBoundingRectangle.bottom: %d\n", rect.bottom);
            TRACE("InPlaceBoundingRectangle.right: %d\n", rect.right);
        }

        int nHeight;

        if (SUCCEEDED(g_pTip->get_PopDownCorrectionHeight(&nHeight)))
        {
            TRACE("PopDownCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->get_PopUpCorrectionHeight(&nHeight)))
        {
            TRACE("PopUpCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->SetInPlacePosition(300, 300, CorrectionPosition_Bottom)))
        {
            TRACE("Call to SetInPlacePosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlacePosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}
vtbl 12 HRESULT get_CurrentCorrectionMode(CorrectionMode* Mode)

CorrectionMode 列挙型で指定される、現在の修正コームのモードを取得します。

ModeCorrectionMode*out入力パネルの現在の訂正(修正)モードを受け取る出力ポインタである。

解説(Remarks)

メモ Windows 7 では ITextInputPanel インターフェイスの動作が変更されており、Mode パラメーターは戻り時に常に「修正なし」に設定されます。
 
Tablet PC 入力パネルまたは修正コームが表示されていない場合、現在のモードは CorrectionMode_NotVisible です。

この C++ の例では、Edit コントロール IDC_EDIT3EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、TRACE マクロを使用して、いくつかの ITextInputPanel Interface プロパティの値をデバッグ出力に報告します。

void CCOMTIPDlg::OnEnSetFocusEdit3()
{
    if (NULL != g_pTip)
    {
        CorrectionMode mode;

        if (SUCCEEDED(g_pTip->get_CurrentCorrectionMode(&mode)))
        {
            TRACE("CurrentCorrectionMode: %d\n", mode);
        }

        InPlaceState state;

        if (SUCCEEDED(g_pTip->get_CurrentInPlaceState(&state)))
        {
            TRACE("CurrentInPlaceState: %d\n", state);
        }

        PanelInputArea area;

        if (SUCCEEDED(g_pTip->get_CurrentInputArea(&area)))
        {
            TRACE("CurrentInputArea: %d\n", area);
        }

        InteractionMode iMode;

        if (SUCCEEDED(g_pTip->get_CurrentInteractionMode(&iMode)))
        {
            TRACE("CurrentInteractionMode: %d\n", iMode);
        }

        RECT rect;

        if (SUCCEEDED(g_pTip->get_InPlaceBoundingRectangle(&rect)))
        {
            TRACE("InPlaceBoundingRectangle.top: %d\n", rect.top);
            TRACE("InPlaceBoundingRectangle.left: %d\n", rect.left);
            TRACE("InPlaceBoundingRectangle.bottom: %d\n", rect.bottom);
            TRACE("InPlaceBoundingRectangle.right: %d\n", rect.right);
        }

        int nHeight;

        if (SUCCEEDED(g_pTip->get_PopDownCorrectionHeight(&nHeight)))
        {
            TRACE("PopDownCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->get_PopUpCorrectionHeight(&nHeight)))
        {
            TRACE("PopUpCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->SetInPlacePosition(300, 300, CorrectionPosition_Bottom)))
        {
            TRACE("Call to SetInPlacePosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlacePosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}
vtbl 13 HRESULT get_PreferredInPlaceDirection(InPlaceDirection* Direction)

テキスト入力フィールドに対するインプレース入力パネルの推奨方向を取得または設定します。(Get)

DirectionInPlaceDirection*outインプレース入力パネルを表示する優先方向を受け取る出力ポインタである。

解説(Remarks)

アプリケーションは、インプレース入力パネルを既定でテキスト入力フィールドの上下どちらに表示するかを指定できます。そのためには、ITextInputPanel::PreferredInPlaceDirection PropertyInPlaceDirection_Bottom または InPlaceDirection_Top を設定します。ITextInputPanel::PreferredInPlaceDirection Property はあくまで優先設定です。これは、入力パネルを画面内に収めるために必要な場合、インプレース入力パネルがアプリケーションの設定した優先設定を上書きするためです。システムの既定では、可能な場合はテキストフィールドの下に、それ以外の場合は上にインプレース入力パネルを配置します。PreferredInPlaceDirectionInPlaceDirection_Auto を設定すると、システムの既定に戻ります。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、ITextInputPanel::PreferredInPlaceDirection Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 14 HRESULT put_PreferredInPlaceDirection(InPlaceDirection Direction)

テキスト入力フィールドに対するインプレース入力パネルの推奨方向を取得または設定します。(Put)

DirectionInPlaceDirectioninインプレース入力パネルを表示する優先方向を指定する。

解説(Remarks)

アプリケーションは、インプレース入力パネルを既定でテキスト入力フィールドの上下どちらに表示するかを指定できます。そのためには、ITextInputPanel::PreferredInPlaceDirection PropertyInPlaceDirection_Bottom または InPlaceDirection_Top を設定します。ITextInputPanel::PreferredInPlaceDirection Property はあくまで優先設定です。これは、入力パネルを画面内に収めるために必要な場合、インプレース入力パネルがアプリケーションの設定した優先設定を上書きするためです。システムの既定では、可能な場合はテキストフィールドの下に、それ以外の場合は上にインプレース入力パネルを配置します。PreferredInPlaceDirectionInPlaceDirection_Auto を設定すると、システムの既定に戻ります。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、ITextInputPanel::PreferredInPlaceDirection Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 15 HRESULT get_ExpandPostInsertionCorrection(BOOL* Expand)

Tablet PC 入力パネルの修正コームを自動的に展開するかどうかを示す値を取得または設定します。(Get)

ExpandBOOL*out挿入後の訂正領域を展開するかどうかを受け取る出力ポインタである。TRUE で展開する。

解説(Remarks)

メモ Windows 7 では ITextInputPanel インターフェイスの動作が変更されています。Expand パラメーターは戻り時に常に「展開しない」に設定されます。このプロパティを設定しても、何も行われません。
 

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、ITextInputPanel::ExpandPostInsertionCorrection Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 16 HRESULT put_ExpandPostInsertionCorrection(BOOL Expand)

Tablet PC 入力パネルの修正コームを自動的に展開するかどうかを示す値を取得または設定します。(Put)

ExpandBOOLin挿入後の訂正領域を展開するかどうかを指定する。TRUE で展開する。

解説(Remarks)

メモ Windows 7 では ITextInputPanel インターフェイスの動作が変更されています。Expand パラメーターは戻り時に常に「展開しない」に設定されます。このプロパティを設定しても、何も行われません。
 

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、ITextInputPanel::ExpandPostInsertionCorrection Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 17 HRESULT get_InPlaceVisibleOnFocus(BOOL* Visible)

アタッチされているウィンドウがフォーカスを受け取ったときに、Tablet PC 入力パネルを自動的に表示するかどうかを示す値を取得または設定します。(Get)

VisibleBOOL*outフォーカス取得時にインプレース入力パネルを自動表示するかどうかを受け取る出力ポインタである。

解説(Remarks)

コントロールに対して ITextInputPanel::InPlaceVisibleOnFocus PropertyTRUE に設定されている場合、そのコントロールがフォーカスを得たときに、その操作が許可されていれば、Tablet PC 入力パネルは既定の InPlaceState Enumeration の状態で自動的に表示されます。

ITextInputPanel::InPlaceVisibleOnFocus PropertyFALSE に設定すると、インプレース入力パネルと入力パネルアイコンが一切表示されないようにできます。TRUE に設定すると、ユーザーまたはグループポリシーによって無効化されていない限り、可能な場合に表示するというシステムの既定に戻ります。このオプションは、入力パネルの代わりに独自のテキスト入力手段を備えるアプリケーションで役立ちます。

既定値は TRUE です。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、 ITextInputPanel::InPlaceVisibleOnFocus Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 18 HRESULT put_InPlaceVisibleOnFocus(BOOL Visible)

アタッチされているウィンドウがフォーカスを受け取ったときに、Tablet PC 入力パネルを自動的に表示するかどうかを示す値を取得または設定します。(Put)

VisibleBOOLinフォーカス取得時にインプレース入力パネルを自動表示するかどうかを指定する。

解説(Remarks)

コントロールに対して ITextInputPanel::InPlaceVisibleOnFocus PropertyTRUE に設定されている場合、そのコントロールがフォーカスを得たときに、その操作が許可されていれば、Tablet PC 入力パネルは既定の InPlaceState Enumeration の状態で自動的に表示されます。

ITextInputPanel::InPlaceVisibleOnFocus PropertyFALSE に設定すると、インプレース入力パネルと入力パネルアイコンが一切表示されないようにできます。TRUE に設定すると、ユーザーまたはグループポリシーによって無効化されていない限り、可能な場合に表示するというシステムの既定に戻ります。このオプションは、入力パネルの代わりに独自のテキスト入力手段を備えるアプリケーションで役立ちます。

既定値は TRUE です。

この C++ の例では、ITextInputPanel オブジェクト g_pTip を作成し、ITextInputPanel::AttachedEditWindow Property プロパティを設定することで、InkEdit コントロール IDC_EDIT3 のウィンドウハンドルにアタッチします。さらに、 ITextInputPanel::InPlaceVisibleOnFocus Property を設定してから取得します。

if (SUCCEEDED(CoInitialize(NULL)))
{
    if (SUCCEEDED(CoCreateInstance(CLSID_TextInputPanel, NULL, CLSCTX_INPROC, IID_ITextInputPanel, (VOID**)&g_pTip)))
    {
        if (SUCCEEDED(g_pTip->put_AttachedEditWindow(GetDlgItem(IDC_EDIT3)->m_hWnd)))
        {
            g_pTip->put_DefaultInPlaceState(InPlaceState_Expanded);
            InPlaceState ips;
            g_pTip->get_DefaultInPlaceState(&ips);
            TRACE("DefaultInplaceState: %d\n", ips);
            
            g_pTip->put_DefaultInputArea(PanelInputArea_CharacterPad);
            PanelInputArea pia;
            g_pTip->get_DefaultInputArea(&pia);
            TRACE("DefaultInputArea: %d\n", pia);

            g_pTip->put_ExpandPostInsertionCorrection(FALSE);
            BOOL epic;
            g_pTip->get_ExpandPostInsertionCorrection(&epic);
            TRACE("ExpandPostInsertionCorrection: %d\n", epic);

            g_pTip->put_InPlaceVisibleOnFocus(TRUE);
            BOOL ipvof;
            g_pTip->get_InPlaceVisibleOnFocus(&ipvof);
            TRACE("InPlaceVisibleOnFocus: %d\n", ipvof);

            g_pTip->put_PreferredInPlaceDirection(InPlaceDirection_Top);
            InPlaceDirection direction;
            g_pTip->get_PreferredInPlaceDirection(&direction);
            TRACE("PreferredInPlaceDirection: %d\n", direction);
        }
    }
    else
    {
        TRACE("Failed to create ITextInputPanel object.\n");
    }
}
vtbl 19 HRESULT get_InPlaceBoundingRectangle(RECT* BoundingRectangle)

Tablet PC 入力パネルの境界矩形を取得します。

BoundingRectangleRECT*outインプレース入力パネルの境界矩形(画面座標)を受け取る出力ポインタである。

解説(Remarks)

手書きパッドまたは文字パッドがアクティブな場合、インプレース入力パネルの境界矩形には [挿入] ボタンの高さが含まれます。境界矩形に修正コームの高さは含まれません。インプレース入力パネルが自動的に拡大すると、ITextInputPanelEventSink::InPlaceSizeChanging Method/ITextInputPanelEventSink::InPlaceSizeChanged Method のイベントの組が発生し、このプロパティの値は追加された書き込み領域または書き込み行を含むように更新されます。

この C++ の例では、Edit コントロール IDC_EDIT3EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、TRACE マクロを使用して、いくつかの ITextInputPanel Interface プロパティの値をデバッグ出力に報告します。

void CCOMTIPDlg::OnEnSetFocusEdit3()
{
    if (NULL != g_pTip)
    {
        CorrectionMode mode;

        if (SUCCEEDED(g_pTip->get_CurrentCorrectionMode(&mode)))
        {
            TRACE("CurrentCorrectionMode: %d\n", mode);
        }

        InPlaceState state;

        if (SUCCEEDED(g_pTip->get_CurrentInPlaceState(&state)))
        {
            TRACE("CurrentInPlaceState: %d\n", state);
        }

        PanelInputArea area;

        if (SUCCEEDED(g_pTip->get_CurrentInputArea(&area)))
        {
            TRACE("CurrentInputArea: %d\n", area);
        }

        InteractionMode iMode;

        if (SUCCEEDED(g_pTip->get_CurrentInteractionMode(&iMode)))
        {
            TRACE("CurrentInteractionMode: %d\n", iMode);
        }

        RECT rect;

        if (SUCCEEDED(g_pTip->get_InPlaceBoundingRectangle(&rect)))
        {
            TRACE("InPlaceBoundingRectangle.top: %d\n", rect.top);
            TRACE("InPlaceBoundingRectangle.left: %d\n", rect.left);
            TRACE("InPlaceBoundingRectangle.bottom: %d\n", rect.bottom);
            TRACE("InPlaceBoundingRectangle.right: %d\n", rect.right);
        }

        int nHeight;

        if (SUCCEEDED(g_pTip->get_PopDownCorrectionHeight(&nHeight)))
        {
            TRACE("PopDownCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->get_PopUpCorrectionHeight(&nHeight)))
        {
            TRACE("PopUpCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->SetInPlacePosition(300, 300, CorrectionPosition_Bottom)))
        {
            TRACE("Call to SetInPlacePosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlacePosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}
vtbl 20 HRESULT get_PopUpCorrectionHeight(INT* Height)

挿入後修正コームが入力パネルの上に配置されるときの高さを取得します。

HeightINT*out上方向にポップアップする訂正領域の高さ(ピクセル単位)を受け取る出力ポインタである。

解説(Remarks)

メモ Windows 7 では、この関数は常に高さとして 0 を返します。
 
挿入後修正コームが上向きにポップアップした状態でのインプレース入力パネル全体の高さを求めるには、ITextInputPanel::InPlaceBoundingRectangle Property の高さに ITextInputPanel::PopUpCorrectionHeight Property を加算します。

この C++ の例では、Edit コントロール IDC_EDIT3EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、TRACE マクロを使用して、いくつかの ITextInputPanel Interface プロパティの値をデバッグ出力に報告します。

void CCOMTIPDlg::OnEnSetFocusEdit3()
{
    if (NULL != g_pTip)
    {
        CorrectionMode mode;

        if (SUCCEEDED(g_pTip->get_CurrentCorrectionMode(&mode)))
        {
            TRACE("CurrentCorrectionMode: %d\n", mode);
        }

        InPlaceState state;

        if (SUCCEEDED(g_pTip->get_CurrentInPlaceState(&state)))
        {
            TRACE("CurrentInPlaceState: %d\n", state);
        }

        PanelInputArea area;

        if (SUCCEEDED(g_pTip->get_CurrentInputArea(&area)))
        {
            TRACE("CurrentInputArea: %d\n", area);
        }

        InteractionMode iMode;

        if (SUCCEEDED(g_pTip->get_CurrentInteractionMode(&iMode)))
        {
            TRACE("CurrentInteractionMode: %d\n", iMode);
        }

        RECT rect;

        if (SUCCEEDED(g_pTip->get_InPlaceBoundingRectangle(&rect)))
        {
            TRACE("InPlaceBoundingRectangle.top: %d\n", rect.top);
            TRACE("InPlaceBoundingRectangle.left: %d\n", rect.left);
            TRACE("InPlaceBoundingRectangle.bottom: %d\n", rect.bottom);
            TRACE("InPlaceBoundingRectangle.right: %d\n", rect.right);
        }

        int nHeight;

        if (SUCCEEDED(g_pTip->get_PopDownCorrectionHeight(&nHeight)))
        {
            TRACE("PopDownCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->get_PopUpCorrectionHeight(&nHeight)))
        {
            TRACE("PopUpCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->SetInPlacePosition(300, 300, CorrectionPosition_Bottom)))
        {
            TRACE("Call to SetInPlacePosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlacePosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}
vtbl 21 HRESULT get_PopDownCorrectionHeight(INT* Height)

挿入後修正コームが入力パネルの下に配置されるときの高さを取得します。

HeightINT*out下方向にポップダウンする訂正領域の高さ(ピクセル単位)を受け取る出力ポインタである。

解説(Remarks)

メモ Windows 7 では、この関数は常に高さとして 0 を返します。
 
挿入後修正コームが下向きにポップアップした状態でのインプレース入力パネル全体の高さを求めるには、ITextInputPanel::InPlaceBoundingRectangle Property の高さに ITextInputPanel::PopDownCorrectionHeight Property を加算します。
メモ ITextInputPanel::PopUpCorrectionHeight PropertyITextInputPanel::PopDownCorrectionHeight Property 以上の値になります。
 

この C++ の例では、Edit コントロール IDC_EDIT3EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、TRACE マクロを使用して、いくつかの ITextInputPanel Interface プロパティの値をデバッグ出力に報告します。

void CCOMTIPDlg::OnEnSetFocusEdit3()
{
    if (NULL != g_pTip)
    {
        CorrectionMode mode;

        if (SUCCEEDED(g_pTip->get_CurrentCorrectionMode(&mode)))
        {
            TRACE("CurrentCorrectionMode: %d\n", mode);
        }

        InPlaceState state;

        if (SUCCEEDED(g_pTip->get_CurrentInPlaceState(&state)))
        {
            TRACE("CurrentInPlaceState: %d\n", state);
        }

        PanelInputArea area;

        if (SUCCEEDED(g_pTip->get_CurrentInputArea(&area)))
        {
            TRACE("CurrentInputArea: %d\n", area);
        }

        InteractionMode iMode;

        if (SUCCEEDED(g_pTip->get_CurrentInteractionMode(&iMode)))
        {
            TRACE("CurrentInteractionMode: %d\n", iMode);
        }

        RECT rect;

        if (SUCCEEDED(g_pTip->get_InPlaceBoundingRectangle(&rect)))
        {
            TRACE("InPlaceBoundingRectangle.top: %d\n", rect.top);
            TRACE("InPlaceBoundingRectangle.left: %d\n", rect.left);
            TRACE("InPlaceBoundingRectangle.bottom: %d\n", rect.bottom);
            TRACE("InPlaceBoundingRectangle.right: %d\n", rect.right);
        }

        int nHeight;

        if (SUCCEEDED(g_pTip->get_PopDownCorrectionHeight(&nHeight)))
        {
            TRACE("PopDownCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->get_PopUpCorrectionHeight(&nHeight)))
        {
            TRACE("PopUpCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->SetInPlacePosition(300, 300, CorrectionPosition_Bottom)))
        {
            TRACE("Call to SetInPlacePosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlacePosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}
vtbl 22 HRESULT CommitPendingInput()

収集したインクを認識エンジンに送信し、認識結果をポストします。

戻り値

このメソッドは、次のいずれかの値を返します。

戻り値 説明
S_OK
成功しました。
E_UNEXPECTED
パラメーターまたはプロパティの型が想定外です。
E_FAIL
不明なエラーが発生しました。

解説(Remarks)

認識結果は、ITextInputPanel オブジェクトがアタッチされているコントロールに送信されます。

vtbl 23 HRESULT SetInPlaceVisibility(BOOL Visible)

Tablet PC 入力パネルを表示または非表示にします。

VisibleBOOLin入力パネルを表示する場合は TRUE、非表示にする場合は FALSE を指定します。

戻り値

入力パネルを表示できる場合、このメソッドは S_OK を返します。それ以外の場合は E_FAIL を返します。ITextInputPanel::SetInPlaceVisibility Method が入力パネルに影響を与えられる場合と与えられない場合の詳細については、「解説」を参照してください。

戻り値 説明
S_OK
成功しました。
E_FAIL
不明なエラーが発生しました。

解説(Remarks)

入力パネルは、ITextInputPanel::CurrentInPlaceState Property プロパティで指定された状態で表示されます。

Visible パラメーターに TRUE を指定して ITextInputPanel::SetInPlaceVisibility Method を呼び出しても、入力パネルが既に表示されている場合は失敗します。

ユーザーが入力パネルのオプションダイアログでインプレースモードを無効にしている場合、ITextInputPanel::SetInPlaceVisibility Method の呼び出しは失敗します。

表示状態が変化した時点で入力パネルに残っているインクは、自動的に挿入されます。

このメソッドは ITextInputPanel::InPlaceVisibleOnFocus Property の値を変更しません。次にフォーカスが変化すると、動作は ITextInputPanel::InPlaceVisibleOnFocus Property で指定された動作に戻ります。

ITextInputPanel::SetInPlaceVisibility Method は同期呼び出しです。呼び出しが戻る前に入力パネルの表示状態が変更されます。

この C++ の例では、Edit コントロール IDC_EDIT1EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、Visible パラメーターに false を指定して ITextInputPanel::SetInPlaceVisibility Method を呼び出し、入力パネルが表示されないようにします。

void CCOMTIPDlg::OnEnSetfocusEdit1()
{
    if (NULL != g_pTip)
    {
        if (SUCCEEDED(g_pTip->SetInPlaceVisibility(false)))
        {
            TRACE("Successfully hid the Input Panel.\n");
        }
    }
}
vtbl 24 HRESULT SetInPlacePosition(INT xPosition, INT yPosition, CorrectionPosition position)

Tablet PC 入力パネルの位置を画面座標で明示的に指定します。

xPositionINTin修正コームが表示されていない状態での、入力パネルの左上隅の水平方向 (x) 座標。
yPositionINTin修正コームが表示されていない状態での、入力パネルの左上隅の垂直方向 (y) 座標。
positionCorrectionPositionin挿入後修正コームがポップアップする方向。CorrectionPosition 列挙型で定義されます。

戻り値

入力パネルが開いていて (ドッキングまたはフローティング) 移動できない場合は false を返します。それ以外の場合は true を返します。

戻り値 説明
S_OK
成功しました。
E_FAIL
不明なエラーが発生しました。

解説(Remarks)

メモ Windows 7 では、SetInPlacePosition を呼び出しても CorrectionPosition パラメーターは使用されません。
 
入力パネルと修正コームを画面内に収めるため、入力パネルを配置する位置を決める際は修正コームの高さを考慮してください。position パラメーターで指定した方向は、ITextInputPanel::PreferredInPlaceDirection Property で設定した方向を上書きします。

入力パネルを配置できる位置に制限はありません。入力パネルが画面外に出ないようにするのは、アプリケーション開発者の責任です。この目的には、ITextInputPanel::InPlaceBoundingRectangle PropertyITextInputPanel::PopUpCorrectionHeight PropertyITextInputPanel::PopDownCorrectionHeight PropertyITextInputPanelEventSink::InPlaceSizeChanging Method を使用できます。

このメソッドは同期的です。メソッドが戻る前に配置が行われます。

この C++ の例では、Edit コントロール IDC_EDIT3EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、TRACE マクロを使用して、いくつかの ITextInputPanel Interface プロパティの値をデバッグ出力に報告します。さらに、ITextInputPanel::SetInPlacePosition Method を呼び出して入力パネルの位置を設定します。

void CCOMTIPDlg::OnEnSetFocusEdit3()
{
    if (NULL != g_pTip)
    {
        CorrectionMode mode;

        if (SUCCEEDED(g_pTip->get_CurrentCorrectionMode(&mode)))
        {
            TRACE("CurrentCorrectionMode: %d\n", mode);
        }

        InPlaceState state;

        if (SUCCEEDED(g_pTip->get_CurrentInPlaceState(&state)))
        {
            TRACE("CurrentInPlaceState: %d\n", state);
        }

        PanelInputArea area;

        if (SUCCEEDED(g_pTip->get_CurrentInputArea(&area)))
        {
            TRACE("CurrentInputArea: %d\n", area);
        }

        InteractionMode iMode;

        if (SUCCEEDED(g_pTip->get_CurrentInteractionMode(&iMode)))
        {
            TRACE("CurrentInteractionMode: %d\n", iMode);
        }

        RECT rect;

        if (SUCCEEDED(g_pTip->get_InPlaceBoundingRectangle(&rect)))
        {
            TRACE("InPlaceBoundingRectangle.top: %d\n", rect.top);
            TRACE("InPlaceBoundingRectangle.left: %d\n", rect.left);
            TRACE("InPlaceBoundingRectangle.bottom: %d\n", rect.bottom);
            TRACE("InPlaceBoundingRectangle.right: %d\n", rect.right);
        }

        int nHeight;

        if (SUCCEEDED(g_pTip->get_PopDownCorrectionHeight(&nHeight)))
        {
            TRACE("PopDownCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->get_PopUpCorrectionHeight(&nHeight)))
        {
            TRACE("PopUpCorrectionHeight: %d\n", nHeight);
        }

        if (SUCCEEDED(g_pTip->SetInPlacePosition(300, 300, CorrectionPosition_Bottom)))
        {
            TRACE("Call to SetInPlacePosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlacePosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}
vtbl 25 HRESULT SetInPlaceHoverTargetPosition(INT xPosition, INT yPosition)

Tablet PC 入力パネルのホバーターゲットの位置を画面座標で明示的に指定します。

xPositionINTin修正コームが表示されていない状態での、ホバーターゲットの左上隅の水平方向 (x) 座標。
yPositionINTin修正コームが表示されていない状態での、ホバーターゲットの左上隅の垂直方向 (y) 座標。

戻り値

このメソッドは、次のいずれかの値を返します。

戻り値 説明
S_OK
成功しました。
E_FAIL
不明なエラーが発生しました。

解説(Remarks)

ホバーターゲットを配置できる位置に制限はありません。ホバーターゲットが画面内に収まるようにするのは、アプリケーションの責任です。

SetInPlaceHoverTargetPosition メソッドは同期的です。メソッドが戻る前に配置が行われます。

この C++ の例では、Edit コントロール IDC_EDIT2EN_SETFOCUS イベントハンドラーを実装します。まず、ITextInputPanel オブジェクト g_pTip が作成済みかどうかを確認します。存在する場合は、ITextInputPanel::SetInPlaceHoverTargetPosition Method を呼び出して入力パネルのホバーターゲットの位置を設定します。その後、TRACE マクロを使用して、呼び出しが成功したかどうかをデバッグ出力に報告します。

void CCOMTIPDlg::OnEnSetfocusEdit2()
{
    if (NULL != g_pTip)
    {
        if (SUCCEEDED(g_pTip->SetInPlaceHoverTargetPosition(300, 300)))
        {
            TRACE("Call to SetInPlaceHoverTargetPosition() succeeded.\n");
        }
        else
        {
            TRACE("Call to SetInPlaceHoverTargetPosition() failed.\n");
        }
    }
    else
    {
        TRACE("ITextInputPanel object is NULL.\n");
    }
}
vtbl 26 HRESULT Advise(ITextInputPanelEventSink* EventSink, DWORD EventMask)

Tablet PC 入力パネルと、指定されたシンクオブジェクトとの間にアドバイザリ接続を確立します。

EventSinkITextInputPanelEventSink*inoptional入力パネルからイベント通知を受け取るシンクオブジェクトへの参照。
EventMaskDWORDin対象とするイベントを示す EventMask Enumeration のビット単位の値。

戻り値

このメソッドは、次のいずれかの値を返します。

戻り値 説明
S_OK
成功しました。
E_FAIL
不明なエラーが発生しました。
vtbl 27 HRESULT Unadvise(ITextInputPanelEventSink* EventSink)

ITextInputPanel::Advise Method によって以前に確立されたアドバイザリ接続を終了します。

EventSinkITextInputPanelEventSink*inoptional現在、入力パネルからイベント通知を受け取っているシンクオブジェクトへの参照。

戻り値

このメソッドは、次のいずれかの値を返します。

戻り値 説明
S_OK
成功しました。
E_FAIL
不明なエラーが発生しました。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"

出力引数:
#define global IID_ITextInputPanel "{6B6A65A5-6AF3-46C2-B6EA-56CD1F80DF71}"
#usecom global ITextInputPanel IID_ITextInputPanel "{F9B189D7-228B-4F2B-8650-B97F59E02C8C}"
#comfunc global ITextInputPanel_get_AttachedEditWindow             3 sptr
#comfunc global ITextInputPanel_put_AttachedEditWindow             4 sptr
#comfunc global ITextInputPanel_get_CurrentInteractionMode         5 var
#comfunc global ITextInputPanel_get_DefaultInPlaceState            6 var
#comfunc global ITextInputPanel_put_DefaultInPlaceState            7 int
#comfunc global ITextInputPanel_get_CurrentInPlaceState            8 var
#comfunc global ITextInputPanel_get_DefaultInputArea               9 var
#comfunc global ITextInputPanel_put_DefaultInputArea               10 int
#comfunc global ITextInputPanel_get_CurrentInputArea               11 var
#comfunc global ITextInputPanel_get_CurrentCorrectionMode          12 var
#comfunc global ITextInputPanel_get_PreferredInPlaceDirection      13 var
#comfunc global ITextInputPanel_put_PreferredInPlaceDirection      14 int
#comfunc global ITextInputPanel_get_ExpandPostInsertionCorrection  15 var
#comfunc global ITextInputPanel_put_ExpandPostInsertionCorrection  16 int
#comfunc global ITextInputPanel_get_InPlaceVisibleOnFocus          17 var
#comfunc global ITextInputPanel_put_InPlaceVisibleOnFocus          18 int
#comfunc global ITextInputPanel_get_InPlaceBoundingRectangle       19 var
#comfunc global ITextInputPanel_get_PopUpCorrectionHeight          20 var
#comfunc global ITextInputPanel_get_PopDownCorrectionHeight        21 var
#comfunc global ITextInputPanel_CommitPendingInput                 22
#comfunc global ITextInputPanel_SetInPlaceVisibility               23 int
#comfunc global ITextInputPanel_SetInPlacePosition                 24 int,int,int
#comfunc global ITextInputPanel_SetInPlaceHoverTargetPosition      25 int,int
#comfunc global ITextInputPanel_Advise                             26 sptr,int
#comfunc global ITextInputPanel_Unadvise                           27 sptr
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※#usecom 末尾は CoCreateInstance 用のクラスID(コクラスCLSID, SDKから自動取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。