//打开关闭Ctrl+Alt+del<br>var<br> OldVal : LongInt;<br>begin<br> SystemParametersInfo (97, Word (False), @OldVal, 0)<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>var<br> OldVal : LongInt;<br>begin<br> SystemParametersInfo (97, Word (True), @OldVal, 0)<br>end;<br><br>//关闭 Windows 的 TaskBar<br>type<br> TForm1 = class(TForm)<br> procedure FormCreate(Sender: TObject);<br> procedure FormDestroy(Sender: TObject);<br> private<br> { Private declarations }<br> hTaskBar: HWND;<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> hTaskBar := FindWindow('Shell_TrayWnd', nil);<br> ShowWindow(hTaskBar, SW_HIDE);<br>end;<br><br>procedure TForm1.FormDestroy(Sender: TObject);<br>begin<br> ShowWindow(hTaskBar, SW_SHOW);<br>end;<br><br>end.<br><br>//使程序在 Ctrl+Alt+Del时不会出现在列表中,<br>//下面是从D版盘中得到的Source ,是一个控件<br>unit Phantom;<br><br>interface<br><br>uses<br> Windows, wintypes, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> menus, shellapi;<br><br> const<br> TASKBAREVENT: PChar = 'NewTNIMessage_20';<br><br>type<br> TPhantom = class(TComponent)<br> private<br> fIconDatei: Ticon;<br> ftip:string ;<br> fSichtbar: Boolean ;<br> fServiceprocess: Boolean ;<br> fLinksKlick: TNotifyEvent;<br> fRechtsKlick: TNotifyEvent;<br> fDoppelKlick: TNotifyEvent;<br> fIconSichtbarkeit: boolean;<br> fPopupRechts: TPopupMenu;<br> fPopupLinks: TPopupMenu;<br> { Private-Deklarationen }<br> procedure PWsichtbarkeit(value:boolean);<br> procedure PWserviceprocess(value:boolean);<br> procedure sichtbarmachen;<br> procedure unsichtbarmachen;<br> procedure WPopRechts;<br> procedure WPopLinks;<br> procedure CreateIcon;<br> procedure ChangeIcon;<br> procedure DeleteIcon;<br> procedure settip(value:string);<br> procedure Wicondatei(value:Ticon);<br> procedure WIconSichtbarkeit(value:boolean);<br> protected<br> { Protected-Deklarationen }<br> procedure serviceprocessEin;<br> procedure serviceprocessAus;<br> procedure WRechtsklick; virtual;<br> procedure WLinksklick; virtual;<br> procedure WDoppelklick; virtual;<br> procedure WndProc(var Msg: TMessage);<br> procedure Notification(Component: TComponent; Operation: TOperation); override;<br> public<br> { Public-Deklarationen }<br> procedure loaded;override;<br> destructor Destroy; override;<br> constructor Create(AOwner: TComponent); override;<br> published<br> { Published-Deklarationen }<br> property Sichtbar: Boolean read fsichtbar write PWsichtbarkeit;{Formular verstecken/anzeigen}<br> property Serviceprocess: Boolean read fserviceprocess write PWserviceprocess;{Als Service-Process registrieren/abmelden (gegen Strg+Alt+Entf)}<br> property IconDatei: Ticon read fIconDatei write Wicondatei;<br> property LinksKlick: TNotifyEvent read fLinksKlick write flinksklick;<br> property RechtsKlick: TNotifyEvent read fRechtsKlick write fRechtsklick;<br> property DoppelKlick: TNotifyEvent read fDoppelKlick write fDoppelklick;<br> property IconSichtbarkeit: boolean read fIconSichtbarkeit write WIconSichtbarkeit;<br> property PopupRechts: TPopupMenu read fPopupRechts write fPopuprechts;<br> property PopupLinks: TPopupMenu read fPopupLinks write fPopuplinks;<br> property Tip: string read FTip write SetTip;<br> end;<br><br>procedure Register;<br>function RegisterServiceProcess(dwProcessId,dwType:dword): Integer;stdcall;external 'kernel32.dll'<br><br>implementation<br><br>var ficonmessage: UINT;<br> FWnd: HWnd;<br> icsichtbar:boolean;<br><br>constructor tphantom.Create(AOwner: TComponent) ;<br>begin<br>inherited Create(AOwner);<br>ficonmessage := RegisterWindowMessage(TASKBAREVENT);<br>FWnd := AllocateHWnd(WndProc);<br>FIcondatei := TIcon.Create;<br>iconsichtbarkeit:=false ;<br>sichtbar:=true;<br>serviceprocess:=false;<br>icsichtbar:=false;<br>end;<br><br>destructor TPhantom.Destroy;<br>begin<br> if (csDesigning in ComponentState) then exit;<br> if Ficonsichtbarkeit and not (csDesigning in ComponentState) then<br> deleteIcon;<br> FIcondatei.Free;<br> DeallocateHWnd(FWnd);<br> inherited destroy;<br>end;<br><br>procedure TPhantom.WndProc(var Msg: TMessage);<br>begin<br> if (csDesigning in ComponentState) then exit;<br> with Msg do begin<br> if Msg = ficonmessage then<br> case LParamLo of<br> WM_LBUTTONDOWN: WLinksKlick;<br> WM_RBUTTONDOWN: WRechtsKlick;<br> WM_LBUTTONDBLCLK: WDoppelKlick;<br> end<br> else<br> Result := DefWindowProc(FWnd, Msg, wParam, lParam);<br> end;<br>end;<br><br>procedure TPhantom.Notification(Component: TComponent; Operation: TOperation);<br>begin<br> if (csDesigning in ComponentState) then exit;<br> inherited Notification(Component, Operation);<br> if Operation = opRemove then begin<br> if Component = FPopuprechts then FPopuprechts := nil;<br> if Component = FPopuplinks then FPopuplinks := nil;<br> end;<br>end;<br><br>procedure TPhantom.PWsichtbarkeit(value:boolean);<br>begin<br>fsichtbar:=value;<br>if (csDesigning in ComponentState) then exit;<br>if sichtbar=true then sichtbarmachen;<br>if sichtbar=false then unsichtbarmachen;<br>end;<br><br>procedure TPhantom.PWserviceprocess(value:boolean);<br>begin<br>fserviceprocess:=value;<br>if (csDesigning in ComponentState) then exit;<br>if serviceprocess=true then serviceprocessEin;<br>if serviceprocess=false then serviceprocessAus;<br>end;<br><br>procedure TPhantom.serviceprocessEin;<br>begin<br>RegisterServiceProcess(GetCurrentProcessID,1)<br>end;<br><br>procedure TPhantom.serviceprocessAus;<br>begin<br>RegisterServiceProcess(GetCurrentProcessID,0)<br>end;<br><br>procedure TPhantom.sichtbarmachen;<br>begin<br>showwindow(FindWindow(nil, @Application.Title[1]),SW_RESTORE)<br>end;<br><br>procedure TPhantom.unsichtbarmachen;<br>begin<br>showwindow(FindWindow(nil, @Application.Title[1]),SW_MINIMIZE);<br>showwindow(FindWindow(nil, @Application.Title[1]),SW_HIDE) ;<br>end;<br><br>procedure TPhantom.WRechtsklick;<br>begin<br>if (csDesigning in ComponentState) then exit;<br>if Assigned(FPopuprechts) then WPoprechts<br> else if Assigned(FRechtsKlick) then<br> FRechtsKlick(Self);<br>end;<br><br>procedure TPhantom.WLinksklick;<br>begin<br>if (csDesigning in ComponentState) then exit;<br>if Assigned(FPopuplinks) then WPoplinks<br> else if Assigned(FLinksKlick) then<br> FLinksKlick(Self);<br>end;<br><br>procedure TPhantom.WDoppelklick;<br>begin<br>if (csDesigning in ComponentState) then exit;<br>if Assigned(Fdoppelklick)then FDoppelKlick(Self);<br>end;<br><br>procedure TPhantom.WPopRechts;<br>var punkt:Tpoint;<br>begin<br>if (csDesigning in ComponentState) then exit;<br>GetCursorPos(Punkt);<br>SetForeGroundWindow(FWnd);<br>FPopuprechts.Popup(Punkt.X, Punkt.Y);<br>end;<br><br>procedure TPhantom.WPopLinks;<br>var punkt:Tpoint;<br>begin<br>if (csDesigning in ComponentState) then exit;<br>GetCursorPos(Punkt);<br>SetForeGroundWindow(FWnd);<br>FPopuplinks.Popup(Punkt.X, Punkt.Y);<br>end;<br><br>procedure TPhantom.CreateIcon;<br>var icon: TNOTIFYICONDATA;<br>begin<br>if (csDesigning in ComponentState) then exit;<br>with icon do begin<br> cbSize := SizeOf(TNOTIFYICONDATA);<br> Wnd := FWnd;<br> uID := 1;<br> uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;<br> uCallbackMessage :=ficonMessage;<br> hIcon := FIcondatei.Handle;<br> StrCopy(szTip, PChar(FTip));<br> Shell_NotifyIcon(NIM_ADD, @icon);<br> end;<br> icsichtbar := true;<br>end;<br><br>procedure TPhantom.ChangeIcon;<br>var icon: TNOTIFYICONDATA;<br>begin<br>if (csDesigning in ComponentState) then exit;<br>with icon do begin<br> cbSize := SizeOf(TNOTIFYICONDATA);<br> Wnd := FWnd;<br> uID := 1;<br> uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;<br> uCallbackMessage := ficonMessage;<br> hIcon := FIcondatei.Handle;<br> StrCopy(szTip, PChar(FTip));<br> Shell_NotifyIcon(NIM_MODIFY, @icon);<br> end;<br>end;<br><br>procedure TPhantom.DeleteIcon;<br>var icon: TNOTIFYICONDATA;<br>begin<br>if (csDesigning in ComponentState) then exit;<br>with icon do begin<br> cbSize := SizeOf(TNOTIFYICONDATA);<br> Wnd := FWnd;<br> uID := 1;<br> uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;<br> uCallbackMessage := ficonmessage;<br> hIcon := FIcondatei.Handle;<br> StrCopy(szTip, PChar(FTip));<br> Shell_NotifyIcon(NIM_DELETE, @icon);<br> end;<br> icsichtbar := false;<br>end;<br><br>procedure TPhantom.settip(value:string);<br>begin<br>if FTip <> value then begin<br> FTip := value;<br> if not (csDesigning in ComponentState) then changeicon;<br> end;<br>end;<br><br>procedure TPhantom.Wicondatei(value:Ticon);<br>begin<br>if ficondatei<>value then begin<br> ficondatei.assign(value);<br> if (csDesigning in ComponentState) then exit;<br> if icsichtbar then changeicon else createicon;<br> if ficondatei.empty then deleteicon;<br> end;<br>end;<br><br>procedure TPhantom.WIconSichtbarkeit(value:boolean);<br>begin<br>ficonsichtbarkeit:=value;<br>if csDesigning in ComponentState then Exit;<br>if ficonsichtbarkeit=true and icsichtbar=false then createicon;<br>if ficonsichtbarkeit=false and icsichtbar=true then deleteicon;<br>end;<br><br>procedure TPhantom.Loaded;<br>begin<br> inherited Loaded;<br> if Ficonsichtbarkeit and not (csDesigning in ComponentState) and not FIcondatei.Empty then begin<br> createIcon;<br> end;<br>end;<br><br>procedure Register;<br>begin<br> RegisterComponents('Hacker', [TPhantom]);<br>end;<br><br>end.<br><br><br><br> <br><br><br>