Hi, I feel really stupid, but I forgoten how to run a program.
I don't want to run a "normal windows program" (paint, solitare...) but my own.
Thanks,
~ Selevercin
Printable View
Hi, I feel really stupid, but I forgoten how to run a program.
I don't want to run a "normal windows program" (paint, solitare...) but my own.
Thanks,
~ Selevercin
use ShellExecute() :)
I also thing that is a good idea to use ShellExecute();
For example to run codeguru page:
ShellExecute(this->m_hWnd,"Open","http://www.codeguru.com",NULL,"http://www.codeguru.com",SW_SHOWMAXIMIZED);
It works but don't ask me why!
Thanks for the ShellExecute() idea. If my program was in:
C:\MyApp.exe
How would I call the function?
I don't understand the parameters correctly, I guess. Thanks,
~ Selevercin
Your can do it this way:
ShellExecute(::GetDesktopWindow(), "open", "YourApp.exe", NULL, "C:\", SW_SHOWNORMAL);
Write this:
ShellExecute(this->m_hWnd,"Open","C:\\MyFile.exe",NULL,"C:\\",SW_SHOWMAXIMIZED);
The first parameter is a handle to the window
The second parameter is what you want to do with the file
"Open" "Print" or "explore"
the parameter is the full path of the file
The 4th parameter are the parameters passed to the "C:\\myfile.exe"
the 5th parameter is the default directory
and the 6th parameter is how you want to open the file. (In this example a maximized window)