Delphi Tips&Tricks News   Tips   .NET Software   VCL Software   Search   Contacts
Ultimate Pack Special Offer!


Share this page

Follow us
LinkedIn Blogspot Twitter Facebook

Related products
Ultimate Pack  hot!
iGrid Plotter  new!
Image Editor
Runtime Fusion
Form Designer
Object Inspector
Print Suite Pro
Commented Image
Delphi Toys
WinDowse
Delphi Bonus
TMS Scripter Studio
Form Designer VB
Form Designer .NET
Print Suite .NET
Gradient Controls .NET  new!

Related links
Win32.hlp online version
MegaDetailed.NET
Delphi to C#

Special
Free Software Promotion
Offers for Resellers

Hobby projects
cdtrrracks.com
books.storrre.com
in3steps.com
sovietphillumeny.com

Get paper source - System info - Tips & Tricks - Greatis Delphi Pages

Use DevMode structure to detect paper source.


uses Printers;
...
procedure TForm1.Button2Click(Sender: TObject);
var
  Device: array[0..cchDevicename-1] of Char;
  Driver: array[0..(MAX_PATH)-1] of Char;
  Port: array[0..32] of Char;
  hDMode: THandle;
  pDMode: PDevMode;
begin
  Printer.GetPrinter(Device, Driver, Port, hDMode);
  if (hDMode<>0) then
  begin
    pDMode:=GlobalLock(hDMode);
    if pDMode<>nil then
    begin
      if (pDMode^.dmDefaultSource=7) then
        Label1.Caption:='Paper source - auto';
      if (pDMode^.dmDefaultSource=4) then
        Label1.Caption:='Paper source - manual';
    end;
  end;
end;
Related topics
Detect paper format

For more
Win32 programmer's reference

We recommend
Greatis Print Suite

Download source