process

Are the “System” and “System Idle Process” PIDs constant on Windows?

假装没事ソ 提交于 2021-02-19 04:05:27
问题 On a couple of windows XP systems I've looked at, the "System Idle Process" always has PID 0, and the "System" process always has PID 4. In a Windows program which enumerates processes, is it safe to recognise these processes by these PIDs, or can they be different in some circumstances? 回答1: I have production code which assumes these PIDs are static, and it works on XP, Vista and Win 7. Not sure if it's the officially supported method though! Another couple of ways of approaching the problem

Get running thread by name from ProcessThreadCollection

我们两清 提交于 2021-02-18 20:58:32
问题 After searching on Stack Overflow questions and some googling, I still not getting it. I'm aware that you can check if a single thread is running with "Thread.isAlive()" method, but I want to check if a particular "FooThread" is still running between all running threads from current process, and if not, call the method that starts it. //somewhere in the code, on another Project/DLL inside solution private void FooThreadCaller() { Action act = () => fooFunction(); Thread t = new Thread(new

How do I create a pipe between two processes in Guile?

蓝咒 提交于 2021-02-18 18:52:02
问题 I want to create two process in Guile and send the output (stdout) from one of them as input (stdin) to the other. Using the following example, how can this be done? echo "foo bar" | wc Output: 1 2 8 回答1: Yes, you can do this using open-output-pipe : (let ((p (open-output-pipe "wc"))) (display "The quick brown fox jumps over the lazy dog.\n" p) (close-pipe p)) This is equivalent to echo "The quick brown fox jumps over the the lazy dog." | wc (including echo 's implicit newline because I'm

How do I create a pipe between two processes in Guile?

倾然丶 夕夏残阳落幕 提交于 2021-02-18 18:51:09
问题 I want to create two process in Guile and send the output (stdout) from one of them as input (stdin) to the other. Using the following example, how can this be done? echo "foo bar" | wc Output: 1 2 8 回答1: Yes, you can do this using open-output-pipe : (let ((p (open-output-pipe "wc"))) (display "The quick brown fox jumps over the lazy dog.\n" p) (close-pipe p)) This is equivalent to echo "The quick brown fox jumps over the the lazy dog." | wc (including echo 's implicit newline because I'm

start processes with a delay

自古美人都是妖i 提交于 2021-02-17 06:14:36
问题 How can I start 5 different processes, each with their own delay without holding up the other ones while waiting for the delay to finish? I can not use async or await foreach(string process1 in _processList) { // random delay Process.Start(process1); } 回答1: You could start every process from a different thread. foreach (string process1 in _processList) { Thread t = new Thread(() => { Thread.Sleep(/*RANDOM NUMBER*/ 5); Process.Start(process1); }); t.Start(); } That way each process will have a

Launch process (exe file) from resources

谁说我不能喝 提交于 2021-02-17 06:10:17
问题 I have a compiled exe file which I use to convert images. It is named convert.exe. I want to use it within my C# application without being visible in my application folder. So I thought I could add it as a resource. The problem is: How can I launch an external process of an exe file stored in my resources? 回答1: Unfortunately, there is no way around what Hans Passant said. Practically, in order to run it you must first save it to disk. There are several applications that use this method. One

If Windows explorer is open at a specific path, do not create a new instance

…衆ロ難τιáo~ 提交于 2021-02-16 21:30:42
问题 I am using the following code so that when the user clicks on a button, an instance of Windows Explorer is opened at a specific path. But this causes a new instance of the Explorer to be opened. I want to change it so that, if Explorer is already open in the same path, the program does not create a new process and instead bring the open instance to front. private void button_Click(object sender, EventArgs e) { if (Directory.Exists(myPath)) Process filesFolder = Process.Start("explorer.exe",

If Windows explorer is open at a specific path, do not create a new instance

断了今生、忘了曾经 提交于 2021-02-16 21:29:47
问题 I am using the following code so that when the user clicks on a button, an instance of Windows Explorer is opened at a specific path. But this causes a new instance of the Explorer to be opened. I want to change it so that, if Explorer is already open in the same path, the program does not create a new process and instead bring the open instance to front. private void button_Click(object sender, EventArgs e) { if (Directory.Exists(myPath)) Process filesFolder = Process.Start("explorer.exe",

Process.Start and “The system cannot find the path specified”

不想你离开。 提交于 2021-02-11 15:14:26
问题 I am trying to run a console application from a mapped drive (T:\ is a mapped drive for a shared network folder) and get the error: The system cannot find the path specified. Why do I get this error? The administrator credentials are correct. var password = new SecureString(); password.AppendChar(Convert.ToChar("P")); password.AppendChar(Convert.ToChar("a")); password.AppendChar(Convert.ToChar("a")); password.AppendChar(Convert.ToChar("s")); Process.Start(@"t:\ca\test.exe"), "",

How to check if a process is running on Windows?

谁说我不能喝 提交于 2021-02-11 05:10:40
问题 What I am trying to do it is a program to know if a process it is active on Windows to work with it in Java . I looked on the Internet and found two different solutions: Option 1 Option 2 But it is not at all what I am looking for. According to the option 1, I would like a method to make reference to the process (and detect if it is active/running) but without searching in the full tasklist and then searching on it. I am searching if there is a direct method to do that. I also though to add a