Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi “的参数是什么?”;printto";使用shellexecute?_Delphi_Winapi_Printing_Shellexecute - Fatal编程技术网

Delphi “的参数是什么?”;printto";使用shellexecute?

Delphi “的参数是什么?”;printto";使用shellexecute?,delphi,winapi,printing,shellexecute,Delphi,Winapi,Printing,Shellexecute,我正在使用Delphi的winapi ShellExecute尝试打印到用户选择的打印机,而不是默认打印机。我正在尝试使用printto动词找出命令的语法 如果我想将manual.pdf打印到IP地址为192.168.1.49的HP Laser Jet 4,示例shell execute语句会是什么样子 (这只是一个示例,但如果您能帮助我,我可以从这里开始)您需要在参数中传递打印机的网络地址 ShellExecute( WindowHandle, 'printto', PChar(D

我正在使用Delphi的winapi ShellExecute尝试打印到用户选择的打印机,而不是默认打印机。我正在尝试使用printto动词找出命令的语法

如果我想将manual.pdf打印到IP地址为192.168.1.49的HP Laser Jet 4,示例shell execute语句会是什么样子


(这只是一个示例,但如果您能帮助我,我可以从这里开始)

您需要在参数中传递打印机的网络地址

ShellExecute(
  WindowHandle,
  'printto',
  PChar(DocumentName),
  PChar(PrinterNetworkAddress),
  nil,
  SW_HIDE
);

也许有用?是的,我昨天在MSDN上发现了一些无用的东西,我想这是最后一句话了。谢谢在arguments参数中传递打印机的网络地址如何获取网络地址/该地址与作为端口int printer.GetPrinter返回的地址有什么区别?美赞臣的代码适合我,但我宁愿使用这个。