Sign in to follow this  
Followers 0
FireFox

[SOLVED] check is the process has been suspended

4 posts in this topic

#1 ·  Posted (edited)

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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      Detect if the focus item is a button or check box
      Hello everyone.
      My dears I have a problem
      When I try to use
      ControlGetFocus function
      it  doesn't recognize the check  boxes.
      The result is that the selector is a button
      Although the specified is a check box
      but I want a way to identify the check boxes.
      Because I want to make a tool that helps screen readers users
      I hope you have the solution.
      Thank you in advance.
       
    • ur
      By ur
      with the below code, I am keeping waiting for a particular file and waiting in the background.
      While $i <> 10 Sleep(60000) If FileExists(@ScriptDir&"\Binaries.ini") then --some processing-- $i = 10 endif WEnd I thought keeping the Sleep will freeze the process from resources but the CPU being uilized.But it is taking 47%.
      How to free this CPU usage also.?

    • ur
      By ur
      With  ProcessList ( ["name"] )  we are able to get the running process list from the local machine.
       
      Is there anyway to get the list from Remote machine, more precisely to get to know the status whether a particular application is running or not on remote machine using AutoIT?
       
      We can implement through PSList.exe, but again we need to parse the text of it to read the output.
      Is there any direct UDF in AutoIT?
    • Nareshm
      By Nareshm
      If Process exits then end process and ;Some code here {1}
       
      If Process does not exits then ; My {1} Code
    • ur
      By ur
      How to retrieve the target executable path from a process.
      My system is effected with IMG001.exe virus and I remove the folders created by it daily but still it is creating the folders everytime I login to my PC.
      My Antivirus is not detecting it.

       
      So I thought to create a process in AutoIT to check for the process name IMG001.exe and retrieve the process target exe to a log file, so that I can track where it is putting these files.
      With  ProcessExists ( "process" ) , i can get the process ID.
      But how to get the target location of the executable of the process.??