カレットの位置を設定します。
static void PASCAL SetCaretPos(
POINT point
);
パラメーター
- point
カレットの新しい x 座標と y 座標を (クライアント座標で) 指定します。
解説
SetCaretPos メンバー関数は、カレットが現在のタスクのウィンドウによって所有されている場合だけ、カレットを移動します。 SetCaretPos は、カレットが非表示かどうかにかかわらずカレットを移動します。
カレットは共有リソースです。 CWnd がカレットを所有していない場合は、ウィンドウは移動できません。
使用例
// The following code snippet shows a caret when the left
// mouse button is pressed, and sets the caret's positon to
// the cursor's position.
void CMyView::OnLButtonDown(UINT nFlags, CPoint point)
{
//create a solid caret, the width is 2, the length is 20.
CreateSolidCaret(2, 20);
SetCaretPos(point);
ShowCaret();
CView::OnLButtonDown(nFlags, point);
}
必要条件
**ヘッダー:**afxwin.h