How to Get Rid Main App leaving DLL?

How does one get rid of (make exit) the Main App that loaded the DLL and created a hook?

I am using VC++ 2010, under Windows XP SP3. The code is largely in Win32 with native call such as LoadLibrary, SetWindowsHookEx, DLLmain, etc). I use a global WH_KEYBOARD hook.

I have written a Main App that loads and sets a hook for a simple DLL. Most works well. But I need to get rid of the Main App, leaving the DLL to work alone. However, the Main App contains the message pump that creates callbacks to the hooked procedure in the DLL.

How can I get rid of the Main App?
Last edited on
You can't. (Sorry)
Wow. Its been a long haul to get to this "You can't" reply.

Is there another way to accomplish this? I need the functionality to support other work.
Its been a long haul to get to this "You can't" reply.
You could do yourself a favour and accept the advice of experts rather than being dismissive. The answer really is: you can't.
why do you want to get rid of the Main App?
Yes, perhaps if you were to tell us what you are trying to accomplish then we could offer better advice.
There isn't much more to tell. Outside of loading the DLL and setting the hook, the Main App does nothing more than run the message pump.

Perhaps there is another approach to this?
IIRC, a global system hook does not need to have your program running to keep the DLL active.
Topic archived. No new replies allowed.