Guest Posted March 28, 2017 Share Posted March 28, 2017 (edited) This script allow you to run any process in slow speed mode. It use To make it posibole. Script: expandcollapse popupGlobal $ExePath, $iSleep, $iExePid $ExePath = FileOpenDialog('Select the exe file to run in slow motion mode','','Exe files (*.exe)') If @error Then Exit $iSleep = InputBox('Set Sleep value','Select the Sleep value',100) $iExePid = Run($ExePath) If @error Then Exit ConsoleWrite('Error' & ' (L: ' & @ScriptLineNumber & ')' & @CRLF) OnAutoItExitRegister(OnExitEvent) Global $iTimer, $bSuspended = False, $iTimer2 While Sleep(1) If TimerDiff($iTimer) >= $iSleep Then If Not $bSuspended Then _ProcessSuspend($iExePid) $bSuspended = True Else _ProcessResume($iExePid) $bSuspended = False EndIf If @error Then Exit $iTimer = TimerInit() EndIf If TimerDiff($iTimer2) > 2000 Then If Not ProcessExists($iExePid) Then Exit $iTimer2 = TimerInit() EndIf WEnd Func OnExitEvent() _ProcessResume($iExePid) EndFunc ; _ProcessSuspend and _ProcessResume - modified by gil900 Func _ProcessSuspend($processid) Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) Local $i_sucess = DllCall("ntdll.dll", "int", "NtSuspendProcess", "int", $ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If Not IsArray($i_sucess) Then Return SetError(@ScriptLineNumber,0,0) Return 1 EndFunc ;==>_ProcessSuspend Func _ProcessResume($processid) Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) Local $i_sucess = DllCall("ntdll.dll", "int", "NtResumeProcess", "int", $ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If Not IsArray($i_sucess) Then Return SetError(@ScriptLineNumber,0,0) Return 1 EndFunc ;==>_ProcessResume Edited March 28, 2017 by Guest Link to comment Share on other sites More sharing options...
legend Posted March 29, 2017 Share Posted March 29, 2017 what is the purpose of running it in slow speed? Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2017 Share Posted March 29, 2017 (edited) 1 hour ago, legend said: what is the purpose of running it in slow speed? Testig your code efficiency on bad environment with slow processing speed. But this code specifically will not be good for such testing on second thought.. Edited March 29, 2017 by Guest Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2017 Share Posted March 29, 2017 1 hour ago, legend said: what is the purpose of running it in slow speed? Testig how your code efficiency on bad environment with slow processing speed. But this code specifically will not be good for such testing on second thought.. Edit: it is good for saving battery life Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now