system("notepad") makes my game stop
I guess system("notepad&"); would work, but I'm almost certain there is a better way. I'm not too experienced with Windows or Win32, but I guess it would be preferable to get the path from the registry and use a Win32 command to execute it.
You can use CreateProcess. Here's an example.
You might have to provide the full path, which is %windir%\system32\notepad.exe.
Edit: Yeah, ShellExecute is probably simpler.
You might have to provide the full path, which is %windir%\system32\notepad.exe.
Edit: Yeah, ShellExecute is probably simpler.
The reason your initial attempt didn't work was that you were executing it from the comamnd line in the wrong way. It should have been:
This doesn't cause the program calling it to wait for the notepad window to close before execution continues.
system("start notepad.exe c:/whatever.txt)";
This doesn't cause the program calling it to wait for the notepad window to close before execution continues.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement