Prevent DEDE software to compile DELPHI programs
Here is an anti-compilation of Delphi programs in Dede software ~
It is my annotation in "", the rest is originally created ~
PROGRAM Project1;
Uses
Forms,
Windows,
SYSUTILS,
Unit1 in 'unit1.pas' {form1},
Unit2 in 'unit2.pas' {form2};
Function RegisterServiceProcess (dWProcessID, DWTYPE: DWORD): Integer; stdcall;
External 'kernel32.dll'
{$ R * .res}
VAR
HMutex: hwnd;
RET: Integer;
HcurrentWindow: hwnd; // Reflexible
Sztext: Array [0..254] of char; // Reflexible
Begin
Application.INITIALIZE;
Application.title: = 'Delphi Sunflower Collection Design: Zhang Guopeng';
RegisterServiceProcess (GetCurrentProcessid, 1); / / Let the program disappear in CTL Alt DEL.
"We can see the author registered program into a Windows service program with registerServiceProcess."
"But everyone knows this function is included in Kernel32, and only in 98 / me."
"So don't use this key to anti-compilation, you can say that there is no ~"
/ / Prevent anti-compilation start
HcurrentWindow: = getWindow (Application.handle, GW_HWndFirst);
"From the above, the author wants to know that his program window is not the top window."
While HcurrentWindow <> 0 DO
Begin
IF getWindowText (hcurrentwindow, @sztext, 255)> 0 THEN
IF POS ('Dede', StrPas (@sztext) <> 0 THEN
"If not, get the title of the top-machine form, is not" Dede "in doing judgment
Begin
Application.MessageBox ('wants to compile me? Not that easy!'
'Haha ... Your guy! ', MB_OK;
// CloseWindow (HcurrentWindow); // minimizes the program window
EnableWindow (HcurrentWindow, False);
// Make the program's window cannot be activated if you can get the thread ID number of the program, you can make the program can't be used, can't turn off, cool?
"The above two sentences are the processing of DEDE ~"
"CloseWindow: minimizes the set window, but the window will not clear from memory ~"
"EnableWindow: The specified window allows / prohibits the input of the mouse and keyboard, FALSE is definitely not ~"
Halt;
END;
HcurrentWindow: = getWindow (HcurrentWindow, GW_HWndNext);
END;
/ / Prevent anti-compilation end
/ / Prevent the second operation of the program
HMutex: = Createmutex (NIL, FALSE, 'Delphi Sunflower Collection: Zhang Guopeng');
RET: = getLastError;
If Ret <> Error_Already_exists thenbegin
Application.createform (TFORM1, FORM1);
// Application.createform (TFORM2, FORM2);
Application.run;
End
Else
Application.MessageBox ('program has been run!', 'Prompt', MB_OK;
ReleaseMutex (HMUTEX);
End.
"Talk to my opinion, this method may be a simple way to prevent anti-compiletics, but because it is too simple,"
"It is not very useful until now, maybe you can deal with some beginners, we can see the name of the lookup window."
"The word" dede "also said that it is just a string, there is no important position in the program, that is, it is not delayed."
"The operation of the program, we can use some software to change all" Ded "in the program to other characters, huh, this"
"The program is not logical thinking, you can have no way to" Dede "after another.