Jump to content
Sign in to follow this  
FireFox

[SOLVED] check is the process has been suspended

Recommended Posts

FireFox

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
Chance

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
FireFox

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
FireFox

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  

  • Similar Content

    • Miliardsto
      By Miliardsto
      I want to detect if exact process or window uses directx or opengl or maybe something else library used in applications.
      Thats becouse there could be many windows with same names and different names and the same with process. I got so much process names I want to my script works with all, so i want standardize.
      All of this processes uses DirectX or OpenGL so then If I check this window/process uses these libraries I will be sure thats the right process
    • TryWare90Days
      By TryWare90Days
      I'm trying to kill a malware process, that I can't remove with my www.sophus.com/hom antivirus.

      The malware is known as coinminer,config and my Sophus only creates popups of blocking the malware.

      I know that the malware is constantly launching a svchost *32.exe processes, where the svchost.exe processes are from my Windows 7 operating system.
      I have with no luck tried to do this:
      Global $_bStatus = False
      While $_bStatus = False
                 Global $_iPid
                 Global $_sActiveTitleNew = "svchost *32.exe"
                 $_iPid = WinGetProcess($_sActiveTitleNew)
                 If $_iPid <> -1 Then $_bStatus = ProcessClose($_iPid)   
      Wend
      EXIT
       
      But the $_iPid doesn't ever show anything else than  -1, even if I can see the svchost *32.exe process in my TaskManager
       
      YES - I know I shouldn't EXIT after killing the first malware detection, but it is easier to explain the above for you, so I can get a solution.
    • nacerbaaziz
      By nacerbaaziz
      Hello my friends
      I have an inquiry after your permission
      I found a function to get the special line commands for any operation
      It requires the name of the process to be searched
      I want to use it to know the process
      Is this possible with this function
      Here is the code
       
      Func commandLineGet($proc, $strComputer=".")
      dim $array[1]
      local $ArrayNumber
      local $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
      local $oProcessColl = $oWMI.ExecQuery("Select * from Win32_Process where Name= " & '"'& $Proc & '"')
      local $Process
      For $Process In $oProcessColl
      $Process = $Process.Commandline
          ReDim $Array[UBound($Array)+1]
      $ArrayNumber = UBound($Array)-1
      $array[$ArrayNumber] = $Process
      Next
      $ArrayNumber = UBound($Array)-1
      $array[0] = $ArrayNumber
      return $array
      EndFunc
    • simy8891
      By simy8891
      Hi guys,
      It's been a while since I wrote my last message here and a while since I used AutoIt. I'm currently sort of desperate and I'm trying to find some help in regards of getting the network usage per process!
      I'm not interested in the total network usage of the NIC, but only on a specific PID's network utilization. They idea is to collect the amount of traffic uploaded and downloaded by a list of specific processes. So far Process Hacker and Process Explorer are capable of getting what I need, but I need to use these numbers in another script so they're sort of useless to me. I can't seem to find a way around it.
      Any idea, help is greatly appreciated.
      Thanks
    • 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.
       
×