G
goodfox2002
Unregistered / Unconfirmed
GUEST, unregistred user!
Function TForm1.GetStatus:integer;
var
pinfo: pPRINTERINFO2;
pprt,a: Cardinal;
bDWORD;
begin
b:=allocmem(256);
//我将其改为allocmem(512)也不行。
pinfo:=AllocMem(1000);
if WinSpool.OpenPrinter(PChar(printer.Printers[printer.PrinterIndex]),pprt,nil) then
begin
a:=1000;
if WinSpool.getprinter(pprt,2,pinfo,a,b) then
begin
Result:=pinfo.Status;
end
else
Result:=-1;
//不管打印机是否打开、空闲总是执行else
语句!为什么?????
ClosePrinter(pprt);
end;
freemem(b);
freemem(pinfo);
end;
只有20分了,在线等候!
var
pinfo: pPRINTERINFO2;
pprt,a: Cardinal;
bDWORD;
begin
b:=allocmem(256);
//我将其改为allocmem(512)也不行。
pinfo:=AllocMem(1000);
if WinSpool.OpenPrinter(PChar(printer.Printers[printer.PrinterIndex]),pprt,nil) then
begin
a:=1000;
if WinSpool.getprinter(pprt,2,pinfo,a,b) then
begin
Result:=pinfo.Status;
end
else
Result:=-1;
//不管打印机是否打开、空闲总是执行else
语句!为什么?????
ClosePrinter(pprt);
end;
freemem(b);
freemem(pinfo);
end;
只有20分了,在线等候!