I need to get the cursor location inside my RichEdit, There is no such thing as EM_GETCURSOR, or anything...
All i can get is the scroll position of my vscrollbar...
I need to get the cursor location inside my RichEdit, There is no such thing as EM_GETCURSOR, or anything...
All i can get is the scroll position of my vscrollbar...
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu
http://msdn.microsoft.com/library/de.../em_getsel.aspOriginally Posted by MSDN
-r1ck0r
I don't want the selection, i just want the current cursor location. Or can i get that from selection???
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu
If no text is selected, both the starting character position and the ending character position will be equal, this value will be the cursor position.
thanks.
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu
I need to convert that number to int, do you have any idea how to do that?
Heres what i tryed:
Code:int where = 0; LPDWORD where1 = 0; SendMessage(children.eBook, EM_GETSEL, 0, (LPARAM)where1); where = (int)where1; // this doesn't work
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu
Code:DWORD start; DWORD end; SendMessage(hwnd, EM_GETSEL, (WPARAM) &start, (LPARAM) &end); where = end;
Last edited by anonytmouse; 12-24-2005 at 04:19 AM.
althought I have no idea (remember your excelent comment?) , you should get the client rect to get the entire client area, the get the edit rect, and finaly get the cursor position, with some simple calculations you will be able to relate those 10 values to get the cursor position inside the edit
niara
^That's a whole lot of fuss considering the EM_GETSEL message does the exact thing he wants, why reinvent the wheel?
agree.Originally Posted by r1ck0r
So heres what i want to do...
I want to write down the current location of cursor on a status control,
therefor i need the string.
But i just don't know how todo this...
If you got any other suggestion on how to do this i will highly appreciate it.Code:char text[50]; int location = 0; DWORD where = 0; SendMessage(xxx, EM_GETSEL ,............ location = where; // need to figure this out somehow sprintf(text,"Location %i", location);
lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu