|
-
May 23rd, 2002, 12:06 PM
#1
Runing a program
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
-
May 23rd, 2002, 12:08 PM
#2
use ShellExecute()
regards,
MiMec
-
May 23rd, 2002, 12:16 PM
#3
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!
-
May 23rd, 2002, 01:10 PM
#4
parameters
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
-
May 23rd, 2002, 01:17 PM
#5
Your can do it this way:
ShellExecute(::GetDesktopWindow(), "open", "YourApp.exe", NULL, "C:\", SW_SHOWNORMAL);
regards,
MiMec
-
May 23rd, 2002, 01:23 PM
#6
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|