TerTextPosToPix
Retrieve the pixel position of the text.
BOOL TerTextPosToPix(hWnd, RelativeTo, line, col, x, y)
HWND hWnd; | Handle of the window to be accessed |
int RelativeTo; | This parameter should be set to one of the following constants: |
REL_SCREEN: To return the x/y values relative to the top of the screen.
REL_WINDOW: To return the x/y values relative to the client area of the edit control.
REL_TEXT_BOX: To return the x/y values relative to the top of the text box.
long line; | The line number of the text to find position. Set this parameter to -1 to retrieve the pixel position of the text at the current caret location. |
int col; | The column number of the text to find position. To specify an absolute location, set the col to -1, and specify the absolute position in the 'line' argument. |
LPINT x; | The parameter to receive the x pixel position. |
LPINT y; | The parameter to receive the y pixel position. |
Return Value: This function returns TRUE when successful.
Example: The example below retrieves the pixel position at the current cursor location relative to the top of the text box.
int x,y,
TerTextPosToPix(hWnd, REL_TEXT_BOX, -1, -1, &x, &y);