|
#include "WinPrint.au3"
Global $hPrintDC
Local $s_DefaultPrinter, $DOCINFO, $result, $hFont, $hOldFont, $s_TextOut
$s_DefaultPrinter = _WinSpool_GetDefaultPrinter()
;If $s_DefaultPrinter = "" Then Return SetError(1, 0, 0)
$hPrintDC = _WinAPI_CreateDC("winspool", $s_DefaultPrinter)
;If $hPrintDC = 0 Then Return SetError(1, 0, 0)
$DOCINFO = DllStructCreate($tagDOCINFO)
$result += _WinAPI_StartDoc($hPrintDC, $DOCINFO)
$result += _WinAPI_StartPage($hPrintDC)
$hFont = _WinAPI_CreateFont(50, 0, 0, 0, $FW_NORMAL, False, False, False, $GB2312_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $ANTIALIASED_QUALITY, $FIXED_PITCH, 'Arial')
$hOldFont = _WinAPI_SelectObject($hPrintDC, $hFont)
$s_TextOut = "小罗叫罗成洋"
$result += _WinAPI_TextOut($hPrintDC, 100, 200, $s_TextOut)
$s_TextOut = "让我1一面对让我1一面对"
$result += _WinAPI_TextOut($hPrintDC, 100, 300, $s_TextOut)
$result += _WinAPI_EndPage($hPrintDC)
$result += _WinAPI_EndDoc($hPrintDC)
_WinAPI_ReleaseDC(0, $hPrintDC)
_WinAPI_DeleteDC($hPrintDC)
;Return $result |
|