Jump to content

[SOLVED] check is the process has been suspended


FireFox
 Share

Recommended Posts

Hi,

I'm looking for a way to check if the process has been suspended (NOT if it's currently suspended with IsHungAppWindow) with the NtProcessSuspend function.

Note that it's for the process itself.

NB : If have added a timer in my while but it's not efficient if the cpu is overloaded which would increase the timer. (so I'm looking for a real solution)

Thanks for anyhelp.

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Ward made a function that about their execution ststus, along with some of the retrieved info was information about the processes suspension state.

Someone also in the examples script a few days ago as of your post.

Thanks for your anwser, but it does not work in so far as I want to check if the process has been suspended with the process itself.

I have found a good alternative : check the difference between the computer elapsed time with my timer.

Edit : I thouth the Timer* functions were created by the thread so the timers would suspend with it but It's not the case.

While 1
$iTimer = TimerInit()
$iCompTimer = Number(@MIN & @SEC)

Sleep(1000)

$iCurrCompTimer = Number(@MIN & @SEC)

If $iCompTimer >= 5900 Then
If $iCurrCompTimer < $iCompTimer Then
$iCurrCompTimer = Number(60 + @MIN & @SEC)
EndIf
EndIf

ConsoleWrite(Round(TimerDiff($iTimer) / 1000, 2) & ">" & $iCurrCompTimer - $iCompTimer + 1 & @CRLF)

If TimerDiff($iTimer) / 1000 > $iCurrCompTimer - $iCompTimer + 1 Then
ConsoleWrite("!>process suspended" & @CRLF)
EndIf
WEnd

So as you can see, It's useless to compare them.

Is there any way that I can create a timer which would be suspended WITH the process?

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Here is the trick I have found :

#include <Timers.au3>

Global $hGUI, $_iLastTime = -1

$hGUI = GUICreate("MyGUI")

_Timer_SetTimer($hGUI, 1000, "_TimerCallBack")

While 1
Sleep(1000)
WEnd

Func _TimerCallBack($hWnd, $Msg, $iIDTimer, $dwTime)
If $_iLastTime <> -1 And Round(($dwTime - $_iLastTime) / 1000, 2) > 1.5 Then
$_iLastTime = -1
MsgBox(16, "toto", "CallBack timer exceeded !")
Else
$_iLastTime = $dwTime
EndIf
EndFunc   ;==>_TimerCallBack

Br, FireFox.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...