34 RECT rcPrintRect, rcPhysical;
36#define CONVERT_X(x) MulDiv((x), iLogPixelsX, 2540)
37#define CONVERT_Y(y) MulDiv((y), iLogPixelsY, 2540)
59 DWORD dwStart = 0, dwEnd = 0;
61 return dwEnd - dwStart;
66 DWORD dwStart = 0, dwEnd = 0;
73 if (!lpString || dwStart == dwEnd ||
cchText == 0)
87 return dwEnd - dwStart;
116#define X_POINTS_TO_PIXELS(hDC, points) MulDiv((points), GetDeviceCaps((hDC), LOGPIXELSX), 72)
117#define Y_POINTS_TO_PIXELS(hDC, points) MulDiv((points), GetDeviceCaps((hDC), LOGPIXELSY), 72)
126 TCHAR szText[256], szField[128];
127 const TCHAR *pchFormat;
142 for (pchFormat = pszFormat; *pchFormat; ++pchFormat)
144 if (*pchFormat !=
_T(
'&'))
200 szField[0] =
_T(
'&');
201 szField[1] = *pchFormat;
216 INT xStart, tabWidth;
226#define DO_FLUSH() do { \
227 if (ichStart < pData->ich && !bSkipPage) { \
228 TextOut(pPrinter->hDC, xStart, yTop, &pData->pszText[ichStart], pData->ich - ichStart); \
230 ichStart = pData->ich; \
232 if (pData->status == STRING_PRINTCANCELING) return FALSE; \
236 for (ichStart =
pData->ich, xStart = xLeft;
pData->ich <
pData->cchText; )
245 ichStart =
pData->ich;
255 xLeft = xStart = printRect.
left;
261 INT nStepWidth = tabWidth - ((xLeft - printRect.
left) % tabWidth);
272 xLeft += charMetrics.
cx;
276 if (xLeft + charMetrics.
cx >= printRect.
right)
283 xLeft = xStart = printRect.
left;
288 if (ch ==
_T(
'\t') || ch ==
_T(
'\n'))
289 ichStart =
pData->ich;
319 if (
pData->cyHeader > 0)
340 if (
pData->cyFooter > 0)
361#define BODY_FONT_SIZE 10
362#define HEADER_FONT_SIZE 9
363#define SPACING_HEIGHT 4
364#define PRINTING_MESSAGE (WM_USER + 100)
392 DWORD CopyCount, PageCount;
447 for (CopyCount = 1; CopyCount <= pPrinter->
nCopies; ++CopyCount)
450 for (PageCount = 1, printData->
ich = 0; printData->
ich < printData->
cchText; ++PageCount)
486 pData->currentPage = 1;
496 static TCHAR s_szPage[64];
650 static const TCHAR sorry[] =
_T(
"Sorry, no help available");
int DIALOG_StringMsgBox(HWND hParent, int formatId, LPCTSTR szString, DWORD dwFlags)
CLIPBOARD_GLOBALS Globals
#define PSD_ENABLEPAGESETUPHOOK
#define PSD_ENABLEPAGESETUPTEMPLATE
#define HeapFree(x, y, z)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
LPVOID NTAPI LocalLock(HLOCAL hMem)
BOOL NTAPI LocalUnlock(HLOCAL hMem)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
unsigned __int3264 UINT_PTR
#define STRING_PRINTFAILED
#define STRING_PRINTCANCELED
#define STRING_PRINTERROR
#define IDC_PRINTING_PAGE
#define IDC_PRINTING_FILENAME
#define STRING_PRINTCANCELING
#define IDC_PRINTING_STATUS
#define STRING_NOWPRINTING
#define STRING_PRINTCOMPLETE
#define LOCALE_USER_DEFAULT
#define Y_POINTS_TO_PIXELS(hDC, points)
static INT_PTR CALLBACK DIALOG_Printing_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static RECT GetPrintingRect(IN HDC hdc, IN LPCRECT pMargins)
static BOOL DoPrintBody(PPRINT_DATA pData, DWORD PageCount, BOOL bSkipPage)
#define X_POINTS_TO_PIXELS(hDC, points)
static VOID DrawHeaderOrFooter(HDC hDC, LPRECT pRect, LPCTSTR pszFormat, INT nPageNo, const SYSTEMTIME *pstNow)
static INT GetSelectionText(HWND hWnd, LPTSTR lpString, INT nMaxCount)
static BOOL DoPrintPage(PPRINT_DATA pData, DWORD PageCount)
struct PRINT_DATA * PPRINT_DATA
VOID DIALOG_FilePrint(VOID)
static BOOL DoPrintDocument(PPRINT_DATA printData)
static UINT_PTR CALLBACK DIALOG_PAGESETUP_Hook(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static INT GetSelectionTextLength(HWND hWnd)
static BOOL DoCreatePrintFonts(LPPRINTDLG pPrinter, PPRINT_DATA pPrintData)
VOID DIALOG_FilePageSetup(VOID)
static DWORD WINAPI PrintThreadFunc(LPVOID arg)
static VOID AlertPrintError(VOID)
#define STRSAFE_E_INSUFFICIENT_BUFFER
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
int WINAPI SetMapMode(_In_ HDC, _In_ int)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI EndPage(_In_ HDC)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define GetTextExtentPoint32
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
int WINAPI EndDoc(_In_ HDC)
int WINAPI StartPage(_In_ HDC)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI DeleteDC(_In_ HDC)
#define CreateFontIndirect
INT WINAPI AbortDoc(_In_ HDC hdc)
#define GetWindowTextLength
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define MB_ICONEXCLAMATION
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)