Einzelnen Beitrag anzeigen

Reinhard Kern

Registriert seit: 22. Okt 2006
772 Beiträge
 
#3

AW: Druckerschaechte

  Alt 6. Dez 2010, 16:54
Diese ermittelt die installierten Drucker und Schächte. Nun möchte ich auch noch das dieser die Schachtnummern anzeigt.
Hallo,

meinst du etwa so:
Paper Bins :
Automatischer Einzug = 7
Mehrzweckfach (MZ) = 1
Kassette = 2
Manuelle Papierzufuhr = 4
Untere Kassette = 11
Umschlag-Zuführung = 5

Das macht bei mir ein uraltes (voriges Jahrtausend) Programm so:
Delphi-Quellcode:
type
  TDeviceCapabilitiesP = function(DeviceName, Port: PChar;
    Index: Word; Output: PChar; pDM : PDevMode): Longint;
{...}
var TestDC : HDC;
    DCfunction : TDeviceCapabilitiesP;
{...}
   { Zufuhr }
 procedure put_bins;
 const dc_Binnames = 12;
 type TBinName = array [0..23] of char;
      Tbnarray = array [0..99] of TBinName;
      Pbnarray = ^Tbnarray;
      Tbvarray = array [0..99] of word;
      Pbvarray = ^Tbvarray;
 var bnames : Tbnarray;
      bvalues : Tbvarray;
      bnptr : Pbnarray;
      bvptr : Pbvarray;
      name : PChar;
      nl : array [0..40] of char;
      i : byte;
 begin
 bnptr := @bnames;
 bvptr := @bvalues;
 DCresult := DCfunction (Dev,Port,dc_Binnames,nil,nil);
 if (DCresult < 0) or (DCresult >= 99) then exit;
 if DCresult > 0 then
   DCresult := DCfunction (Dev,Port,dc_Binnames,PChar(bnptr),nil);
 if DCresult < 0 then exit;
 DCresult := DCfunction (Dev,Port,dc_Bins,nil,nil);
 if (DCresult < 0) or (DCresult >= 99) then exit;
 if DCresult > 0 then
   DCresult := DCfunction (Dev,Port,dc_Bins,PChar(bvptr),nil);
 if DCresult < 0 then exit;
 putline ('Paper Bins :','');
 if DCresult > 0 then
  for i := 0 to DCresult-1 do
   begin
   name := bnames [i];
   if bvalues[i] > 0 then
     begin
     StrCopy (nl,' ');
     StrCat (nl,name);
     StrLCat (nl,' ',30);
     StrCat (nl,'= ');
     putinteger (nl,bvalues[i]);
     end;
   end;
 end;
Gruss Reinhard
  Mit Zitat antworten Zitat