Solved

Including a file in the EXE file

Posted on 1998-11-07
6
160 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 100 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now