Home > Software engineering >  WM_QUERYENDSESSION won't run in the netsh commands
WM_QUERYENDSESSION won't run in the netsh commands

Time:10-03

Situation is like this, the program on when using netsh to add an IP address on the network card, normal exit will be deleted, the problem is under the condition of the land will not be able to restart computer directly delete add IP address, if in the WM_QUERYENDSESSION message to perform the netsh commands to delete, and then return 1, will not delete, if return 0, system will pop up program is to prevent shut down, whether or not to, if the user clicks don't wait for, forced shutdown, or does not delete, if you click cancel shutdown, can delete, normal system is Windows 7, but it is good, WIN10 very collapse, have several days still no good method, winexec, shellexecuteex, createprocess methods are tried, such as the netsh command is turned off when not normal execution, experts have good method?
In addition to consult, if the physical network card added a and the IP address of the original IP is not in the same network segment (don't delete the IP address of the original, just add, network CARDS have two IP address), the use of the user what effect? Will not affect the normal use?

CodePudding user response:

If in a Windows service application to perform the netsh command?

CodePudding user response:

reference 1st floor VisualEleven response:
if in Windows service program to execute the netsh command?

Ok, come down I have a try
  • Related