Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IsPrinterDotMatric()
Message
From
02/06/2005 18:26:29
 
 
To
02/06/2005 17:23:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019594
Message ID:
01019622
Views:
43
Tracy

for the DeviceCapabilities() return value you specify DCTT_BITMAP.
i found DCTT_BITMAP in the wingdi.h defined as
#define DCTT_BITMAP 0x0000001L

foxpro doesn't seem to like this. do you know what the correct definition for the fox is?

thanks



>It should be possible using the API. I have some Delphi code from the internet that does it. It will have to be converted to VFP and tested.
>
>{$APPTYPE CONSOLE}
>uses Windows, Printers, WinSpool, Variants;
>
>function IsPrinterMatrix: Boolean;
>var
>  DeviceMode: THandle;
>  Device, Driver, Port: array [0..79] of Char;
>  pDevice, pDriver, pPort: PChar;
>begin
>
>  // Determinate that active printer is a Dot-Marix
>  Result:= False;
>  pDevice := @Device;
>  pDriver := @Driver;
>  pPort   := @Port;
>
>  Device  := #0;
>  Driver  := #0;
>  Port    := #0;
>
>  Printer.GetPrinter(pDevice, pDriver, pPort, DeviceMode);
>
>  // Printer is dot-matrix when number of maximum colors = 16
>  // and when printer prints TRUETYPE fonts as graphics
>
>  if (GetDeviceCaps(Printer.Handle,NUMCOLORS)<=16) and
>     (DeviceCapabilities(pDevice, pPort,DC_TRUETYPE,nil,nil) = DCTT_BITMAP)
>  then
>    Result := True;
>end;
>
>begin
>  writeln ('The current printer is ', Printer.Printers[Printer.PrinterIndex]);
>
>  if IsPrinterMatrix then
>    writeln('Dot-Matrix Printer')
>  else
>    writeln('LaserJet or InkJet Printer');
>end.
>
>
>
>>hello everybody.
>>
>>has anyone found a way to determine if a printer is a Dot-Matrix printer? as far as i know, there is no direct way. i was thinking this might be possible by checking for the lack of or the existense of a printer capability or simular.
>>
>>any ideas?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform