gogo023 发表于 2010-12-23 13:28:27

怎么获取系统优先级别高的进程路径

怎么获取系统优先级别高的进程路径,如系统的WINLOGON。EXE CSRSS。EXE这个都是系统级进程。而且基本优级高。我用过很多方法都不能获取它得的路径。

netegg 发表于 2010-12-23 16:45:13

什么叫系统优先级别

gogo023 发表于 2010-12-24 12:45:23

什么叫系统优先级别
netegg 发表于 2010-12-23 16:45 http://www.autoitx.com/images/common/back.gif

从这个图片能看出什么是优先级了吧。

lainline 发表于 2010-12-24 12:55:20

内存里读不出可以从注册表里读吧

3mile 发表于 2010-12-24 13:32:24

#include<process.au3>

Dim $i_Priority_Level, $i_Notepad_PID, $i_ArrayItem
Dim $a_RunLevels = ;low, normal, high priorities
;Get Priority Level of this instance of AutoIt Scripting Engine
$i_Priority_Level = _ProcessGetPriority (@AutoItPID)
MsgBox(0, "AutoIt Script", "Should be 2: " & $i_Priority_Level)
$i_Notepad_PID = Run(@ComSpec & ' /k notepad.exe', '', @SW_HIDE)
For $i_ArrayItem = 0 To 2
        ProcessSetPriority($i_Notepad_PID, $a_RunLevels[$i_ArrayItem])
        $i_Priority_Level = _ProcessGetPriority ($i_Notepad_PID)
        MsgBox(0, "Notepad Priority", "Should be " & $a_RunLevels[$i_ArrayItem] & ": " & $i_Priority_Level)
Next
ProcessClose('notepad.exe')
ProcessClose('cmd.exe')

lainline 发表于 2010-12-24 13:46:01

MsgBox (0,"",_ProcessGetPath(3120))

Func _ProcessGetPath($PID)
    If IsString($PID) Then $PID = ProcessExists($PID)
    $Path = DllStructCreate('char')
    $dll = DllOpen('Kernel32.dll')
    $handle1 = DllCall($dll, 'int', 'OpenProcess', 'dword', 0x0400 + 0x0010, 'int', 0, 'dword', $PID)
    $ret = DllCall('Psapi.dll', 'long', 'GetModuleFileNameEx', 'long', $handle1, 'int', 0, 'ptr', DllStructGetPtr($Path), 'long', DllStructGetSize($Path))
    $ret = DllCall($dll, 'int', 'CloseHandle', 'hwnd', $handle1)
    DllClose($dll)
    Return DllStructGetData($Path, 1)
EndFunc;==>_ProcessGetPath

只发现CSRSS。EXE不能读

gogo023 发表于 2010-12-24 20:22:04

本帖最后由 gogo023 于 2010-12-24 20:23 编辑

MsgBox (0,"",_ProcessGetPath(3120))

Func _ProcessGetPath($PID)
    If IsString($PID) Then $PID = ...
lainline 发表于 2010-12-24 13:46 http://www.autoitx.com/images/common/back.gif

每次运行的时候PID都不一样。通过先读PID再获得运行路径是不理想的。

sanhen 发表于 2010-12-24 20:33:28

需要提升权限。。。

gogo023 发表于 2010-12-26 16:12:38

需要提升权限。。。
sanhen 发表于 2010-12-24 20:33 http://www.autoitx.com/images/common/back.gif

提升AU3运行时候的权限就能查看到相同权限的路很了吗?

lamlp 发表于 2010-12-29 17:34:17

不知道读取到这个路径有什么用?用系统路径就可以得到啊!

gogo023 发表于 2011-1-4 20:26:10

测试过还是不能达到效果
页: [1]
查看完整版本: 怎么获取系统优先级别高的进程路径