Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
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
good
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.
  Permalink  
Comments
Member 9434903 at 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 at 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 at 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 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 359
1 Nirav Prabtani 273
2 OriginalGriff 229
3 _Amy 165
4 Maciej Los 145
0 OriginalGriff 7,744
1 Sergey Alexandrovich Kryukov 6,956
2 Maciej Los 3,994
3 Peter Leow 3,708
4 CHill60 2,742


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 18 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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