0

I am currently looking for a solution in C# how to capture window-messages like WM_MINIMIZE for another application for which I do not have any source code, for example Notepad. My goal is to prevent a user or the system from minimizing a certain application. So my basic idea is to have a process running that filters all Window-messages, and just does nothing, unless a message is posted to the application I define (for example by knowing the window-handle of the applications mainwindow), and then look if this message is a certain size-operation, like WM_MINIMIZE. Only in this case, the message should be removed from the Windows message queue.

What would be a first approach to achieve this? At the moment I am stuck a little bit at finding online resources because most topics concerning resizing deal about messages of own applications, but not to control messages posted to other, external applications running on the same computer.

Erik
  • 2,316
  • 9
  • 36
  • 58

1 Answers1

0

Either you trap all messages of windows by creating a dll which does a global hook (in c++) (risk of slowdown the OS)

Either You have something to hook the program and in this case:

EasyHook is your friend

Frenchy
  • 16,386
  • 3
  • 16
  • 39