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 


Delphi help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Lorrenzo
Moderator
Reputation: 4

Joined: 02 Jun 2006
Posts: 3744

PostPosted: Thu Jun 07, 2007 6:32 pm    Post subject: Delphi help Reply with quote

Ok, so i'm a noob, just learning to use Delphi7... Rolling Eyes ...

So anyways, I was creating a simple program, similar to I believe breads..that just launchs programs..using ShellExecute.

I've got some of the programs to open such as Maple and the internet..but then when i try to get something like MSN Messenger, or LimeWire it won't work..I'm using

Code:
ShellExecute(Handle, 'open','C:\Program Files\LimeWire\LimeWire.exe', nil, nil, SW_SHOWNORMAL) ;


I've also tried

Code:
ShellExecute(Handle, 'open','"C:\Program Files\LimeWire\LimeWire.exe"', nil, nil, SW_SHOWNORMAL) ;


But no luck..

Can someone point me in the right direction?

_________________
LAWLrrenzolicious
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Thu Jun 07, 2007 6:35 pm    Post subject: Reply with quote

Right direction == CreateProcess Very Happy

ShellExecute is for opening something with what it's associated with... like a .txt file or a .html (or a .ct etc).

However, if you're starting up a .exe, you should be using CreateProcess.


Please don't let this lead to another one of those 'program opener YEAH!!!' releases Confused

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
Lorrenzo
Moderator
Reputation: 4

Joined: 02 Jun 2006
Posts: 3744

PostPosted: Thu Jun 07, 2007 6:36 pm    Post subject: Reply with quote

Ok, thank you..and don't worry..I would nvr release my peice of shit.
_________________
LAWLrrenzolicious
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Thu Jun 07, 2007 6:40 pm    Post subject: Reply with quote

Whewt. Ahah

There are a few tricky things in it... just make sure to zeromemory() the two last parameters before you call it (the information parameters).

I don't want to post my code because you won't learn from switching out directories Confused

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
Lorrenzo
Moderator
Reputation: 4

Joined: 02 Jun 2006
Posts: 3744

PostPosted: Thu Jun 07, 2007 6:52 pm    Post subject: Reply with quote

Ok, Yeah..im a noob..and I learn veryyy slow..

So say i wanna run my LimeWire and I have this code..what would I do..

Code:
{Supply a fully qualified path name in ProgramName}
procedure ExecNewProcess(ProgramName : String);
var
  StartInfo  : TStartupInfo;
  ProcInfo   : TProcessInformation;
  CreateOK   : Boolean;
begin

  { fill with known state }
  FillChar(StartInfo,SizeOf(TStartupInfo),#0);
  FillChar(ProcInfo,SizeOf(TProcessInformation),#0);
  StartInfo.cb := SizeOf(TStartupInfo);

  CreateOK := CreateProcess(PChar(ProgramName),nil, nil, nil,False,
              CREATE_NEW_PROCESS_GROUP+NORMAL_PRIORITY_CLASS,
              nil, nil, StartInfo, ProcInfo);

  { check to see if successful }
  if CreateOK then
    //may or may not be needed. Usually wait for child processes
    WaitForSingleObject(ProcInfo.hProcess, INFINITE);
end;

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

Joined: 22 Jul 2006
Posts: 666

PostPosted: Thu Jun 07, 2007 7:08 pm    Post subject: Reply with quote

Call the procedure in your button click section of the code by passing in the name of the program you would like to run.
_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Lorrenzo
Moderator
Reputation: 4

Joined: 02 Jun 2006
Posts: 3744

PostPosted: Thu Jun 07, 2007 7:19 pm    Post subject: Reply with quote

Um..yeah..does anyone know of any good really noob delphi tuts..
_________________
LAWLrrenzolicious
Back to top
View user's profile Send private message
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