Hide console window after system()

I thought this would be super simple, but I can't get find a way to do it:

I use system("kwerpotutorial.pdf"); to open the pdf file.
This open a console window as well.
How do I prevent that?

Thanks in advance.
closed account (Dy7SLyTq)
i dont think you understand what system does...
That's right, but I was convinced I got it to work with system in the past.

Anyway, I got it to work with ShellExecute.
That page describes system as 'execute a shell command', so that confused me.
Make use of Showwindow() API Function.


Using ShellExecute is not ideally a good idea, mostly as ShellExecute can be exploited fairly easily to create a Buffer Overflow. I would recommend, you using CreateProcess:

MSDN Documentation:

Good Luck
Topic archived. No new replies allowed.