複製鏈接
請複製以下鏈接發送給好友

GetProcessTimes

鎖定
GetProcessTimes是獲取與一個進程的經過時間有關的信息。
外文名
GetProcessTimes
定    義
獲取與一個進程的經過時間有關的信息

目錄

GetProcessTimesVB聲明

Declare Function GetProcessTimes Lib "kernel32" Alias "GetProcessTimes" (ByVal hProcess As Long, lpCreationTime As FILETIME, lpExitTime As FILETIME, lpKernelTime As FILETIME, lpUserTime As FILETIME) As Long

GetProcessTimes返回值

Long,非零表示成功,零表示失敗。會設置GetLastError

GetProcessTimes參數表

參數 類型及説明
hProcess Long,一個進程句柄
lpCreationTime FILETIME,指定一個FILETIME結構,在其中裝載進程的創建時間
lpExitTime FILETIME,指定一個FILETIME結構,在其中裝載進程的中止時間
lpKernelTime FILETIME,指定一個FILETIME結構,在其中裝載進程花在內核模式上的總時間
lpUserTime FILETIME,指定一個FILETIME結構,在其中裝載進程花在用户模式上的總時間

GetProcessTimesVC聲明

BOOL
WINAPI
GetProcessTimes(
__in HANDLE hProcess,
__out LPFILETIME lpCreationTime,
__out LPFILETIME lpExitTime,
__out LPFILETIME lpKernelTime,
__out LPFILETIME lpUserTime
);
參數
hProcess:
為需要獲取相關時間的進程句柄
lpCreationTime:
進程的創建時間
lpExitTime:
進程的退出時間
lpKernelTime:
進程在內核模式下的所有時間
lpUserTime:
進程在用户模式下的所有時間
返回值
調用成功返回 1 ,失敗則返回 0
FILETIME結構
typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME, *PFILETIME;
參數
dwLowDateTime:
時間的低32位
dwHighDateTime:
時間的高32位