请高手帮忙!最好有源代码!
解决方案 »
- DLL窗体之间发消息问题
- 高分求解答,dspack采集无驱动摄像头视频压缩问题!!
- 如何使用Indy得到邮件的ID号?
- 为什么执行 if mythread.suspended 结果错误?
- 《SQL Server 2000开发指南》和《Delphi数据库程序设计》这两本书有必要都买下吗?
- 菜鸟的小问题!!
- 在线待急急!如何将FTP用户的设置和登录用户挂接
- richedit的问题,急,请帮帮我.
- 如何让F10键在keydown事件里响应,急急急!!!!!!!
- WIN7下,程序界面不显示,WINDOWS进程中有
- ADOQuery 中为什么不能用GO
- idTcpServer控件报socket error,救命啊。。。
KillTask(ExeFileName: string): integer;
const
PROCESS_TERMINATE=$0001;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
beginresult := 0;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle,FProcessEntry32);
while integer(ContinueLoop) <> 0 do
begin
if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
UpperCase(ExeFileName))
or (UpperCase(FProcessEntry32.szExeFile) =
UpperCase(ExeFileName))) then
Result := Integer(TerminateProcess(OpenProcess(
PROCESS_TERMINATE,
BOOL(0),
FProcessEntry32.th32ProcessID),0));ContinueLoop := Process32Next(FSnapshotHandle,FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
//使用
procedure TForm1.Button1Click(Sender: TObject);
begin
KillTask('notepad.exe');
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
KillTask('notepad.exe');
end;
SendMessage(FindWindow(nil,Pchar('YourApplicationTitle')), WM_CLose,0,0));
cosmart(CoolSmart) ,如果我找到了那个正在运行的程序,但是它的界面是隐藏的,如何把该程序的界面显示出来呢?
就像windows的任务管理器那样。