| View previous topic :: View next topic |
| Author |
Message |
r0lZ
Joined: 21 Apr 2007 Posts: 177
|
Posted: Fri Jul 06, 2007 7:11 pm Post subject: How to pause an external process? |
|
|
Hi!
I need to pause a process that has not been started by my script. I know its PID, process name or exe path to identify it.
Is it a way to pause and resume that process, in a manner similar to changing its priority? _________________ r0lZ |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Fri Jul 06, 2007 7:20 pm Post subject: |
|
|
I don't think J Random Process can be paused. can you set the priority th the lowest setting? _________________
(Common Answers) |
|
| Back to top |
|
 |
r0lZ
Joined: 21 Apr 2007 Posts: 177
|
Posted: Fri Jul 06, 2007 7:44 pm Post subject: |
|
|
Well, it's possible, of course, but the goal is to pause it completely, to avoid heavy IO operations.
When two processes are writing large files to disc at the same time, the CPU load of each process is usually not high, and therefore even with both processes running at idle priority, too many disc accesses occur.
I would like to launch several instances of the same program, and pause all of them but one to minimize the IO operations. When the first process has finished its job, the next one should resume automatically. Unfortunately using the idle priority is not sufficient in this case. _________________ r0lZ |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 1019 Location: London, UK
|
|
| Back to top |
|
 |
r0lZ
Joined: 21 Apr 2007 Posts: 177
|
Posted: Fri Jul 06, 2007 9:12 pm Post subject: |
|
|
Nice finding!
But, IMO, the existence of this tool proves that there must be some kernel function able to do what I need. I would like to use it instead of an external tool.
Thanks anyway! _________________ r0lZ |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Fri Jul 06, 2007 10:07 pm Post subject: |
|
|
if you can find a related function in MSDN, post here, and a DllCall wizard may be able to figure out how to call it. _________________
(Common Answers) |
|
| Back to top |
|
 |
r0lZ
Joined: 21 Apr 2007 Posts: 177
|
Posted: Fri Jul 06, 2007 10:36 pm Post subject: |
|
|
Unfortunately, I have just browsed the MSDN site, and found nothing directly exploitable (except, perhaps, SuspendThread, but I don't know how to retrieve the thread information.)
Also, PsSuspend source code is not available any more. Pity!  _________________ r0lZ |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 1019 Location: London, UK
|
Posted: Sat Jul 07, 2007 7:33 am Post subject: |
|
|
This one Looks like it has full source and description, should be able to establish what to do from that. _________________ Steve F AKA Superfraggle
http://r.yuwie.com/superfraggle |
|
| Back to top |
|
 |
r0lZ
Joined: 21 Apr 2007 Posts: 177
|
Posted: Sat Jul 07, 2007 9:22 am Post subject: |
|
|
Thanks!
Currently, I have implemented the pause using pssuspend.exe and it works pretty well, although it is better to hide the windows pertaining to the suspended process (as they are not refreshed any more.) Luckily, it's easy to do with AHK, but I have still to improve the method to hide ALL windows sharing the same process.
Also, as you can imagine, pausing a system process can be extremely dangerous. For example, suspend explorer.exe to see what I mean, and prepare to reboot!  _________________ r0lZ |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 1019 Location: London, UK
|
Posted: Sat Jul 07, 2007 10:33 am Post subject: |
|
|
Yeah I know what you mean, I used to use a pssuspend remotly at work combined with a few other apps.
Locking the PC first then pausing winlogon was a good one lol.
Remote task manager has a front end that can perform this task too. And can do it remotely too. _________________ Steve F AKA Superfraggle
http://r.yuwie.com/superfraggle |
|
| Back to top |
|
 |
r0lZ
Joined: 21 Apr 2007 Posts: 177
|
Posted: Sat Jul 07, 2007 10:51 am Post subject: |
|
|
I have searched the forum, but couldn't find the answer. How can I retrieve the complete list of all windows opened by a specific process? (I am already able to find the parent window of the process, but cannot find the children.) _________________ r0lZ |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Sat Jul 07, 2007 11:24 am Post subject: |
|
|
| r0lZ wrote: | | How can I retrieve the complete list of all windows opened by a specific process? |
| Code: | DetectHiddenWindows, ON ; You should avoid this for your purpose!!
PID := DllCall("GetCurrentProcessId")
Gui, 1:Show, x0 y0 w200 h100, Test Window1
Gui, 2:Show, x205 y0 w200 h100, Test Window2
WinGet, List, List, ahk_pid %PID%
Loop %List%
{
WinGetTitle, Title, % "ahk_id " List%A_Index%
Wins .= Title "`n"
}
MsgBox, 0, Windows for PID: %PID%, %Wins%
ExitApp |
 |
|
| Back to top |
|
 |
r0lZ
Joined: 21 Apr 2007 Posts: 177
|
Posted: Sat Jul 07, 2007 12:27 pm Post subject: |
|
|
Ah, OK! I didn't know the ahk_pid %PID% trick.
Huge thanks! _________________ r0lZ |
|
| Back to top |
|
 |
|