I'm doing a little software that change the default printer to pdf writer, PRINTS and then change back to the normal default printer.

It does work, but I'm using ShellExecute to print, the problem is, the time the ShellExecute is launched, the default printer is set back to the original and it prints to the original...

Is there a known way to run a shellexecute modal? I can't put a timer, depending on the document, it could be long or not.. idea would be to scan the directory where I'm writing the PDF file, but that is not a very good way to process.

Any ideas?

Thanks.


---
Nicolas LeBlanc
Software Engineer
Ordiplan Inc.