CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

follow us on Twitter

Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

Become a Marketplace Partner

jobs.internet.com

internet.commerce
Partners & Affiliates
















Home >> Visual C++ / C++ >> Windows Programming >> Win32


PS (Process Status) for Windows 95 and Windows NT
Rating: none

Jerry Coffin (view profile)
August 6, 1998

A PS (Process Status) program for Windows 95 and Windows NT. This is a program to list all the active processes under Windows 95 or Windows NT. It lists each program's full path name and Process ID. If you run it with no command line arguments, it displays the output on the console. If you supply an argument (regardless of what it is) it displays the output in a Listbox instead.

In addition, a simple "kill" command is included. If you type "kill" followed by the Process ID shown in the PS display, that process will be killed (unless it's a 16 bit Windows task, which would require a bit more work.) When using KILL, you can use hex, decimal or octal for the Process ID, following the normal C conventions -- a prefix of "0x" indicates hex, a prefix of `0' indicates octal, and no prefix indicates decimal.
(continued)



Contents:
Full source code.
VC++ 5.0 SP3 project files. (untested with earlier versions)
hand-written makefile for command line builds.

Installation:

Unzip the ps_src.zip into a directory of your choice. Assuming you have VC++ correctly intalled, switch to that directory and type nmake. The executable should come to a bit under 8K.

If you use the VC++ project files, you'll probably get a message telling you that the project has been moved -- this is normal unless you happen to pick exactly the path name to put it in that I used.

Known bugs:

1) Under NT, DOS programs are not displayed. (16 bit Windows programs are...)

2) If you attempt to use the PID supplied for a 16 bit Windows program under NT to kill the program, killing the program will fail unless the kill program takes the special nature of the program into account. (You can kill the NTVDM that the Windows program runs under, and with sufficient code, you should be able to kill the Windows program by itself as well, but I don't know of a kill program that does so.)

This code was written by Jerry Coffin. It is hereby released into the public domain. Since the program is free, I provide no guaranty or warranty of any sort with it. However, if you report any bugs to jcoffin@taeus.com, there's a reasonable chance I'll try to fix them when I get a chance. Have fun.
Later,
Jerry.

Download demo project - 5KB

Download source - 16KB

Tools:
Add www.codeguru.com to your favorites
Add www.codeguru.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed







RATE THIS ARTICLE:   Excellent  Very Good  Average  Below Average  Poor  

(You must be signed in to rank an article. Not a member? Click here to register)

Latest Comments:
help me please - Legacy CodeGuru (02/04/2004)
VC++ app. Speed affected by Taskmgr. - Legacy CodeGuru (11/25/2003)
Idle Time of a system through VC++ - Legacy CodeGuru (09/13/2003)
How to get process info using process handle - Legacy CodeGuru (07/15/2003)
How can I get the networktraffic? - Legacy CodeGuru (03/27/2003)

View All Comments
Add a Comment:
Title:
Comment:
Pre-Formatted: Check this if you want the text to display with the formatting as typed (good for source code)



(You must be signed in to comment on an article. Not a member? Click here to register)

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES