PSP
 

창 Process 정지 및 재가동

최고관리자 2026-06-24 (수) 20:56 2개월전 19  
q::
Process_Suspend("notepad.exe")

Process_Suspend(PID_or_Name)
{
    PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
    h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
    If !h
    Return -1
    DllCall("ntdll.dll\NtSuspendProcess", "Int", h)
    DllCall("CloseHandle", "Int", h)
}

Sleep, 9000

Process_Resume("notepad.exe")

Process_Resume(PID_or_Name)
{
    PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name
    h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)
    If !h
    Return -1
    DllCall("ntdll.dll\NtResumeProcess", "Int", h)
    DllCall("CloseHandle", "Int", h)
}

ProcExist(PID_or_Name="")
{
    Process, Exist, % (PID_or_Name="") ? DllCall("GetCurrentProcessID") : PID_or_Name
    Return Errorlevel
}
return

hi
이전글  다음글  목록 글쓰기

 
 
ragoman@naver.com