Click here to Skip to main content
13,593,048 members
Rate this:
Please Sign up or sign in to vote.
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 17-Sep-12 20:59pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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.

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.
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.

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180618.1 | Last Updated 18 Sep 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100