Jump to content
Tuts 4 You

[question] how to launch *.exe from DLL


6748222

Recommended Posts

Hello! i use D2009 and would like to know

how can i launch *.exe from a DLL

example i have 1.exe with button

on click its read from dll name of file to launch

2.exe

is this posible?

Edited by 6748222
Link to comment

Am the only one who isn't quite sure what D2009 is?

Please be more specific and please don't bump posts, someone will answer in due time.

Your question is confusing... First you ask if it's possible to launch an executable from within a DLL(yes, of course it is), you then create an example that asks if it's possible for an executable to read a file path from a DLL and execute that file(yes, this is also possible)... Care to clarify?

I'm not going to waste my breathe by providing information that will likely be erroneous due to lack of information. Awaiting clarifications.

KOrUPt.

Link to comment

sory :worthy:

D2009 is Delphi 2009

i have a game launcher with small game protection(beter then nothing)

but its pointless since players can launch game without my launcher.. huh :o

so idea is to create DLL (atach it to game.exe(i got good tut :D )) and on game.exe click

it will launch my launcher.. thats all :wub:

Edited by 6748222
Link to comment

ok i figured it out

here is code if some1 need it

procedure test(); stdcall;

begin

//Sleep(5);

WinExec('rundll32 shell32.dll, NOTEPAD.EXE', SW_SHOW);

FreeLibrary(GetModuleHandle(nil));

end;

was it so hurd ?? huh

Edited by 6748222
Link to comment

Not it was'nt "hurd" If you explained your self more clearly im sure some one or even myself would have advised you to use WinExec or another method(there are lots of ways to achive what you have there).

Link to comment

well its hurd to explain my idea in English

since i dont know it very good =(

i explained it how good i can :unsure:

eniway..

my second question

well now i know how to launch *.exe from DLL

also i know how to hook it in my *.exe

but i dont know how to launch *.exe from DLL (see 4 post on this tread)

when its hooked in Game.exe

i try explain what i wana do

i got Game.exe (i hooked my dll in it) and on click game.exe

i wana that Game.exe dont start a game but a launch Notepad.exe (see my DLL code =))

brr.. i hope i explained this time it bit beter

DLL code:

procedure test(); stdcall;

begin

//Sleep(5);

WinExec('rundll32 shell32.dll, NOTEPAD.EXE', SW_SHOW);

FreeLibrary(GetModuleHandle(nil));

end;

at this moment when i launche the game i got :

66439301.png

nwm i done it all without your help

thanks 4 nothing

Edited by 6748222
Link to comment

actualy this was very bad idea!

i gona try another method using createprocess()

Thank you!

Edited by 6748222
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...