Several anti-DDoS Methods
1) Use the findwindow API function.
You can query the window title (or/and Class Name) to determine whether the program is running. If it is found, it indicates that the program is running, and you can exit the program to achieve the effect of not repeating the operation; otherwise, it indicates that the program is running for the first time.
This method is not applicable to situations where the program title is dynamically changed and the system runs a program with the same title (or/and class name)
2) mutex/event/semaphore
Determine whether the program is running by means of mutex objects, semaphores, events, and other thread synchronization objects. The most common functions are: createmutexa (Note: QQ Hall and QQ game hall use this method to limit the opening of multiple programs)
3) file ing)
By placing program instance information in a cross-process memory ing file, you can also control multiple programs.
4) DLL global share zone
The DLL global shared area is initialized only once when it is mapped to the address space of each process. It is the first time that it is loaded by windows. Therefore, you can use the data in this area to limit the number of programs.
5) global atom
Add a specific string to the global atom table through globaladdatom. when running the program, check whether the string exists to restrict the program from opening more. (This atom will not be released automatically. You must call globaldeleteatom to release atom before exiting the program)
6) Check window properties
Add some data to the property list of the specified window through setprop. during the running of the program, enumerate the window and check whether the data exists to limit the extra opening.
The above only lists the most common methods. I don't know if there are any other methods. I have gone through ~~~~~~~~
Several anti-DDoS Methods