Browse Source

added option to draw rtf text in list
[SAB]


git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@151 595ec19a-5cb4-439b-94a8-42fb3063c22c

sabrogden 21 years ago
parent
commit
6892e4c129
16 changed files with 901 additions and 21 deletions
  1. 14 2
      CP_Main.dsp
  2. 19 13
      CP_Main.rc
  3. 434 0
      FormattedTextDraw.cpp
  4. 206 0
      FormattedTextDraw.h
  5. 98 0
      IEncryption.h
  6. 29 0
      Misc.cpp
  7. 8 0
      Misc.h
  8. 3 0
      OptionsQuickPaste.cpp
  9. 1 0
      OptionsQuickPaste.h
  10. 64 2
      QListCtrl.cpp
  11. 6 0
      QListCtrl.h
  12. 9 2
      QPasteWnd.cpp
  13. 1 0
      QPasteWnd.h
  14. 3 1
      Resource.h
  15. 3 0
      StdAfx.h
  16. 3 1
      ToolTipEx.h

+ 14 - 2
CP_Main.dsp

@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
-# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"Release/Ditto.exe" /libpath:"focusdll\Release"
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib riched20.lib /nologo /subsystem:windows /map /debug /machine:I386 /out:"Release/Ditto.exe" /libpath:"focusdll\Release"
 
 !ELSEIF  "$(CFG)" == "CP_Main - Win32 Debug"
 
@@ -79,7 +79,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/Ditto.exe" /pdbtype:sept
+# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib riched20.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/Ditto.exe" /pdbtype:sept
 
 !ENDIF 
 
@@ -119,6 +119,14 @@ SOURCE=.\DialogResizer.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\FormattedTextDraw.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\FormattedTextDraw.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\GroupStatic.cpp
 # End Source File
 # Begin Source File
@@ -389,6 +397,10 @@ SOURCE=.\HyperLink.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\IEncryption.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\InternetUpdate.h
 # End Source File
 # Begin Source File

+ 19 - 13
CP_Main.rc

@@ -264,6 +264,8 @@ BEGIN
 
             MENUITEM "Show Thumbnails",             ID_MENU_QUICKOPTIONS_SHOWTHUMBNAILS
 
+            MENUITEM "Draw RTF Text",               ID_MENU_QUICKOPTIONS_DRAWRTFTEXT
+
         END
         POPUP "Sent To"
         BEGIN
@@ -390,7 +392,7 @@ BEGIN
     PUSHBUTTON      "&Delete",IDC_DELETE,147,30,38,14
 END
 
-IDD_OPTIONS_QUICK_PASTE DIALOG DISCARDABLE  0, 0, 229, 227
+IDD_OPTIONS_QUICK_PASTE DIALOG DISCARDABLE  0, 0, 332, 249
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Quick Paste"
 FONT 8, "MS Sans Serif"
@@ -412,21 +414,25 @@ BEGIN
     CONTROL         "Enable Quick Paste Transparency",IDC_TRANSPARENCY,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,67,122,10
     EDITTEXT        IDC_TRANS_PERC,140,66,19,12,ES_AUTOHSCROLL
-    PUSHBUTTON      "Font",IDC_BUTTON_FONT,18,91,143,17
-    PUSHBUTTON      "Default Font",IDC_BUTTON_DEFAULT_FAULT,164,94,48,12
+    PUSHBUTTON      "Font",IDC_BUTTON_FONT,18,104,143,17
+    PUSHBUTTON      "Default Font",IDC_BUTTON_DEFAULT_FAULT,164,107,48,12
     CONTROL         "At Caret",IDC_AT_CARET,"Button",BS_AUTORADIOBUTTON,29,
-                    119,41,10
+                    132,41,10
     CONTROL         "At Cursor",IDC_AT_CURSOR,"Button",BS_AUTORADIOBUTTON,29,
-                    129,45,10
+                    142,45,10
     CONTROL         "At Previous Position",IDC_AT_PREVIOUS,"Button",
-                    BS_AUTORADIOBUTTON,29,139,79,10
+                    BS_AUTORADIOBUTTON,29,152,79,10
     LTEXT           "%",IDC_STATIC,162,69,8,8
-    GROUPBOX        "Popup Positioning",IDC_STATIC,18,110,116,41
+    GROUPBOX        "Popup Positioning",IDC_STATIC,18,123,116,41
     LTEXT           "  * = Don't Auto Delete\n  s = Shortcut exists\n G = Item is a Group\n  ! = Item is attached to a Group",
-                    IDC_STATIC,24,167,103,36
-    GROUPBOX        "List Item Prefix Legend",IDC_STATIC,18,157,116,50
-    CONTROL         "Show thumbnails (for CF_DIB types)",IDC_SHOW_THUMBNAILS,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,79,129,10
+                    IDC_STATIC,24,180,103,36
+    GROUPBOX        "List Item Prefix Legend",IDC_STATIC,18,170,116,50
+    CONTROL         "Show thumbnails (for CF_DIB types) (Could Increase Memory Usage and Display Speed)",
+                    IDC_SHOW_THUMBNAILS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,18,79,293,10
+    CONTROL         "Draw RTF Text in List (for RTF types) (Could Increase Memory Usage an Display Speed)",
+                    IDC_DRAW_RTF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,89,
+                    293,10
 END
 
 IDD_OPTIONS_KEYSTROKES DIALOG DISCARDABLE  0, 0, 302, 206
@@ -766,9 +772,9 @@ BEGIN
     IDD_OPTIONS_QUICK_PASTE, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 222
+        RIGHTMARGIN, 325
         TOPMARGIN, 7
-        BOTTOMMARGIN, 219
+        BOTTOMMARGIN, 241
     END
 
     IDD_OPTIONS_KEYSTROKES, DIALOG

+ 434 - 0
FormattedTextDraw.cpp

@@ -0,0 +1,434 @@
+// Feel free to use this code in your own applications.
+// The Author does not guarantee anything about this code.
+// Author : Yves Maurer
+
+// FormattedTextDraw.cpp : Implementation of CFormattedTextDraw
+#include "stdafx.h"
+#include "FormattedTextDraw.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CallBack functions
+
+DWORD CALLBACK EditStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
+{
+	PCOOKIE pCookie = (PCOOKIE) dwCookie;
+
+	if(pCookie->dwSize - pCookie->dwCount < (DWORD) cb)
+		*pcb = pCookie->dwSize - pCookie->dwCount;
+	else
+		*pcb = cb;
+
+	CopyMemory(pbBuff, pCookie->bstrText, *pcb);
+	pCookie->dwCount += *pcb;
+
+	return 0;	//	callback succeeded - no errors
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CFormattedTextDraw
+
+HRESULT CFormattedTextDraw::get_RTFText(BSTR *pVal)
+{
+	*pVal = SysAllocStringLen(m_RTFText, SysStringLen(m_RTFText));
+	return S_OK;
+}
+
+HRESULT CFormattedTextDraw::put_RTFText(BSTR newVal)
+{
+	HRESULT hr;
+	long    len;
+	LRESULT lResult = 0;
+	EDITSTREAM editStream;
+
+	if (m_RTFText != NULL)
+		SysFreeString(m_RTFText);
+	len = SysStringLen(newVal);
+	m_RTFText = SysAllocStringLen(newVal, len);
+
+	if (!m_spTextServices) 
+		return S_FALSE;
+
+	m_editCookie.bstrText = (BSTR) malloc(len + 1);
+	WideCharToMultiByte(CP_ACP, 0, m_RTFText, len, (char *) m_editCookie.bstrText, len, NULL, NULL);
+	m_editCookie.dwSize = lstrlenA((LPSTR) m_editCookie.bstrText);
+	m_editCookie.dwCount = 0;
+
+	editStream.dwCookie = (DWORD_PTR) &m_editCookie;
+	editStream.dwError = 0;
+	editStream.pfnCallback = EditStreamInCallback;
+	hr = m_spTextServices->TxSendMessage(EM_STREAMIN, (WPARAM)(SF_RTF | SF_UNICODE), (LPARAM)&editStream, &lResult);
+	return S_OK;
+}
+
+HRESULT CFormattedTextDraw::Draw(void *hdcDraw, RECT *prc)
+{
+	if (!m_spTextServices) 
+		return S_FALSE;
+
+	m_spTextServices->TxDraw(
+	    DVASPECT_CONTENT,  		// Draw Aspect
+		0,						// Lindex
+		NULL,					// Info for drawing optimization
+		NULL,					// target device information
+		(HDC) hdcDraw,				// Draw device HDC
+		NULL,			 	   	// Target device HDC
+		(RECTL *) prc,			// Bounding client rectangle
+		NULL,					// Clipping rectangle for metafiles
+		(RECT *) NULL,			// Update rectangle
+		NULL, 	   				// Call back function
+		NULL,					// Call back parameter
+		TXTVIEW_INACTIVE);		// What view of the object could be TXTVIEW_ACTIVE
+	return S_OK;
+}
+
+HRESULT CFormattedTextDraw::Create()
+{
+	return CreateTextServicesObject();
+}
+
+HRESULT CFormattedTextDraw::get_NaturalWidth(long Height, long *pVal)
+{
+	long lWidth;
+	SIZEL szExtent;
+	HDC	hdcDraw;
+
+	if (!m_spTextServices)
+		return S_FALSE;
+
+	hdcDraw = GetDC(NULL);
+	szExtent.cy = Height;
+	szExtent.cx = 10000;
+	lWidth = 10000;
+	m_spTextServices->TxGetNaturalSize(DVASPECT_CONTENT, 
+		hdcDraw, 
+		NULL,
+		NULL,
+		TXTNS_FITTOCONTENT,
+		&szExtent,
+		&lWidth,
+		&Height);
+
+	ReleaseDC(NULL, hdcDraw);
+	*pVal = lWidth;
+	return S_OK;
+}
+
+HRESULT CFormattedTextDraw::get_NaturalHeight(long Width, long *pVal)
+{
+	long lHeight;
+	SIZEL szExtent;
+	HDC	hdcDraw;
+
+	if (!m_spTextServices)
+		return S_FALSE;
+
+	hdcDraw = GetDC(NULL);
+	szExtent.cx = Width;
+	szExtent.cy = 10000;
+	lHeight = 10000;
+	m_spTextServices->TxGetNaturalSize(DVASPECT_CONTENT, 
+		hdcDraw, 
+		NULL,
+		NULL,
+		TXTNS_FITTOCONTENT,
+		&szExtent,
+		&Width,
+		&lHeight);
+
+	ReleaseDC(NULL, hdcDraw);
+	*pVal = lHeight;
+	return S_OK;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// ITextHost functions
+HDC CFormattedTextDraw::TxGetDC()
+{
+	return NULL;
+}
+
+INT CFormattedTextDraw::TxReleaseDC(HDC hdc)
+{
+	return 1;
+}
+
+BOOL CFormattedTextDraw::TxShowScrollBar(INT fnBar, BOOL fShow)
+{
+	return FALSE;
+}
+
+BOOL CFormattedTextDraw::TxEnableScrollBar(INT fuSBFlags, INT fuArrowflags)
+{
+	return FALSE;
+}
+
+BOOL CFormattedTextDraw::TxSetScrollRange(INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw)
+{
+	return FALSE;
+}
+
+BOOL CFormattedTextDraw::TxSetScrollPos(INT fnBar, INT nPos, BOOL fRedraw)
+{
+	return FALSE;
+}
+
+void CFormattedTextDraw::TxInvalidateRect(LPCRECT prc, BOOL fMode)
+{
+}
+
+void CFormattedTextDraw::TxViewChange(BOOL fUpdate)
+{
+}
+
+BOOL CFormattedTextDraw::TxCreateCaret(HBITMAP hbmp, INT xWidth, INT yHeight)
+{
+	return FALSE;
+}
+
+BOOL CFormattedTextDraw::TxShowCaret(BOOL fShow)
+{
+	return FALSE;
+}
+
+BOOL CFormattedTextDraw::TxSetCaretPos(INT x, INT y)
+{
+	return FALSE;
+}
+
+BOOL CFormattedTextDraw::TxSetTimer(UINT idTimer, UINT uTimeout)
+{
+	return FALSE;
+}
+
+void CFormattedTextDraw::TxKillTimer(UINT idTimer)
+{
+}
+
+void CFormattedTextDraw::TxScrollWindowEx(INT dx, INT dy, LPCRECT lprcScroll, LPCRECT lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate, UINT fuScroll)
+{
+}
+
+void CFormattedTextDraw::TxSetCapture(BOOL fCapture)
+{
+}
+
+void CFormattedTextDraw::TxSetFocus()
+{
+}
+
+void CFormattedTextDraw::TxSetCursor(HCURSOR hcur, BOOL fText)
+{
+}
+
+BOOL CFormattedTextDraw::TxScreenToClient(LPPOINT lppt)
+{
+	return FALSE;
+}
+
+BOOL CFormattedTextDraw::TxClientToScreen(LPPOINT lppt)
+{
+	return FALSE;
+}
+
+HRESULT	CFormattedTextDraw::TxActivate(LONG * plOldState)
+{
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxDeactivate(LONG lNewState)
+{
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxGetClientRect(LPRECT prc)
+{
+	*prc = m_rcClient;
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxGetViewInset(LPRECT prc)
+{
+	*prc = m_rcViewInset;
+	return S_OK;
+}
+
+HRESULT CFormattedTextDraw::TxGetCharFormat(const CHARFORMATW **ppCF)
+{
+	*ppCF = m_pCF;
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxGetParaFormat(const PARAFORMAT **ppPF)
+{
+	*ppPF = &m_PF;
+	return S_OK;
+}
+
+COLORREF CFormattedTextDraw::TxGetSysColor(int nIndex)
+{
+	return GetSysColor(nIndex);
+}
+
+HRESULT	CFormattedTextDraw::TxGetBackStyle(TXTBACKSTYLE *pstyle)
+{
+	*pstyle = TXTBACK_TRANSPARENT;
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxGetMaxLength(DWORD *plength)
+{
+	*plength = m_dwMaxLength;
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxGetScrollBars(DWORD *pdwScrollBar)
+{
+	*pdwScrollBar = m_dwScrollbar;
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxGetPasswordChar(TCHAR *pch)
+{
+	return S_FALSE;
+}
+
+HRESULT	CFormattedTextDraw::TxGetAcceleratorPos(LONG *pcp)
+{
+	*pcp = -1;
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxGetExtent(LPSIZEL lpExtent)
+{
+	return E_NOTIMPL;
+}
+
+HRESULT CFormattedTextDraw::OnTxCharFormatChange(const CHARFORMATW * pcf)
+{
+	memcpy(m_pCF, pcf, pcf->cbSize);
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::OnTxParaFormatChange(const PARAFORMAT * ppf)
+{
+	memcpy(&m_PF, ppf, ppf->cbSize);
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxGetPropertyBits(DWORD dwMask, DWORD *pdwBits)
+{
+	*pdwBits = m_dwPropertyBits;
+	return S_OK;
+}
+
+HRESULT	CFormattedTextDraw::TxNotify(DWORD iNotify, void *pv)
+{
+	return S_OK;
+}
+
+HIMC CFormattedTextDraw::TxImmGetContext()
+{
+	return NULL;
+}
+
+void CFormattedTextDraw::TxImmReleaseContext(HIMC himc)
+{
+}
+
+HRESULT	CFormattedTextDraw::TxGetSelectionBarWidth(LONG *lSelBarWidth)
+{
+	*lSelBarWidth = 100;
+	return S_OK;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// custom functions
+
+HRESULT CFormattedTextDraw::CharFormatFromHFONT(CHARFORMAT2W* pCF, HFONT hFont)
+// Takes an HFONT and fills in a CHARFORMAT2W structure with the corresponding info
+{
+
+	HWND hWnd;
+	LOGFONT lf;
+	HDC hDC;
+	LONG yPixPerInch;
+
+	// Get LOGFONT for default font
+	if (!hFont)
+		hFont = (HFONT) GetStockObject(SYSTEM_FONT);
+
+	// Get LOGFONT for passed hfont
+	if (!GetObject(hFont, sizeof(LOGFONT), &lf))
+		return E_FAIL;
+
+	// Set CHARFORMAT structure
+	memset(pCF, 0, sizeof(CHARFORMAT2W));
+	pCF->cbSize = sizeof(CHARFORMAT2W);
+
+	hWnd = GetDesktopWindow();
+	hDC = GetDC(hWnd);
+	yPixPerInch = GetDeviceCaps(hDC, LOGPIXELSY);
+	pCF->yHeight = -lf.lfHeight * LY_PER_INCH / yPixPerInch;
+	ReleaseDC(hWnd, hDC);
+
+	pCF->yOffset = 0;
+	pCF->crTextColor = 0;
+
+	pCF->dwEffects = CFM_EFFECTS | CFE_AUTOBACKCOLOR;
+	pCF->dwEffects &= ~(CFE_PROTECTED | CFE_LINK | CFE_AUTOCOLOR);
+
+	if(lf.lfWeight < FW_BOLD)
+		pCF->dwEffects &= ~CFE_BOLD;
+
+	if(!lf.lfItalic)
+		pCF->dwEffects &= ~CFE_ITALIC;
+
+	if(!lf.lfUnderline)
+		pCF->dwEffects &= ~CFE_UNDERLINE;
+
+	if(!lf.lfStrikeOut)
+		pCF->dwEffects &= ~CFE_STRIKEOUT;
+
+	pCF->dwMask = CFM_ALL | CFM_BACKCOLOR | CFM_STYLE;
+	pCF->bCharSet = lf.lfCharSet;
+	pCF->bPitchAndFamily = lf.lfPitchAndFamily;
+
+#ifdef UNICODE
+	_tcscpy(pCF->szFaceName, lf.lfFaceName);
+#else
+	MultiByteToWideChar(CP_ACP, 0, lf.lfFaceName, LF_FACESIZE, pCF->szFaceName, LF_FACESIZE);
+#endif
+
+	return S_OK;
+}
+
+HRESULT CFormattedTextDraw::InitDefaultCharFormat()
+{
+	return CharFormatFromHFONT(m_pCF, NULL);
+}
+
+HRESULT CFormattedTextDraw::InitDefaultParaFormat()
+{
+	memset(&m_PF, 0, sizeof(PARAFORMAT2));
+	m_PF.cbSize = sizeof(PARAFORMAT2);
+	m_PF.dwMask = PFM_ALL;
+	m_PF.wAlignment = PFA_LEFT;
+	m_PF.cTabCount = 1;
+	m_PF.rgxTabs[0] = lDefaultTab;
+	return S_OK;
+}
+
+HRESULT CFormattedTextDraw::CreateTextServicesObject()
+{
+	HRESULT hr;
+	IUnknown *spUnk;
+
+	hr = CreateTextServices(NULL, static_cast<ITextHost*>(this), &spUnk);
+	if (hr == S_OK) {
+		hr = spUnk->QueryInterface(IID_ITextServicesEx, (void**)&m_spTextServices);
+		hr = spUnk->QueryInterface(IID_ITextDocument, (void**)&m_spTextDocument);
+		spUnk->Release();
+	}
+	return hr;
+}
+

+ 206 - 0
FormattedTextDraw.h

@@ -0,0 +1,206 @@
+// Feel free to use this code in your own applications.
+// The Author does not guarantee anything about this code.
+// Author : Yves Maurer
+
+// FormattedTextDraw.h : Declaration of the CFormattedTextDraw
+
+#ifndef __FORMATTEDTEXTDRAW_H_
+#define __FORMATTEDTEXTDRAW_H_
+
+#include "resource.h"       // main symbols
+
+// be sure to link this project with riched20.lib
+#include <richedit.h>
+#include <textserv.h>
+
+#ifndef LY_PER_INCH
+#define LY_PER_INCH   1440
+#define HOST_BORDER 0
+#endif
+
+typedef struct tagCOOKIE
+{
+	BSTR	bstrText;
+	DWORD	dwSize;
+	DWORD	dwCount;
+} COOKIE, *PCOOKIE;
+
+// These definitions might give you problems.  If they do, open your
+// textserv.h and comment the following lines out. They are right at the top
+// EXTERN_C const IID IID_ITextServices;
+// EXTERN_C const IID IID_ITextHost;
+
+const IID IID_ITextServicesEx = { // 8d33f740-cf58-11ce-a89d-00aa006cadc5
+    0x8d33f740,
+    0xcf58,
+    0x11ce,
+    {0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5}
+ };
+
+//const IID IID_ITextHosts = { // c5bdd8d0-d26e-11ce-a89e-00aa006cadc5
+//    0xc5bdd8d0,
+//    0xd26e,
+//    0x11ce,
+//    {0xa8, 0x9e, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5}
+//  };
+
+/////////////////////////////////////////////////////////////////////////////
+// IFormatttedTextDraw
+interface IFormattedTextDraw
+{
+public:
+	virtual ~IFormattedTextDraw() {};
+	virtual HRESULT get_NaturalHeight(long Width, /*[out, retval]*/ long *pVal) = 0;
+	virtual HRESULT get_NaturalWidth(long Height, /*[out, retval]*/ long *pVal) = 0;
+	virtual HRESULT Create() = 0;
+	virtual HRESULT Draw(void *hdcDraw, RECT *prc) = 0;
+	virtual HRESULT get_RTFText(/*[out, retval]*/ BSTR *pVal) = 0;
+	virtual HRESULT put_RTFText(/*[in]*/ BSTR newVal) = 0;
+
+// COM-like functions
+    virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0;
+    virtual ULONG STDMETHODCALLTYPE Release(void) = 0;
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CFormattedTextDraw
+class CFormattedTextDraw : 
+	public ITextHost,
+	public IFormattedTextDraw
+{
+public:
+	CFormattedTextDraw()
+	{
+		HDC hdcScreen;
+
+		m_RTFText = NULL;
+
+		hdcScreen = GetDC(NULL);
+		nPixelsPerInchX = GetDeviceCaps(hdcScreen, LOGPIXELSX);
+		nPixelsPerInchY = GetDeviceCaps(hdcScreen, LOGPIXELSY);
+		ReleaseDC(NULL, hdcScreen);
+
+		SetRectEmpty(&m_rcClient);
+		SetRectEmpty(&m_rcViewInset);
+
+		m_pCF = (CHARFORMAT2W*) malloc(sizeof(CHARFORMAT2W));
+
+		InitDefaultCharFormat();
+		InitDefaultParaFormat();
+		m_spTextServices = NULL;
+		m_spTextDocument = NULL;
+
+		m_dwPropertyBits = TXTBIT_RICHTEXT | TXTBIT_MULTILINE | TXTBIT_WORDWRAP | TXTBIT_USECURRENTBKG;
+		m_dwScrollbar = 0;
+		m_dwMaxLength = INFINITE;
+	}
+
+	~CFormattedTextDraw()
+	{
+		if (m_RTFText != NULL)
+			SysFreeString(m_RTFText);
+
+		free(m_pCF);
+		if (m_spTextServices != NULL)
+			m_spTextServices->Release();
+		if (m_spTextDocument != NULL)
+			m_spTextDocument->Release();
+	}
+
+// Minimal COM functionality
+    HRESULT STDMETHODCALLTYPE QueryInterface( 
+        /* [in] */ REFIID riid,
+        /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject)
+	{
+		*ppvObject = NULL;
+		return S_FALSE;
+	}
+    
+    ULONG STDMETHODCALLTYPE AddRef(void)
+	{
+		return 0;
+	}
+    
+    ULONG STDMETHODCALLTYPE Release(void)
+	{
+		return 0;
+	}
+
+// IFormattedTextDraw
+public:
+	HRESULT get_NaturalHeight(long Width, /*[out, retval]*/ long *pVal);
+	HRESULT get_NaturalWidth(long Height, /*[out, retval]*/ long *pVal);
+	HRESULT Create();
+	HRESULT Draw(void *hdcDraw, RECT *prc);
+	HRESULT get_RTFText(/*[out, retval]*/ BSTR *pVal);
+	HRESULT put_RTFText(/*[in]*/ BSTR newVal);
+
+// ITextHost
+	HDC TxGetDC();
+	INT TxReleaseDC(HDC hdc);
+	BOOL TxShowScrollBar(INT fnBar, BOOL fShow);
+	BOOL TxEnableScrollBar(INT fuSBFlags, INT fuArrowflags);
+	BOOL TxSetScrollRange(INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw);
+	BOOL TxSetScrollPos(INT fnBar, INT nPos, BOOL fRedraw);
+	void TxInvalidateRect(LPCRECT prc, BOOL fMode);
+	void TxViewChange(BOOL fUpdate);
+	BOOL TxCreateCaret(HBITMAP hbmp, INT xWidth, INT yHeight);
+	BOOL TxShowCaret(BOOL fShow);
+	BOOL TxSetCaretPos(INT x, INT y);
+	BOOL TxSetTimer(UINT idTimer, UINT uTimeout);
+	void TxKillTimer(UINT idTimer);
+	void TxScrollWindowEx(INT dx, INT dy, LPCRECT lprcScroll, LPCRECT lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate, UINT fuScroll);
+	void TxSetCapture(BOOL fCapture);
+	void TxSetFocus();
+	void TxSetCursor(HCURSOR hcur, BOOL fText);
+	BOOL TxScreenToClient(LPPOINT lppt);
+	BOOL TxClientToScreen(LPPOINT lppt);
+	HRESULT	TxActivate(LONG * plOldState);
+	HRESULT	TxDeactivate(LONG lNewState);
+	HRESULT	TxGetClientRect(LPRECT prc);
+	HRESULT	TxGetViewInset(LPRECT prc);
+	HRESULT TxGetCharFormat(const CHARFORMATW **ppCF);
+	HRESULT	TxGetParaFormat(const PARAFORMAT **ppPF);
+	COLORREF TxGetSysColor(int nIndex);
+	HRESULT	TxGetBackStyle(TXTBACKSTYLE *pstyle);
+	HRESULT	TxGetMaxLength(DWORD *plength);
+	HRESULT	TxGetScrollBars(DWORD *pdwScrollBar);
+	HRESULT	TxGetPasswordChar(TCHAR *pch);
+	HRESULT	TxGetAcceleratorPos(LONG *pcp);
+	HRESULT	TxGetExtent(LPSIZEL lpExtent);
+	HRESULT OnTxCharFormatChange(const CHARFORMATW * pcf);
+	HRESULT	OnTxParaFormatChange(const PARAFORMAT * ppf);
+	HRESULT	TxGetPropertyBits(DWORD dwMask, DWORD *pdwBits);
+	HRESULT	TxNotify(DWORD iNotify, void *pv);
+	HIMC TxImmGetContext();
+	void TxImmReleaseContext(HIMC himc);
+	HRESULT	TxGetSelectionBarWidth(LONG *lSelBarWidth);
+
+// Custom functions
+	HRESULT CharFormatFromHFONT(CHARFORMAT2W* pCF, HFONT hFont);
+	HRESULT InitDefaultCharFormat();
+	HRESULT InitDefaultParaFormat();
+	HRESULT CreateTextServicesObject();
+
+// Variables
+	RECT			m_rcClient;			// Client Rect
+	RECT			m_rcViewInset;		// view rect inset
+	SIZEL			m_sizelExtent;		// Extent array
+
+	int				nPixelsPerInchX;    // Pixels per logical inch along width
+	int				nPixelsPerInchY;    // Pixels per logical inch along height
+
+	CHARFORMAT2W	*m_pCF;
+	PARAFORMAT2		m_PF;
+	DWORD			m_dwScrollbar;		// Scroll bar style
+	DWORD			m_dwPropertyBits;	// Property bits
+	DWORD			m_dwMaxLength;
+	COOKIE			m_editCookie;
+
+	ITextServices	*m_spTextServices;
+	ITextDocument	*m_spTextDocument;
+	BSTR			m_RTFText;
+};
+
+#endif //__FORMATTEDTEXTDRAW_H_

+ 98 - 0
IEncryption.h

@@ -0,0 +1,98 @@
+// IEncryption.h: interface for the IEncryption class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_IENCRYPTION_H__7741547B_BA15_4851_A41B_2B4EC1DC12D5__INCLUDED_)
+#define AFX_IENCRYPTION_H__7741547B_BA15_4851_A41B_2B4EC1DC12D5__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+// function to be exported from dll to create instance of interface
+#ifdef _EXPORTING // declare this in project settings for dll _only_
+#	define DLL_DECLSPEC __declspec(dllexport)
+#else
+#	define DLL_DECLSPEC __declspec(dllimport)
+#endif 
+
+#define IENCRYPTION_VERSION 0x0000
+
+class IEncryption;
+
+typedef IEncryption* (*PFNCREATE)(); // function prototype
+extern "C" DLL_DECLSPEC IEncryption* CreateEncryptionInterface();
+
+typedef int (*PFNGETVERSION)(); // function prototype
+extern "C" DLL_DECLSPEC int GetInterfaceVersion();
+
+// helper method
+static IEncryption* CreateEncryptionInterface(const char* szDllPath)
+{
+    IEncryption* pInterface = NULL;
+    HMODULE hDll = LoadLibrary(szDllPath);
+	
+    if (hDll)
+    {
+        PFNCREATE pCreate = (PFNCREATE)GetProcAddress(hDll, "CreateEncryptionInterface");
+		
+        if (pCreate)
+		{
+			// check version
+			PFNGETVERSION pVersion = (PFNGETVERSION)GetProcAddress(hDll, "GetInterfaceVersion");
+
+			if (!IENCRYPTION_VERSION || (pVersion && pVersion() >= IENCRYPTION_VERSION))
+				pInterface = pCreate();
+		}
+    }
+	
+    return pInterface;
+}
+
+static BOOL IsEncryptionDll(const char* szDllPath)
+{
+    HMODULE hDll = LoadLibrary(szDllPath);
+	
+    if (hDll)
+    {
+        PFNCREATE pCreate = (PFNCREATE)GetProcAddress(hDll, "CreateEncryptionInterface");
+		FreeLibrary(hDll);
+
+		return (NULL != pCreate);
+	}
+
+	return FALSE;
+}
+
+class IEncryption
+{
+public:
+    virtual void Release() = 0; // releases the interface
+	
+    // returns a dynamically allocated buffer to the encrypted text
+    // caller responsible for calling FreeBuffer on the returned buffer
+    virtual bool Encrypt(const unsigned char* pInput, int nLenInput, const char* szPassword, 
+						 unsigned char*& pOutput, int& nLenOutput) = 0;
+	
+    // returns a dynamically allocated buffer to the decrypted text
+    // caller responsible for calling FreeBuffer on the returned buffer
+    virtual bool Decrypt(const unsigned char* pInput, int nLenInput, const char* szPassword,
+						 unsigned char*& pOutput, int& nLenOutput) = 0;
+	
+    // frees a previously returned buffer and sets the ptr to NULL
+    // eg for buffer allocated with 'new' use 'delete []'
+    // eg for buffer allocated with 'strdup' use 'free'
+    virtual void FreeBuffer(unsigned char*& pBuffer) = 0;
+	
+};
+
+static void ReleaseEncryptionInterface(IEncryption*& pInterface)
+{
+    if (pInterface)
+    {
+        pInterface->Release();
+        pInterface = NULL;
+    }
+}
+
+#endif // !defined(AFX_IENCRYPTION_H__7741547B_BA15_4851_A41B_2B4EC1DC12D5__INCLUDED_)

+ 29 - 0
Misc.cpp

@@ -478,6 +478,8 @@ BOOL CGetSetOptions::m_bUseHookDllForFocus;
 BOOL CGetSetOptions::m_HideDittoOnHotKeyIfAlreadyShown;
 long CGetSetOptions::m_lPort;
 BOOL CGetSetOptions::m_bDrawThumbnail;
+CString CGetSetOptions::m_csPassword;
+BOOL CGetSetOptions::m_bDrawRTF;
 
 CGetSetOptions g_Opt;
 
@@ -502,6 +504,8 @@ CGetSetOptions::CGetSetOptions()
 	m_HideDittoOnHotKeyIfAlreadyShown = GetHideDittoOnHotKeyIfAlreadyShown();
 	m_lPort = GetPort();
 	m_bDrawThumbnail = GetDrawThumbnail();
+	m_csPassword = GetNetworkPassword();
+	m_bDrawRTF = GetDrawRTF();
 
 	#ifdef _DEBUG
 	m_bUseHookDllForFocus = FALSE;
@@ -1162,6 +1166,31 @@ BOOL CGetSetOptions::GetDrawThumbnail()
 	return GetProfileLong("DrawThumbnail", TRUE);
 }
 
+void CGetSetOptions::SetNetworkPassword(CString csPassword)
+{
+	m_csPassword = csPassword;
+
+	SetProfileString("NetworkPassword", csPassword);
+}
+
+CString CGetSetOptions::GetNetworkPassword()
+{
+	CString cs = GetProfileString("NetworkPassword", "!.*abc");
+
+	return cs;
+}
+
+void CGetSetOptions::SetDrawRTF(long bDraw)
+{
+	SetProfileLong("DrawRTF", bDraw); 
+	m_bDrawRTF = bDraw;
+}
+
+BOOL CGetSetOptions::GetDrawRTF()
+{
+	return GetProfileLong("DrawRTF", FALSE);
+}
+
 /*------------------------------------------------------------------*\
 CHotKey - a single system-wide hotkey
 \*------------------------------------------------------------------*/

+ 8 - 0
Misc.h

@@ -310,6 +310,14 @@ public:
 	static void		SetDrawThumbnail(long bDraw);
 	static BOOL		GetDrawThumbnail();
 
+	static CString	m_csPassword;
+	static void		SetNetworkPassword(CString csPassword);
+	static CString	GetNetworkPassword();
+
+	static BOOL		m_bDrawRTF;
+	static void		SetDrawRTF(long bDraw);
+	static BOOL		GetDrawRTF();
+
 	/*
 	BOOL IsAutoRun();
 	void SetAutoRun(BOOL bRun);

+ 3 - 0
OptionsQuickPaste.cpp

@@ -34,6 +34,7 @@ void COptionsQuickPaste::DoDataExchange(CDataExchange* pDX)
 {
 	CPropertyPage::DoDataExchange(pDX);
 	//{{AFX_DATA_MAP(COptionsQuickPaste)
+	DDX_Control(pDX, IDC_DRAW_RTF, m_btDrawRTF);
 	DDX_Control(pDX, IDC_SHOW_THUMBNAILS, m_btShowThumbnails);
 	DDX_Control(pDX, IDC_BUTTON_DEFAULT_FAULT, m_btDefaultButton);
 	DDX_Control(pDX, IDC_BUTTON_FONT, m_btFont);
@@ -68,6 +69,7 @@ BOOL COptionsQuickPaste::OnInitDialog()
 	m_eTransparencyPercent.SetNumber(CGetSetOptions::GetTransparencyPercent());
 	m_eLinesPerRow.SetNumber(CGetSetOptions::GetLinesPerRow());
 	m_btShowThumbnails.SetCheck(g_Opt.m_bDrawThumbnail);
+	m_btDrawRTF.SetCheck(g_Opt.m_bDrawRTF);
 
 	if(CGetSetOptions::GetQuickPastePosition() == POS_AT_CARET)
 		CheckDlgButton(IDC_AT_CARET, BST_CHECKED);
@@ -120,6 +122,7 @@ BOOL COptionsQuickPaste::OnApply()
 	CGetSetOptions::SetUseCtrlNumForFirstTenHotKeys(m_btUseCtrlNum.GetCheck());
 	CGetSetOptions::SetShowTextForFirstTenHotKeys(m_btShowText.GetCheck());
 	CGetSetOptions::SetDrawThumbnail(m_btShowThumbnails.GetCheck());
+	CGetSetOptions::SetDrawRTF(m_btDrawRTF.GetCheck());
 	
 	if(m_LogFont.lfWeight != 0)
 	{

+ 1 - 0
OptionsQuickPaste.h

@@ -25,6 +25,7 @@ public:
 // Dialog Data
 	//{{AFX_DATA(COptionsQuickPaste)
 	enum { IDD = IDD_OPTIONS_QUICK_PASTE };
+	CButton	m_btDrawRTF;
 	CButton	m_btShowThumbnails;
 	CButton	m_btDefaultButton;
 	CButton	m_btFont;

+ 64 - 2
QListCtrl.cpp

@@ -5,8 +5,8 @@
 #include "CP_Main.h"
 #include "QListCtrl.h"
 #include "ProcessPaste.h"
-
 #include "BitmapHelper.h"
+#include <atlbase.h>
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -49,6 +49,7 @@ CQListCtrl::CQListCtrl()
 	m_bShowTextForFirstTenHotKeys = true;
 	m_bStartTop = true;
 	m_pToolTip = NULL;
+	m_pFormatter = NULL;
 }
 
 CQListCtrl::~CQListCtrl()
@@ -65,6 +66,12 @@ CQListCtrl::~CQListCtrl()
 	DestroyAndCreateAccelerator(FALSE);
 
 	m_Font.DeleteObject();
+
+	if(m_pFormatter)
+	{
+		delete m_pFormatter;
+		m_pFormatter = NULL;
+	}
 }
 
 // returns the position 1-10 if the index is in the FirstTen block else -1
@@ -453,7 +460,8 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 			pDC->SetTextColor(crOld);
 		}
 		
-		pDC->DrawText(csText, rcText, DT_VCENTER | DT_EXPANDTABS);
+		if(DrawText(nItem, rcText, pDC) == FALSE)
+			pDC->DrawText(csText, rcText, DT_VCENTER | DT_EXPANDTABS);
 		
         // Draw a focus rect around the item if necessary.
         if(bListHasFocus && (rItem.state & LVIS_FOCUSED))
@@ -502,6 +510,60 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 	}
 }
 
+BOOL CQListCtrl::DrawText(int nItem, CRect &crRect, CDC *pDC)
+{
+	if(g_Opt.m_bDrawRTF == FALSE)
+		return FALSE;
+	
+	static CLIPFORMAT clFormat = GetFormatID(CF_RTF);
+
+	BOOL bRet = FALSE;
+
+	long lDatabaseID = GetItemData(nItem);
+
+	CClipFormat* pThumbnail = &(m_RTFData[lDatabaseID]);
+	if(pThumbnail == NULL)
+		return FALSE;
+
+	//If it has not been read in
+	if(pThumbnail->m_cfType != clFormat)
+	{
+		pThumbnail->m_cfType = clFormat;
+
+		//Get the data from the database
+		GetClipData(nItem, *pThumbnail);
+	}
+
+	// if there's no data, then we're done.
+	if( pThumbnail->m_hgData == NULL )
+		return FALSE;
+
+	if(m_pFormatter == NULL)
+	{
+		m_pFormatter = new CFormattedTextDraw;
+		m_pFormatter->Create();
+	}
+
+	if(m_pFormatter)
+	{
+	   char *pData = (char*)GlobalLock(pThumbnail->m_hgData);
+	   if(pData)
+	   {
+		   CComBSTR bStr(pData);
+		   
+		   m_pFormatter->put_RTFText(bStr);
+		   
+		   m_pFormatter->Draw(pDC->m_hDC, crRect);
+
+		   GlobalUnlock(pThumbnail->m_hgData);
+
+		   bRet = TRUE;
+	   }
+	}
+
+	return bRet;
+}
+
 // DrawBitMap loads a DIB from the DB, draws a crRect thumbnail of the image
 //  to pDC and caches that thumbnail as a DIB in m_ThumbNails[ ItemID ].
 // ALL items are cached in m_ThumbNails (those without images are cached with NULL m_hgData)

+ 6 - 0
QListCtrl.h

@@ -8,6 +8,7 @@
 //
 #include "ArrayEx.h"
 #include "ToolTipEx.h"
+#include "FormattedTextDraw.h"
 
 #define NM_SELECT					WM_USER+0x100
 #define NM_RIGHT					WM_USER+0x101
@@ -104,6 +105,8 @@ protected:
 	void LoadCopyOrCutToClipboard();
 	BOOL GetClipData(int nItem, CClipFormat &Clip);
 	BOOL DrawBitMap(int nItem, CRect &crRect, CDC *pDC);
+
+	BOOL DrawText(int nItem, CRect &crRect, CDC *pDC);
 		
 	WCHAR *m_pwchTip;
 	TCHAR *m_pchTip;
@@ -114,10 +117,13 @@ protected:
 	CAccels	m_Accels;
 
 	CMapIDtoCF m_ThumbNails;
+	CMapIDtoCF m_RTFData;
 
 	CToolTipEx *m_pToolTip;
 
 	CFont m_Font;
+
+	IFormattedTextDraw *m_pFormatter;
 	
 	// Generated message map functions
 protected:

+ 9 - 2
QPasteWnd.cpp

@@ -117,6 +117,7 @@ BEGIN_MESSAGE_MAP(CQPasteWnd, CWndEx)
 	ON_COMMAND(ID_MENU_HELP, OnMenuHelp)
 	ON_COMMAND(ID_MENU_QUICKOPTIONS_FONT, OnMenuQuickoptionsFont)
 	ON_COMMAND(ID_MENU_QUICKOPTIONS_SHOWTHUMBNAILS, OnMenuQuickoptionsShowthumbnails)
+	ON_COMMAND(ID_MENU_QUICKOPTIONS_DRAWRTFTEXT, OnMenuQuickoptionsDrawrtftext)
 	//}}AFX_MSG_MAP
 	ON_MESSAGE(NM_SELECT, OnListSelect)
 	ON_MESSAGE(NM_END, OnListEnd)
@@ -904,6 +905,9 @@ void CQPasteWnd::SetMenuChecks(CMenu *pMenu)
 	if(g_Opt.m_bDrawThumbnail)
 		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_SHOWTHUMBNAILS, MF_CHECKED);
 
+	if(g_Opt.m_bDrawRTF)
+		pMenu->CheckMenuItem(ID_MENU_QUICKOPTIONS_DRAWRTFTEXT, MF_CHECKED);
+
 	SetSendToMenu(pMenu, ID_MENU_SENTTO_FRIENDONE, 0);
 	SetSendToMenu(pMenu, ID_MENU_SENTTO_FRIEND_TWO, 1);
 	SetSendToMenu(pMenu, ID_MENU_SENTTO_FRIEND_THREE, 2);
@@ -1426,7 +1430,11 @@ void CQPasteWnd::OnMenuQuickoptionsShowthumbnails()
 	m_lstHeader.RefreshVisibleRows();
 }
 
-
+void CQPasteWnd::OnMenuQuickoptionsDrawrtftext() 
+{
+	CGetSetOptions::SetDrawRTF(!g_Opt.m_bDrawRTF);
+	m_lstHeader.RefreshVisibleRows();
+}
 
 ///////////////////////////////////////////////////////////////////////
 //END END Menu Stuff
@@ -2075,4 +2083,3 @@ LRESULT CQPasteWnd::OnGetClipData(WPARAM wParam, LPARAM lParam)
 
 	return bRet;
 }
-

+ 1 - 0
QPasteWnd.h

@@ -168,6 +168,7 @@ protected:
 	afx_msg void OnMenuHelp();
 	afx_msg void OnMenuQuickoptionsFont();
 	afx_msg void OnMenuQuickoptionsShowthumbnails();
+	afx_msg void OnMenuQuickoptionsDrawrtftext();
 	//}}AFX_MSG
 	afx_msg LRESULT OnListSelect(WPARAM wParam, LPARAM lParam);
 	afx_msg LRESULT OnListEnd(WPARAM wParam, LPARAM lParam);

+ 3 - 1
Resource.h

@@ -117,6 +117,7 @@
 #define IDC_NAME                        2022
 #define IDC_SHOW_THUMBNAILS             2022
 #define IDC_COMBO1                      2023
+#define IDC_DRAW_RTF                    2023
 #define IDC_HOTKEY1                     2024
 #define IDC_HOTKEY2                     2025
 #define IDC_EDIT_PLACE_ON_CLIPBOARD     2025
@@ -204,6 +205,7 @@
 #define ID_FIRST_HELP                   32843
 #define ID_MENU_QUICKOPTIONS_FONT       32844
 #define ID_MENU_QUICKOPTIONS_SHOWTHUMBNAILS 32845
+#define ID_MENU_QUICKOPTIONS_DRAWRTFTEXT 32846
 
 // Next default values for new objects
 // 
@@ -211,7 +213,7 @@
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
 #define _APS_NEXT_RESOURCE_VALUE        157
-#define _APS_NEXT_COMMAND_VALUE         32846
+#define _APS_NEXT_COMMAND_VALUE         32847
 #define _APS_NEXT_CONTROL_VALUE         2032
 #define _APS_NEXT_SYMED_VALUE           101
 #endif

+ 3 - 0
StdAfx.h

@@ -29,6 +29,9 @@
 #include <afxole.h>
 #include <Winsock2.h>
 
+#include <imm.h>
+#import "riched20.dll" raw_interfaces_only, raw_native_types, no_namespace, named_guids
+
 
 //{{AFX_INSERT_LOCATION}}
 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.

+ 3 - 1
ToolTipEx.h

@@ -6,7 +6,7 @@
 #endif // _MSC_VER > 1000
 // ToolTipEx.h : header file
 //
-
+#include "RichEditCtrlEx.h"
 /////////////////////////////////////////////////////////////////////////////
 // CToolTipEx window
 
@@ -46,6 +46,8 @@ protected:
 	CFont m_Font;
 	CBitmap *m_pBitmap;
 
+	
+
 protected:
 	CString GetFieldFromString(CString ref, int nIndex, TCHAR ch);
 	CRect GetBoundsRect();