Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
1. resize rich edit and one more application so that both u can see on screen.
2. click in another application.
3. then click in rich edit,cursor will blink in old position in rich edit still while it should be placed where user clicked in rich edit.

can any one help me to resolve it.

please let me know if more info required.
Posted

1 solution

use EM_EXGETSEL[^] to get the current location and save it and do this action when window lost it focus.

And also use EM_EXSETSEL[^] Window get back the focus to restore your last selected location.

EM_EXGETSEL will return you two position Min and Max, they will be equal if nothing is selected. If you don't understand ask.
 
Share this answer
 
Comments
Member 9434903 18-Sep-12 4:47am    
Thanks for ur quick reply
it is happening in code already.
but new requirement is to place the cursor at the location where user clicks not to place where last time clicked.
It would be very helpful if u try the same in word document also.

Thanks
Mohibur Rashid 18-Sep-12 5:07am    
You can do what I would do, go to msdn open the page for Rich Edit Control. you can also follow the above links and also read through. That's how I got the current answer.
Member 9434903 18-Sep-12 5:35am    
i regret if u mean it wrong but i just wanted help to resolve the issue and it may help.
actually the same issue is happening in MS Word also thats why i asked which may help me to explain u the issue.

Thanks
Mohibur Rashid 18-Sep-12 5:55am    
oh no, I didn't meant it wrong way. Actually I am in the office. So, if I have to answer you I will have to read the entire document. That's what I said. My intention is not to hurt you. Sorry if you miss read me. I asked you to read the document. It will give you better answer. I mean read this

http://msdn.microsoft.com/en-us/library/windows/desktop/bb787605%28v=vs.85%29.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900