Home > Net >  C # how to prevent external program shut down
C # how to prevent external program shut down

Time:09-17

Notepad, for example, how to stop notepad closed, use win32API, can let its minimize, maximize, close, just don't know how to stop him close, said there are ideas, intercept all WM_CLOSE, judge whether the program I need to have a teacher, how to intercept WM_CLOSE, and stop, thank you ~

CodePudding user response:

If I pass the task manager to kill the program???????

CodePudding user response:

You can't this implementation! Even the resource manager can be killed, how can you prevent shut down?
If simply to ban the user closes the, hidden close button,
If you want to keep alive the program, you can write a service to monitor whether the program is running, if you are off on the resumption of the program,

CodePudding user response:

reference 1/f, though reply:
if I pass the task manager to kill the program???????
as long as a partial solution, so I want to ask a, c # WM_CLOSE listening in external programs, thank you

CodePudding user response:

refer to the second floor Afresh_Kedou response:
this implementation is not you! Even the resource manager can be killed, how can you prevent shut down?
If simply to ban the user closes the, hidden close button,
If you want to keep alive the program, you can write a service to monitor whether the program is running, if you are off on the resumption of the program,
hello, thank you for your answer, as long as a partial solution, so I want to ask a, c # to monitor the WM_CLOSE of external programs

CodePudding user response:

Your program is not directly provide the close button

CodePudding user response:

Write code is generally in the closing event

CodePudding user response:

From the task manager if he forced shut down I feel you can't stop, unless you use a few rascal, in closeing events on some
  •  Tags:  
  • C #
  • Related