process

How to check if a process is running on Windows?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-11 05:06:34
问题 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

How to get a grandparents/ancestors process ID?

牧云@^-^@ 提交于 2021-02-11 04:35:23
问题 I would like to know - if possible - how to get the pid of a process' grandparent (or further). To be more specific, I want for a process to print its depth in a process tree. For example, when starting with the following: int main() { int creator_id = (int) getpid(); pid_t pid1 = fork(); pid_t pid2 = fork(); pid_t pid3 = fork(); //print depth in process tree of each process return 0; } According to my theory, the tree will look like this: 0 /|\ / | \ / | \ 0 0 0 / \ | 0 0 0 / 0 So my first

How to get a grandparents/ancestors process ID?

末鹿安然 提交于 2021-02-11 04:33:30
问题 I would like to know - if possible - how to get the pid of a process' grandparent (or further). To be more specific, I want for a process to print its depth in a process tree. For example, when starting with the following: int main() { int creator_id = (int) getpid(); pid_t pid1 = fork(); pid_t pid2 = fork(); pid_t pid3 = fork(); //print depth in process tree of each process return 0; } According to my theory, the tree will look like this: 0 /|\ / | \ / | \ 0 0 0 / \ | 0 0 0 / 0 So my first

Python disabling startmenu and taskbar

本秂侑毒 提交于 2021-02-10 19:38:48
问题 I have a python tkinter app. Whenever my app is running, i want my window startmenu, desktop icons and task bar to be disappeared. I actually managed to get the required result by manually going into the windows task manager and killing the process 'explorer.exe'. But when i tried to write a python script to do that automatically like this: import os os.system("taskkill /im explorer.exe") It is actually bringing up the shutting down window instead of hiding the startmenu and taskbar. Is there

Xamarin Android: Get ALL processes located in memory

心已入冬 提交于 2021-02-10 13:37:20
问题 Is there a way to read out all processes, not only the running processes. If I understood Android correctly, only one process is running at a time, and every other process is frozen (background processes ignored) 回答1: You can get all of androids currently running app processes by using the following code snippet: ActivityManager activityManager = (ActivityManager)BaseContext.GetSystemService(Context.ActivityService); ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();

Spawning child processes in a screensaver

耗尽温柔 提交于 2021-02-10 12:28:30
问题 I have a Screensaver written in .NET / C# that is dependent on a background process running. While the background process is added to the user's startup programs on install, it would still be nice to not require the user to reboot their machine after installing the screensaver. The process itself has to run under the current user's credentials, so using a Windows Service for this is out of the question. The best solution I've thought of for this is to detect whether the background process is

how to get running process information in java?

谁说我不能喝 提交于 2021-02-09 11:13:15
问题 i want to get infomation about other running processes in my os. (two things, process 'name' and 'path'.) now, i'm using linux command like a "ps command". Process process = Runtime.getRuntime().exec("ps x") but because i want to run this in windows too, i'm searching other function can be works in windows and linux. there are any java class or function have not os dependency? 回答1: The updated Process API in Java 9 through JEP 102 will help you if you're willing to upgrade early... This

how to get running process information in java?

£可爱£侵袭症+ 提交于 2021-02-09 11:12:00
问题 i want to get infomation about other running processes in my os. (two things, process 'name' and 'path'.) now, i'm using linux command like a "ps command". Process process = Runtime.getRuntime().exec("ps x") but because i want to run this in windows too, i'm searching other function can be works in windows and linux. there are any java class or function have not os dependency? 回答1: The updated Process API in Java 9 through JEP 102 will help you if you're willing to upgrade early... This

C# process hangs on dispose

自古美人都是妖i 提交于 2021-02-09 08:16:36
问题 I am invoking a command line process from C# that does an update from some remote server. Works fine when it can find the remote server and fetch data from it. Also works fine if not connected to a network. However, when the remote server is unreachable, the external process will try to fetch data indefinitely, and there is no command line options to specify a timeout. So I added a force kill on the process after trying for 15 seconds. using (var process = new Process {...}) { process.Start()

Get process name from pid or handle

好久不见. 提交于 2021-02-08 12:22:25
问题 Assuming I already have the handle to a window, I can get the PID with GetWindowThreadProcessId . Is there a way I can get the process name without having to get all the processes and try to match my PID? 回答1: You can use Process.GetProcessById to get Process . Process has a lot of information about the running program. Process.ProcessName gives you the name, Process.MainModule.FileName gives you the name of the executable file. 回答2: Process.GetProcessById(id).ProcessName 回答3: // Here is a