Click here to Skip to main content
15,897,226 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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.

><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>
GeneralRe: Clipboard problem with CRichEdit Pin
Ryan Binns8-Jun-03 5:02
Ryan Binns8-Jun-03 5:02 
GeneralRe: Clipboard problem with CRichEdit Pin
Michael Pauli9-Jun-03 3:57
Michael Pauli9-Jun-03 3:57 
GeneralRe: Clipboard problem with CRichEdit Pin
Ryan Binns9-Jun-03 4:05
Ryan Binns9-Jun-03 4:05 
GeneralC++ GUI library question Pin
Member 2982688-Jun-03 2:43
Member 2982688-Jun-03 2:43 
GeneralRe: C++ GUI library question Pin
Michael P Butler8-Jun-03 4:05
Michael P Butler8-Jun-03 4:05 
GeneralRe: C++ GUI library question Pin
Member 2982689-Jun-03 8:06
Member 2982689-Jun-03 8:06 
GeneralRe: C++ GUI library question Pin
Michael P Butler12-Jun-03 8:31
Michael P Butler12-Jun-03 8:31 
Generaltypedef CList<int,int> CPersonList (compilation error) Pin
yccheok7-Jun-03 23:47
yccheok7-Jun-03 23:47 
GeneralRe: typedef CList<int,int> CPersonList (compilation error) Pin
Bartosz Bien8-Jun-03 2:00
Bartosz Bien8-Jun-03 2:00 
GeneralCheck for Unicode Pin
Dominik Reichl7-Jun-03 23:19
Dominik Reichl7-Jun-03 23:19 
GeneralRe: Check for Unicode Pin
Andrew Walker7-Jun-03 23:42
Andrew Walker7-Jun-03 23:42 
GeneralRe: Check for Unicode Pin
Ryan Binns8-Jun-03 4:43
Ryan Binns8-Jun-03 4:43 
GeneralRe: Check for Unicode Pin
Dominik Reichl8-Jun-03 5:15
Dominik Reichl8-Jun-03 5:15 
GeneralRe: Check for Unicode Pin
PJ Arends8-Jun-03 9:29
professionalPJ Arends8-Jun-03 9:29 
GeneralRe: Check for Unicode Pin
Dominik Reichl8-Jun-03 21:01
Dominik Reichl8-Jun-03 21:01 
GeneralRichedit control in Win32 C++ Pin
tareqsiraj7-Jun-03 19:49
tareqsiraj7-Jun-03 19:49 
GeneralRe: Richedit control in Win32 C++ Pin
Michael Dunn7-Jun-03 20:17
sitebuilderMichael Dunn7-Jun-03 20:17 

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.