Click here to Skip to main content
15,904,288 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalactivate control Pin
aguest8-Jun-03 11:05
aguest8-Jun-03 11:05 
GeneralRe: activate control Pin
valikac8-Jun-03 13:26
valikac8-Jun-03 13:26 
GeneralRe: activate control Pin
aguest8-Jun-03 14:18
aguest8-Jun-03 14:18 
GeneralRe: activate control Pin
aguest8-Jun-03 14:19
aguest8-Jun-03 14:19 
GeneralRe: activate control Pin
Dominik Reichl8-Jun-03 22:00
Dominik Reichl8-Jun-03 22:00 
GeneralRe: activate control Pin
aguest9-Jun-03 5:28
aguest9-Jun-03 5:28 
GeneralRe: activate control Pin
Dominik Reichl9-Jun-03 6:47
Dominik Reichl9-Jun-03 6:47 
GeneralRe: activate control Pin
aguest9-Jun-03 9:12
aguest9-Jun-03 9:12 
QuestionError on AutoRun ???? Pin
_skidrow_vn_8-Jun-03 10:45
_skidrow_vn_8-Jun-03 10:45 
QuestionCan someone help me debug this? Pin
Anonymous8-Jun-03 10:40
Anonymous8-Jun-03 10:40 
AnswerRe: Can someone help me debug this? Pin
ZoogieZork8-Jun-03 11:19
ZoogieZork8-Jun-03 11:19 
GeneralRe: Can someone help me debug this? Pin
Anonymous8-Jun-03 11:47
Anonymous8-Jun-03 11:47 
GeneralRe: Can someone help me debug this? Pin
geo_m8-Jun-03 21:30
geo_m8-Jun-03 21:30 
GeneralXP Manifest Pin
Toni788-Jun-03 10:01
Toni788-Jun-03 10:01 
GeneralRe: XP Manifest Pin
Michael Dunn8-Jun-03 10:16
sitebuilderMichael Dunn8-Jun-03 10:16 
GeneralRe: XP Manifest Pin
Toni788-Jun-03 11:15
Toni788-Jun-03 11:15 
GeneralRe: XP Manifest Pin
Michael Dunn8-Jun-03 15:07
sitebuilderMichael Dunn8-Jun-03 15:07 
GeneralRe: XP Manifest Pin
Toni788-Jun-03 17:58
Toni788-Jun-03 17:58 
GeneralUsing Multiple Tables in an Access Database Pin
Anonymous8-Jun-03 5:03
Anonymous8-Jun-03 5:03 
GeneralRe: Using Multiple Tables in an Access Database Pin
Toni788-Jun-03 8:40
Toni788-Jun-03 8:40 
GeneralRe: Using Multiple Tables in an Access Database Pin
RichardGrimmer10-Jun-03 5:03
RichardGrimmer10-Jun-03 5:03 
GeneralDesktop Dancer Pin
dfsgdsfgdfg8-Jun-03 4:23
dfsgdsfgdfg8-Jun-03 4:23 
GeneralRe: Desktop Dancer Pin
Toni788-Jun-03 8:42
Toni788-Jun-03 8:42 
GeneralRe: Desktop Dancer Pin
ZoogieZork8-Jun-03 10:39
ZoogieZork8-Jun-03 10:39 
GeneralClipboard problem with CRichEdit Pin
Michael Pauli8-Jun-03 4:06
Michael Pauli8-Jun-03 4:06 
Hi!

I want to retain only *one* text-format in a CRichEdit derived class of mine. Now if the user paste text into my edit this plan goes not so well.

Then I try something like this:

<br />
BOOL CCalEdit::PreTranslateMessage(MSG *pMSG)<br />
{<br />
 BOOL bResult = CRichEditCtrl::PreTranslateMessage(pMSG);<br />
 if(pMSG)<br />
 {<br />
  if((pMSG->message & WM_COPY) == 1 && IsKeyPressed(VK_CONTROL)):-O<br />
  {<br />
   if(::OpenClipboard(NULL))<br />
   {<br />
    HANDLE hCB = ::GetClipboardData(CF_TEXT);<br />
    if(hCB)<br />
    {<br />
     LPVOID pCB_Void = (LPVOID)hCB;<br />
     LPSTR pCB_String = (LPSTR)pCB_Void;<br />
     CString cstrCB(pCB_String);<br />
     if(!cstrCB.IsEmpty())<br />
     {<br />
       HideSelection(TRUE, FALSE);<br />
       SetSel(0, -1);<br />
       CString cstrThis(GetSelText());<br />
       ReplaceSel(cstrThis);<br />
       HideSelection(FALSE, FALSE);<br />
     }<br />
    }<br />
    ::CloseClipboard();<br />
   }<br />
  }<br />
 }<br />
 return bResult;<br />
}<br />


Seems like I got several problems.

a. My Blush | :O -if(...) is not a 100% secure way to determine if a paste op. is in progress - ??? How do I do that?
b. Second - how do I apply my format to the text on the clipboard?

I've have a SetDefaultCharFormat() in my class that I call when I create the edit and it's the job it does that I want to apply also on the text on the clipboars *before* it is pasted in.

I appreciate any idéa.

Ps. There seems to be a LOT of WM_PASTE going ind - after some testing I ended up with: (pMSG->message & WM_COPY) == 1 - don't say it's perfect yet.



Regards,
Michael Mogensen, mm it-consult dk.

><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.