Send multiples Images to printer - C++

2019-07-15 04:52发布

问题:

I have a folder with .jpg files I want to send all this images to a printer.

I tried with ShellExecute, with two files :

UnicodeString filePath1 = "something1.jpg";
UnicodeString filePath2 = "something2.jpg";
UnicodeString cmd = "print";


ShellExecute(Form1->Handle, cmd.c_str(), filePath1.c_str(), NULL, NULL, SW_SHOWNORMAL);
ShellExecute(Form1->Handle, cmd.c_str(), filePath2.c_str(), NULL, NULL, SW_SHOWNORMAL);

But 2 instances of the Windows printer are created. One for each file. I would like to have a single instance, with the two files : one image per file.

I also tried filePath = "something1.jpg something2.jpg" but its not working.

Thanks.