Archived

This topic is now archived and is closed to further replies.

Pipo DeClown

system() param

Recommended Posts

Luke1    122
You could use ShellExecute

  
int main()
{
ShellExecute(NULL,"open","notpade.exe mydoc.txt",NULL,NULL);
return 0;
}

Share this post


Link to post
Share on other sites
Lektrix    106
quote:
Original post by Pipo DeClown
Luke, the function takes 6 parameters!!!
What the code thén?



ShellExecute(GetStdHandle(STD_OUTPUT_HANDLE), "open", "myExecutable.exe", "-param1 is_this", "C:\Space\Chocolate\etc", SW_SHOWNORMAL);


Passing null to the directory argument will result in opening the file from the current directory. Passing null to the parameter argument opens the file without passing any parameters.

I think you can use system(), but I'm not exactly sure how. Maybe the start command.

[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]

[edited by - Lektrix on March 6, 2003 1:05:02 PM]

Share this post


Link to post
Share on other sites
Luke1    122
O sorry bout that didnt notice here try this:

    

int main()
{
ShellExecute(NULL,"open","notepad.exe mydoc.txt",NULL,NULL,SW_SHOW);
}


[edited by - Luke1 on March 6, 2003 1:06:34 PM]

Share this post


Link to post
Share on other sites