Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Including a file in the EXE file

Posted on 1998-11-07
6
Medium Priority
?
176 Views
Last Modified: 2013-11-18
Hi

I'm trying to write a program to hook the keyboard. However I understood that I must use a DLL file in order to do so.

How can I do that when my main EXE file is running it will create the dll (For example: I need some way to save the DLL data inside the EXE file and to write it to a new .dll file in runtime)
0
Comment
Question by:urih
6 Comments
 
LVL 4

Expert Comment

by:saar2
ID: 1346027
Is it going to be a freeware version?

May I have a copy of it?

saar@bigfoot.com


0
 
LVL 10

Accepted Solution

by:
viktornet earned 400 total points
ID: 1346028
Here is an article I found some time ago...
------------------------
Put Anything In Your Delphi EXE!

by William A. Portillo - hallcom@wantree.com.au

I don't know if this is useful stuff but after a couple of weeks of playing with the
resources side of Delphi, I ended up writing a routine that will &quotextract" other
files out of a Delphi EXE. I found this useful for distributing little picture or sound files
with the application or as a setup program with internal files. No doubt many of you
will find other uses for this technique.

First, I create an RC project with NOTEPAD.EXE and ARJ.EXE in it as follows (we'll
call it RESJUNK.RC):

 NOTEPAD EXEFILE C:\WINDOWS\NOTEPAD.EXE
 ARJ EXEFILE C:\UTILS\ARJ.EXE

then I compile it with BRCC32 into a RES file. After this I include it in my Delphi
project by using the $R compiler directive like this:

{$R RESJUNK.RES}

and extract this files by using the TResourceStream class.

        procedure ExtractRes(ResType, ResName, ResNewName : String);
         var
           Res : TResourceStream;
         begin
           Res := TResourceStream.Create(Hinstance, Resname, Pchar(ResType));
           Res.SavetoFile(ResNewName);
           Res.Free;
         end;

I hope this proves to be relevant to someone at least. If you want to share ideas on
this, please email me. If you mail me back, please put "WP:" on the subject line.
This lets my boss know that the mail is for me.
------------------------
Cheers,
Viktor
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1346029
You the man Vik.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 10

Expert Comment

by:viktornet
ID: 1346030
Y?
0
 

Author Comment

by:urih
ID: 1346031
10x !!

It works great !! :))))
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1346032
:)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question