Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

chris1962

A real challenge . . . customizing programs without the source code

This topic is 6055 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve recently written a program that adds some new functionality to an existing off the shelf accounting program. I have no access to the source code of the accounting program. But, by using windows hooks within a DLL I was able to trigger the execution of my program when the user clicked on certain buttons within the accounting program. So, it appears to the user like I have actually modified the original program. I would like to take this to the next level, and add my own buttons/controls to the screen of the accounting program. I''ve used functions like SetWindowsText, to change the text of another windows title bar, and FlashWindowsEx to flash another window. But, is there any way to actually add buttons/controls/menu items to the accounting program screens? I know this sounds kind of crazy, but it never hurts to ask. The other approach I thought to take, would be to create my own window that anchors itself to the accounting program window, and place all the buttons/controls inside of it. Any suggestions, or even crazy far fetched ideas are greatly appreciated. Thanks, Chris In the mood for a little Fun & Games? Check out www.SunAndGames.com Home of Lost Enticer

Share this post


Link to post
Share on other sites
Advertisement
Sounds interesting! Do you reckon there''s a way to get access to the variables of another application. I mean basically ''kidnap'' its memory?

Share this post


Link to post
Share on other sites
If you can get a pointer to the memory, sure. But that could be a bit difficult. Not posative though, perhaps there is an easy way that I am not aware of.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post


Link to post
Share on other sites
Actually got a suggestion from someone on wwwCodeProject.com forum. A product call Resource Hacker does exactly what I wanted. You can download it at:
http://www.rpi.net.au/~ajohnson/resourcehacker/

It''s cool. Worth checking out.

Chris

In the mood for a little Fun & Games?
Check out www.SunAndGames.com
Home of Lost Enticer

Share this post


Link to post
Share on other sites
i was thinking, get the handle of the application and try using a CreateWindow() call on it for the buttons...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
A pointer in the address space of another process would be quite meaningless inside the address space of the modifying process. Instead one has to "inject" code into the other process. There are a few hacks for injecting dll''s into other processes - search for Jeff Richter''s "TINJLIB" - A similar but different method is used by the window spy utility at catch22.uk.net. And just today I read something in one of the microsoft newsgroups regarding subclassing a hooked window - here''s the gist:

---------------------------
To subclass a control with a wndProc from a DLL loaded in a _different_ process space

Inject your DLL into the other process space using SetWindowsHook to install a WH_GETMESSAGE hook.

Then post a WM_NULL to a window known to exist in the process (in fact thread) that you wish to manipulate.

Once your hook proc gets invoked you install the subclass proc using SetWindowLong.

Do not remove the hook before unwinding the subclass too,
or you will cause the app to fault when your dll gets unloaded from its memory space.

If you need to remove the hook without unloading the DLL, have the DLL execute LoadModule on itself first.
(no elaboration given)
---------------------------

Once you''ve subclassed the other window you might be able to add stuff to WM_CREATE etal.

If there''s a will there''s a way.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!