P
plane822
Unregistered / Unconfirmed
GUEST, unregistred user!
Procedure Tpppp.Button5Click(Sender: TObject);
Var
ss: String;
prnhandle: Thandle;
info: Pointer;
n: DWORD;
s1, s2, s3: Array[0..1024] Of char;
hmem: DWORD;
begin
{ ss := copy(Printer.printers[StrToInt(edit1.Text)], 1,
pos(' on ', Printer.printers[StrToInt(edit1.Text)]) - 1);}
ss :='CF2';
openprinter(Pchar('Cf2'), prnhandle, Nil);
// PrinterProperties(handle,prnhandle);
// openprinter('AGFA-AccuSet 1000', prnhandle, Nil);
GetPrinter(prnhandle, 2, @info, 0, @n);
If (GetLastError() = 122) then
GetMem(info, n)
else
begin
N := GetLastError();
showmessage(inttostr);
exit;
end;
IF GetPrinter(prnhandle, 2, info, n, @n) then
ShowMessage(inttostr(PRINTER_INFO_2(info^).Status));
// ShowMessage(Form1.PrinterStatusText(PRINTER_INFO_2(info^).Status));
closeprinter(prnhandle);
end;
为什么我的打印机状态Status总是返回0?
Var
ss: String;
prnhandle: Thandle;
info: Pointer;
n: DWORD;
s1, s2, s3: Array[0..1024] Of char;
hmem: DWORD;
begin
{ ss := copy(Printer.printers[StrToInt(edit1.Text)], 1,
pos(' on ', Printer.printers[StrToInt(edit1.Text)]) - 1);}
ss :='CF2';
openprinter(Pchar('Cf2'), prnhandle, Nil);
// PrinterProperties(handle,prnhandle);
// openprinter('AGFA-AccuSet 1000', prnhandle, Nil);
GetPrinter(prnhandle, 2, @info, 0, @n);
If (GetLastError() = 122) then
GetMem(info, n)
else
begin
N := GetLastError();
showmessage(inttostr);
exit;
end;
IF GetPrinter(prnhandle, 2, info, n, @n) then
ShowMessage(inttostr(PRINTER_INFO_2(info^).Status));
// ShowMessage(Form1.PrinterStatusText(PRINTER_INFO_2(info^).Status));
closeprinter(prnhandle);
end;
为什么我的打印机状态Status总是返回0?