Einzelnen Beitrag anzeigen

Robert Marquardt
(Gast)

n/a Beiträge
 
#2

Re: Caret-Pixel-Position eines Editfeldes auslesen?

  Alt 11. Jan 2006, 12:24
Klauen wir mal bei der MSDN Hilfe. Es gibt immer nur genau ein Caret, daher ist kein Fensterparameter enthalten.
Die Editbox muss den Fokus haben, damit man die Position des Carets in der Editbox erhaelt.

The GetCaretPos function copies the caret's position to the specified POINT structure.

Syntax

BOOL GetCaretPos(LPPOINT lpPoint);

Parameters

lpPoint
[out] Pointer to the POINT structure that is to receive the client coordinates of the caret.

Return Value

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The caret position is always given in the client coordinates of the window that contains the caret.
  Mit Zitat antworten Zitat