Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Start a Program with C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
maxLOL
Grandmaster Cheater
Reputation: 0

Joined: 27 May 2008
Posts: 636
Location: noitacoL

PostPosted: Tue Dec 23, 2008 3:46 am    Post subject: Start a Program with C++ Reply with quote

Hey whats the code to (in C++) start another program? and can you please give an example?

thanks

_________________
Looking to create a Maple Story Dev team. PM me if interested.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Tue Dec 23, 2008 3:50 am    Post subject: Reply with quote

ShellExecute()?
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Tue Dec 23, 2008 4:04 am    Post subject: Reply with quote

http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Dec 23, 2008 4:25 am    Post subject: Reply with quote

http://msdn.microsoft.com/en-us/library/ms682425.aspx
Back to top
View user's profile Send private message
maxLOL
Grandmaster Cheater
Reputation: 0

Joined: 27 May 2008
Posts: 636
Location: noitacoL

PostPosted: Tue Dec 23, 2008 4:07 pm    Post subject: Reply with quote

so would adding
Code:

CreateProcess(iexplore.exe)

work?

_________________
Looking to create a Maple Story Dev team. PM me if interested.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Tue Dec 23, 2008 4:43 pm    Post subject: Reply with quote

Um... No..
Did you even read the CreateProcess MSDN link?

1. The first parameter is LPCTSTR (String)
2. There are more then just 1 parameter.

_________________
Back to top
View user's profile Send private message
maxLOL
Grandmaster Cheater
Reputation: 0

Joined: 27 May 2008
Posts: 636
Location: noitacoL

PostPosted: Tue Dec 23, 2008 6:32 pm    Post subject: Reply with quote

Hey could you give an example? im not getting this.
_________________
Looking to create a Maple Story Dev team. PM me if interested.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
arigity
Advanced Cheater
Reputation: 0

Joined: 03 Jul 2008
Posts: 65
Location: middle of nowhere.

PostPosted: Tue Dec 23, 2008 6:40 pm    Post subject: Reply with quote

third link on google

http://www.goffconcepts.com/techarticles/development/cpp/createprocess.html

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Dec 23, 2008 10:58 pm    Post subject: Reply with quote

Code:
#include <windows.h>

char target[] = "\\what.exe";
char path[MAX_PATH];
STARTUPINFO         si = { 0 };
PROCESS_INFORMATION pi = { 0 };

int main(){
   si.cb = sizeof(STARTUPINFO);
   GetCurrentDirectory((MAX_PATH - sizeof(target)), &path);
   lstrcat(&path, &target);
   CreateProcess(&path, NULL, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);

   return 0;
}


would start 'what.exe' in the same directory.

i'm sure you can use your imagination to expand on it.
Back to top
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Wed Dec 24, 2008 1:24 am    Post subject: Reply with quote

I don't understand why people have to make something like this so much more difficult than it has to be.
Code:
ShellExecute(0,"open","c:\\windows\\system32\\notepad.exe",0,0,0);
//change "c:\\windows\\system32\\notepad.exe" to whatever you want to shell.. quite obviously.
Back to top
View user's profile Send private message Visit poster's website
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Wed Dec 24, 2008 1:59 am    Post subject: Reply with quote

talker0 wrote:
I don't understand why people have to make something like this so much more difficult than it has to be.
Code:
ShellExecute(0,"open","c:\\windows\\system32\\notepad.exe",0,0,0);
//change "c:\\windows\\system32\\notepad.exe" to whatever you want to shell.. quite obviously.


ShellExecute() < CreateProcess().
Back to top
View user's profile Send private message MSN Messenger
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Wed Dec 24, 2008 5:18 am    Post subject: Reply with quote

Zerith wrote:
talker0 wrote:
I don't understand why people have to make something like this so much more difficult than it has to be.
Code:
ShellExecute(0,"open","c:\\windows\\system32\\notepad.exe",0,0,0);
//change "c:\\windows\\system32\\notepad.exe" to whatever you want to shell.. quite obviously.


ShellExecute() < CreateProcess().

That's right, but sometimes ShellExecute is preferred for example if you want to launch a website, then it'll automatically use the user's browser, or if you want to open a document it'll open the user's text editor and so on.
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Wed Dec 24, 2008 8:41 am    Post subject: Reply with quote

http://theoklibrary.org/showthread.php?t=286
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Wed Dec 24, 2008 10:34 pm    Post subject: Reply with quote

ya...use shellexecute.
_________________
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites