use qprocess like shellexecute
Hi all!
Is it possible to use QProcess like the WinAPI Shellexecute?
I would like to print several Documents and i do this with
ShellExecute(NULL, (LPWSRT)"print", (LPWSTR)doc.utf16(), NULL,NULL,SW_HIDE);
But i have to wait until the process is finished, but i can't do this with ShellExecute and
ShellExecuteEx doesn't work really?
Now can i do the same like ShellExecute with qprocess?
THX
Re: use qprocess like shellexecute
Yes, of course. Just call cmd.exe as the program to start and communicate with its stdin/stdout if you need the shell (it's possible that you don't). If you don't need the shell, call the application you want directly from QProcess.
Re: use qprocess like shellexecute
i want to print the document directly.
i can do this with
ShellExecute(NULL, (LPWSRT)"print", (LPWSTR)doc.utf16(), NULL,NULL,SW_HIDE);
can i do this with the cmd and qprocess, isn't it possible to do this without cmd?
Re: use qprocess like shellexecute
If "print" is an application then you can do it without cmd. But if "print" is a command implemented by cmd, then you need cmd to run it. Just try it and see what you get.
Re: use qprocess like shellexecute
"print" is a verb, no parameter or program. it says ShellExecute, that it shall say the program(which is bound with the ending, ShellExecute gets a filename and opens the program bound to it bsp test.txt, ShellExecute opens Notepad.exe, which shows the test.txt) "print the document that i give you and close".
Re: use qprocess like shellexecute
Re: use qprocess like shellexecute
please give me an example how i can print my test.txt with the cmd
Re: use qprocess like shellexecute