With this
ShellExecute(Handle, 'print', PChar(ExtractFilePath(ParamStr(0))+'Test.txt'),
nil, nil, SW_HIDE);
It is possible to print out files.
Is there a way I can use a TStream instead of a file so that I can print directly from my stream?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, you can’t use
ShellExecuteto print from a Delphi stream. The call toShellExecutewill result in a different process performing the printing operation. And that different process cannot see your Delphi stream.A couple of options spring to mind:
ShellExecute.TRichEditand call itsPrintmethod. Andreas Rejbrand has more details here.