CWnd::SetCaretPos

Imposta la posizione del cursore.

static void PASCAL SetCaretPos(
   POINT point 
);

Parametri

  • point
    Specifica la nuove coordinate x e y (coordinate del client) del cursore.

Note

La funzione membro SetCaretPos sposta il cursore solo se è posseduta da una finestra nell'attività corrente.SetCaretPos sposta il cursore se il cursore è nascosto.

Il cursore si trova una risorsa condivisa.Una finestra non deve spostare il cursore se non possiede il cursore.

Esempio

// 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);
}

Requisiti

Header: afxwin.h

Vedere anche

Riferimenti

Classe CWnd

Grafico della gerarchia

CWnd::GetCaretPos

SetCaretPos