调用api函数
FindWindow
FindWindowEX
FindWindow
FindWindowEX
解决方案 »
- 后缀为xpl的文件
- Indy 10.5.5 版 get 乱码
- 请问一下!!!!
- Sybase的浮点数与Numeric类型之间隐式转换的问题。急
- 做三层应用时,中间层与数据库是怎么连的?是用BDE吗?还是ADO等其他什么?
- 請教報表的問題
- 如何用delphi编程实现sql server的数据备份和恢复
- 怎么在ADOTABLE中将指针定位于符合条件的记录
- 各位高手去看看《!!!!!!!!挑战极限3---修改正在运行的可执行文件(PE)的数据并把他保存在该程序的文件中---!!!!!!!!!!!你能
- 我是初学者,希望各位大哥帮忙,小弟将不吝赠分!
- 有人愿意合作成立软件工作室吗?(重庆)
- 小妹?^_^?:捉虫:这两段代码怎么不好用,限制用户的输入权限!
hwndsbsz:hwnd;
begin
hwndsbsz:=findwindow(nil,pchar(''); //引号中为另一应用程序的Application.Title,
即该程序运行时在任务栏上的名称 if hwndsbsz <> 0 then
application.MessageBox('模块正在运行中!','提示',mb_ok);
end;
给你一段Nt下的代码吧(整个单元)!unit u_CheckProcess;interfaceuses Windows, Classes, PsApi;function CheckProcess(aProcessName: string): Boolean;//exename(no path,eg hello.exe)
implementationfunction CheckProcess(aProcessName: string): Boolean;
type
integer = DWORD; // different versions of psapi.pas floating around
var
i, pidNeeded: Integer;
PIDList: array[0..1000] of Integer; // 1000 should be enough
PIDName: array[0..MAX_PATH - 1] of char;
PH: THandle;
begin
Result := False;
if not Psapi.EnumProcesses(@PIDList, 1000, pidNeeded) then
begin
Result := False;
exit;
end;
for i := 0 to (pidNeeded div sizeof(Integer) - 1) do
begin
PH := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False,
PIDList[i]);
if PH <> 0 then
begin
if psapi.GetModuleBaseName(PH, 0, PIDName, sizeof(PIDName)) > 0 then
if aProcessName = pidName then
begin
Result := True;
end;
if PH > 0 then
CloseHandle(PH);
end;
end;
end;end.