46/54 Page
Mechatro, INC.
User Manual
Rev. 1.5
MTP-850P / 8100P / 8100P3
Write User Code by Mechatro Thermal Printer Series Driver Extention
#include <stdio.h>
#include <windows.h>
BOOL testUserCode(HDC PrintDC);
int main(void)
{
char
PrinterName[]="Mechatro Thermal Printer Series";
HDC
PrintDC;
PrintDC=CreateDC("winspool", PrinterName, NULL, NULL);
if(!PrintDC)
return
-1;
if(!StartDoc(PrintDC,
NULL))
return
-1;
testUserCode(PrintDC);
if(!EndDoc(PrintDC))
return
-1;
DeleteDC(PrintDC);
return
0;
}
#define ESC_WRITE_USERCODE 0x7FFFFFFC
BOOL testUserCode(HDC PrintDC)
{
char
TestCode[]={'\x1B','\x40'};
ExtEscape(PrintDC,
ESC_WRITE_USERCODE,
sizeof(TestCode), TestCode, 0, NULL);
return
TRUE;
}