Oct 11, 2013 at 6:05am Oct 11, 2013 at 6:05am UTC
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.
Oct 11, 2013 at 6:14am Oct 11, 2013 at 6:14am UTC
i dont think you understand what system does...
http://www.lmgtfy.com/?q=c+system&l=1
Oct 11, 2013 at 7:05am Oct 11, 2013 at 7:05am UTC
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.
Oct 14, 2013 at 4:09pm Oct 14, 2013 at 4:09pm UTC
Make use of Showwindow() API Function.
Oct 16, 2013 at 8:17pm Oct 16, 2013 at 8:17pm UTC
Hi,
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:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
Good Luck