当前位置: 代码迷 >> VC >> 最简单的WIN32打印函数
  详细解决方案

最简单的WIN32打印函数

热度:6381   发布时间:2013-02-25 00:00:00.0
求一个最简单的WIN32打印函数
求一个最简单的WIN32打印函数

------解决方案--------------------------------------------------------
FORMFEED.C

/*-----------------------------------------------------------------------

FORMFEED.C -- Advances printer to next page

(c) Charles Petzold, 1998

------------------------------------------------------------------------*/

#include <windows.h>

HDC GetPrinterDC (void) ;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,

LPSTR lpszCmdLine, int iCmdShow)

{

static DOCINFO di = { sizeof (DOCINFO), TEXT ( "FormFeed ") } ;

HDC hdcPrint = GetPrinterDC () ;



if (hdcPrint != NULL)

{

if (StartDoc (hdcPrint, &di) > 0)

if (StartPage (hdcPrint) > 0 && EndPage (hdcPrint) > 0)

EndDoc (hdcPrint) ;

DeleteDC (hdcPrint) ;

}

return 0 ;

}
  相关解决方案