首页  编辑  

调用打印机属性对话框

Tags: /超级猛料/Print.打印/   Date Created:

function DefaultPrinterDevice: string;

var

 Device, Driver, Port: array [0..255] of Char;

 Mode: THandle;

begin

 Device := '';

 with Printer do

   if Printers.Count > 0 then

     GetPrinter(Device, Driver, Port, Mode);

 Result := Device;

end;

Function

SHInvokePrinterCommand(

  wnd: HWND;

  uAction: UINT;

  lpBuf1: PChar;

  lpBuf2: PChar;

  fModal: BOOL

): BOOL; stdcall; external 'shell32.dll' name 'SHInvokePrinterCommandA';

ShInvokePrinterCommand( handle, 1,

     PChar(DefaultPrinterDevice), nil, true )