请问如何更改指定进程的优先级?
这个过程为什么不对?procedure you;
var
Pn: TProcesseNtry32;
sHandle: THandle;
H: Hwnd;
Found: Boolean;
begin
sHandle := CreateToolHelp32SnapShot(TH32CS_SNAPALL, 0);
Found:= Process32First(sHandle, Pn);
while Found do
begin
if UpperCase(ExtractFileName(Pn.szExeFile)) = 'EXPLORER.EXE' then
begin
H := OpenProcess(PROCESS_ALL_ACCESS, True, Pn.th32ProcessID);
if SetThreadPriority(H,(THREAD_PRIORITY_LOWEST + 1))=true then
showmessage('ok');
end;
Found := Process32Next(sHandle, Pn);
end;
end;
谢谢!