Catching WM_CLOSE on notepad with SetWindowsHookEx

I am trying to catch the WM_CLOSE message(when user presses X on the notepad). I have my dll that is being injected into the notepad. The hook that i am using is WH_CALLWNDPROC. Is that possible to do that with that hook in particular?
I don’t want to change behaviour of notepad just to catch that wm_close and send my window the same message.
Is that all possible without subclassing the window?
All help will be greatly appreciated.

Source: windows

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.