登录
首页 » Process-Thread » program (TerminateProcess $ APPTYPE CONSOLE) uses SysUtils, Windows var ProcessH...

program (TerminateProcess $ APPTYPE CONSOLE) uses SysUtils, Windows var ProcessH...

于 2022-02-10 发布 文件大小:21.20 kB
0 35
下载积分: 2 下载次数: 1

代码说明:

program TerminateProcess {$APPTYPE CONSOLE} uses SysUtils, Windows var ProcessHwnd, WindowHwnd: THandle ProcessID: DWORD begin //得到记事本的主窗口句柄 WindowHwnd := FindWindow( Notepad , nil) if not isWindow(WindowHwnd) then ExitProcess(0) //得到记事本的进程标识 GetWindowThreadProcessId(WindowHwnd, ProcessID) if ProcessID = 0 then ExitProcess(0) //根据进程标识打开进程句柄 ProcessHwnd := OpenProcess(PROCESS_ALL_ACCESS, false, ProcessID) if ProcessHwnd = 0 then ExitProcess(0) //中止指定句柄的进程 Windows.TerminateProcess(ProcessHwnd, 0) end.-program (TerminateProcess $ APPTYPE CONSOLE) uses SysUtils, Windows var ProcessHwnd, WindowHwnd : THandle ProcessID : DWORD begin// notebook to be the main window handle WindowHwnd : = FindWindow (Notepad, nil) if not isWindow (WindowHwnd) then ExitProcess (0)// notebook to be in the process logo GetWindowThreadProcessId (WindowHwnd, ProcessID) if ProcessID = 0 then ExitProcess (0)// identification process under the process opened handle ProcessHwnd : = OpenProcess (PROCESS_ALL_ACCESS, fals

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696524资源总数
  • 103833会员总数
  • 52今日下载