• Advertisement
Sign in to follow this  

system("notepad") makes my game stop

This topic is 4006 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

how do I run notepad from my game so my game keeps going and notepad is open?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
#include <shellapi.h>

ShellExecute(NULL, "open", "notepad.exe", NULL, NULL, SW_SHOWNORMAL);

Share this post


Link to post
Share on other sites
yay, shellexecute worked thanks guys. lol I was trying createprocess but was doing it wrong.

Share this post


Link to post
Share on other sites
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:

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement