1
我試圖使用GetProcessImageFileName,但我發現了以下錯誤:如何使用GetProcessImageFileName?
Undeclared identifier: 'GetProcessImageFileName'
我已經嘗試添加PsAPI
和TlHelp32
的使用條款,但一直沒有解決的問題。
我試圖使用GetProcessImageFileName,但我發現了以下錯誤:如何使用GetProcessImageFileName?
Undeclared identifier: 'GetProcessImageFileName'
我已經嘗試添加PsAPI
和TlHelp32
的使用條款,但一直沒有解決的問題。
我不知道,如果這個功能是由RTL的任何地方提供的,但你總是可以只導入:
function GetProcessImageFileName(hProcess: THandle;
lpImageFileName: LPTSTR;
nSize: DWORD): DWORD; stdcall;
external 'PSAPI.dll'
name 'GetProcessImageFileNameA';
的ANSI版本(2007年德爾福)高於進口。另外,如果支持更高版本的Delphi(與Unicode字符串),你將有條件地導入GetProcessImageFileNameW
。
文檔說指出,將實現該函數的DLL是:*的Kernel32.dll在Windows 7和Windows Server 2008 R2; 的Psapi.dll(如果PSAPI_VERSION = 1)在Windows 7和Windows Server 2008 R2; 的Psapi.dll Windows Server 2008上,Windows Vista中,在Windows Server 2003和Windows XP *。你明白這是什麼意思嗎? –
@DavidHeffernan上述不適用於Windows 7? – 2016-12-06 10:18:58
我把它意味着我們僅限於'Win7上1'的'PSAPI_VERSION',但它是一個有點不透明給我。 –