1

For my customer I need to code an application that hosts several other applications of different types. One of these applications crash when it's hosted but retrieves the WM_CLOSE message from Windows (e.g. on pressing Close all apps in the Windows bar).

I have a Hook.dll to intercept all messages to trigger some actions. What I now want to do is to prevent the WM_CLOSE Message to this specific window from being executed. Can someone give me an hint how to do that?

I'm working with C# and an C++ Hook.dll.

P̲̳x͓L̳
  • 3,615
  • 3
  • 29
  • 37
The Chris
  • 591
  • 6
  • 19
  • Hook the message procedure? Leave if its WM_CLOSE, continue with the original procedure if its another message. – Sebastian Hoffmann Mar 11 '14 at 13:51
  • I don't have access to the tools sourcecode. Which means, i can hook the message in a third dll. But with this, i am not able to swallow the message. – The Chris Mar 11 '14 at 13:54
  • Well I dont really get your problem. You seem to be already aware of concepts such as dll injection and hooks? So wheres the problem to inject your Hook.dll into the foreign process and hook the procedure? Maybe this will help you if you though havent grasped those techniques yet: http://securityxploded.com/dll-injection-and-hooking.php (first result in google, just took a quick glance over it, looks legit) – Sebastian Hoffmann Mar 11 '14 at 13:58
  • oh shit. i got it. the problem was not hooking related at all. there were two different messages send to close the app. i hooked the first one, but i mistakenly lost the second. so the application was closed anyway. thanks for your comments! – The Chris Mar 11 '14 at 14:05

0 Answers0