Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an interface to read the titles of the running processes on Windows #40

Open
dvarrazzo opened this issue Mar 2, 2010 · 2 comments

Comments

@dvarrazzo
Copy link
Owner

Originally submitted by daniele.varrazzo as issue 6:

I only know it can be done (see Process Explorer [1]), but how, I don't know.

Also, I wouldn't know if it should be a graphical interface (displaying
processes in a tree, allowing to send them signal etc.) or a command line
tool. I suppose the first would be more useful from a windows user PoV but
more complex to write and with fat dependencies.

Contributions are welcome.

[1] http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

@dvarrazzo
Copy link
Owner Author

Comment by daniele.varrazzo:

Sysinternals' "handle" program [1] returns the value as well

C:\dev\setproctitle\build\lib.win32-2.6>c:\Python26\python.exe
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

import setproctitle
setproctitle.setproctitle("Hello, world!")
import os
os.getpid()
804

C:\dev>x:\Sistema\sysinternals\handle.exe -p 804 -a

Handle v3.11
Copyright (C) 1997-2005 Mark Russinovich
Sysinternals - www.sysinternals.com

18: File C:\dev\setproctitle\build\lib.win32-2.6
39C: Event \BaseNamedObjects\python(804): Hello, world!
3A4: Directory \BaseNamedObjects
3A8: Event
[...]

but the source file (that must be no more than a couple of syscalls) is not available anymore [2].

[1] http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
[2] http://technet.microsoft.com/en-us/sysinternals/bb847944.aspx

@ysc3839
Copy link

ysc3839 commented Sep 24, 2024

You could try modify the buffer returned by GetCommandLineA and GetCommandLineW.
Doing so can't change process name, but can change process command line. And it's visible in Task Manager and Process Explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants