SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
The SftPrintPreview_RenderRicheditWindow_Callback function implements a callback used to print/preview RichEdit controls.
C
BOOL CALLBACK SftPrintPreview_RenderRicheditWindow_Callback( LPSFTPRINTPREVIEW_DRAWINFO lpInfo);
lpInfo
A pointer to a SFTPRINTPREVIEW_DRAWINFO structure defining the current rendering operation.
The return value is TRUE if the function was successful, FALSE otherwise.
The SftPrintPreview_RenderRicheditWindow_Callback function implements a callback used to print/preview RichEdit controls.
It is used with the FilePrintPreview function (C++) or as the lpDrawInfoProc member of the SFTPRINTPREVIEW_CONTROL structure (C) when printing/previewing RichEdit controls.
Actual Implementation of the SftPrintPreview_RenderRicheditWindow_Callback for RichEdit controls, built into SftPrintPreview/DLL.
C
BOOL CALLBACK SftPrintPreview_RenderRicheditWindow_Callback( LPSFTPRINTPREVIEW_DRAWINFO lpInfo) { ASSERT(lpInfo->hwndContent); if (!lpInfo->hwndContent) return FALSE; switch (lpInfo->function) { case SFTPRINTPREVIEW_PRINT_CLEARCACHE: AU(SendMessage)(lpInfo->hwndContent, EM_FORMATRANGE, 0, (LPARAM)NULL); return TRUE; case SFTPRINTPREVIEW_PRINT_DIMENSIONS: lpInfo->contentWidth = -1; return TRUE; case SFTPRINTPREVIEW_PRINT_ONEPAGE: break;// continue below; default: return TRUE; } //SFTPRINTPREVIEW_PRINT_ONEPAGE FORMATRANGE fr; memset(&fr, 0, sizeof(fr)); fr.hdc = lpInfo->hDC; fr.hdcTarget = lpInfo->hDCPrinter; fr.rc.left = (int) (((float)lpInfo->ClientRect.left)/GetDeviceCaps(lpInfo->hDC, LOGPIXELSX)*1440); fr.rc.top = (int) (((float)lpInfo->ClientRect.top)/GetDeviceCaps(lpInfo->hDC, LOGPIXELSX)*1440); fr.rc.right = fr.rc.left + (int) (((float)(lpInfo->ClientRect.right-lpInfo->ClientRect.left))/GetDeviceCaps(lpInfo->hDC, LOGPIXELSX)*1440); fr.rc.bottom = fr.rc.top + (int) (((float)(lpInfo->ClientRect.bottom-lpInfo->ClientRect.top))/GetDeviceCaps(lpInfo->hDC, LOGPIXELSY)*1440); fr.rcPage = fr.rc; fr.chrg.cpMin = (int) (lpInfo->absPage > 0) ? lpInfo->previousVisitedPageInfo : 0; fr.chrg.cpMax = -1; long nextProcessChar = 0; nextProcessChar = AU(SendMessage)(lpInfo->hwndContent, EM_FORMATRANGE, TRUE, (LPARAM)&fr); GETTEXTLENGTHEX gtl; gtl.flags = GTL_DEFAULT; #if defined(UNICODE) gtl.codepage = 1200; #else gtl.codepage = CP_ACP; #endif int len = AU(SendMessage)(lpInfo->hwndContent, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0); if (nextProcessChar >= len) lpInfo->lastPage = lpInfo->absPage; lpInfo->visitedPageInfo = nextProcessChar; return TRUE; }
See Also C/C++ API | C++ Classes | Notifications