Not getting output for the 'Process ID'.
Here is my code:
Const PROCESS_SET_QUOTA = 256;
Const TRIM_TO_ZERO = 4294967295; # 0xFFFFFFFF or (-1 as a signed long)
Public hWnd, processID, threadID, hProcess, hCurProcess
Declare DllFunc "long GetCurrentProcess() kernel32" _GetCurrentProcess
Declare DllFunc "short SetProcessWorkingSetSize(long, long, long) kernel32" _SetProcessWorkingSetSize
Declare DllFunc "long GetWindowThreadProcessId(long, short) user32" _GetWindowThreadProcessId
Declare DllFunc "long GetWindowProcessId(long) user32" _GetWindowProcessId
Declare DllFunc "long OpenProcess(long, short, long) kernel32" _OpenProcess
Declare DllFunc "short CloseHandle(long) kernel32" _CloseHandle
Function Main
hWnd = ActiveWindow()
MsgBox("hWnd",hWnd)
threadID = _GetWindowThreadProcessId( hWnd, processID)
MsgBox("threadID",threadID)
MsgBox("processID",processID)
hProcess = _OpenProcess(PROCESS_SET_QUOTA, TRUE, processID)
MsgBox("hProcess",hProcess)
_SetProcessWorkingSetSize(hProcess, TRIM_TO_ZERO, TRIM_TO_ZERO)
_CloseHandle(hProcess)
hCurProcess = _GetCurrentProcess(); Free extra CRV memory
MsgBox("hCrvProcess",hCurProcess)
_SetProcessWorkingSetSize(hCurProcess, TRIM_TO_ZERO, TRIM_TO_ZERO);
End Function
Here is my code:
Const PROCESS_SET_QUOTA = 256;
Const TRIM_TO_ZERO = 4294967295; # 0xFFFFFFFF or (-1 as a signed long)
Public hWnd, processID, threadID, hProcess, hCurProcess
Declare DllFunc "long GetCurrentProcess() kernel32" _GetCurrentProcess
Declare DllFunc "short SetProcessWorkingSetSize(long, long, long) kernel32" _SetProcessWorkingSetSize
Declare DllFunc "long GetWindowThreadProcessId(long, short) user32" _GetWindowThreadProcessId
Declare DllFunc "long GetWindowProcessId(long) user32" _GetWindowProcessId
Declare DllFunc "long OpenProcess(long, short, long) kernel32" _OpenProcess
Declare DllFunc "short CloseHandle(long) kernel32" _CloseHandle
Function Main
hWnd = ActiveWindow()
MsgBox("hWnd",hWnd)
threadID = _GetWindowThreadProcessId( hWnd, processID)
MsgBox("threadID",threadID)
MsgBox("processID",processID)
hProcess = _OpenProcess(PROCESS_SET_QUOTA, TRUE, processID)
MsgBox("hProcess",hProcess)
_SetProcessWorkingSetSize(hProcess, TRIM_TO_ZERO, TRIM_TO_ZERO)
_CloseHandle(hProcess)
hCurProcess = _GetCurrentProcess(); Free extra CRV memory
MsgBox("hCrvProcess",hCurProcess)
_SetProcessWorkingSetSize(hCurProcess, TRIM_TO_ZERO, TRIM_TO_ZERO);
End Function