Re: Clipboard Data conversion...!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: ALESSANDRO Baraldi (ik2zok_at_libero.it)
Date: 11/25/04


Date: Fri, 26 Nov 2004 00:10:31 +0100


"Mike D Sutton" <EDais@mvps.org> ha scritto nel messaggio
news:eqQ41vy0EHA.1452@TK2MSFTNGP11.phx.gbl...
> > I have a html string and i need to show it on RichText API control that
> > support only RTF, so i try some parsing code, bud with no much success.
> > The html come from mime decoded message.
>
> The clipboard will synthesise the copied clipboard data in other formats
where possible, you may find that it's already done the
> HTML -> RTF conversion for you.
> Hope this helps,
>
> Mike
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais@mvps.org
> WWW: http://EDais.mvps.org/

This is what i suppose reading MSDN....!
But i've some difficulties to built it....!!!!

I copy to the Clipboard my RTF string after building RTF format.

CF_RTF = RegisterClipboardFormat("Rich Text Format")
CF_HTML= RegisterClipboardFormat("HTML Format")

Function SetClipBoard(strRTF_IN As String) As Boolean
  Dim hMainMem As Long
  Dim lpMainMem As Long
  Dim hCMem As Long

  hMainMem = GlobalAlloc(GHND, Len(strRTF_IN) + 1)
  lpMainMem = GlobalLock(hMainMem )
  lpMainMem = lstrcpy(lpMainMem , strRTF_IN)
  If GlobalUnlock(hMainMem ) = 0 Then
    If OpenClipboard(0&) <> 0 Then
      Call EmptyClipboard
      hCMem = SetClipboardData(CF_RTF, hMainMem )
      SetClipBoard = CBool(CloseClipboard)
    End If
  End If
End Function

Now i have on Clipboard my binary data..., how can i Getit on
HTML...?

Thanks for your suggestion.

-- 
@Alex (Alessandro Baraldi)
---------------------------------------------------------------------------
http://www.sitocomune.com/
http://www.mantuanet.it/alessandro.baraldi/
---------------------------------------------------------------------------


Relevant Pages