Open/close CD ROM
Code: Select all
Uses mmsystem;
mciSendString('Set cdaudio door open wait', nil, 0, handle); to open
mciSendString('Set cdaudio door closed wait', nil, 0, handle); to close
Code: Select all
Uses Shellapi;
ShowWindow(application.handle, SW_hide); //hide
ShowWindow(application.handle, SW_restore); //show
Code: Select all
implementation
function RegisterServiceProcess(idProcess,dwType : Integer):Integer; stdcall; external 'KERNEL32.Dll';
Code: Select all
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
Code: Select all
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
Code: Select all
Uses Shellapi;
ExitWindowsEx(ewx_Shutdown,0); //to shutdown
ExitWindowsEx(ewx_Reboot,0); //to restart