Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


How to find out what program is running and terminate it?

Posted on 1998-03-09
Medium Priority
Last Modified: 2010-04-10
How to find out what program is running and terminate it?
e.g winword.
And what if a few instance of it is running?
Question by:stl
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 11

Expert Comment

ID: 1183305
If you want your program to run on Win95, you can use the ToolHelp functions.
Search for "Taking a Snapshot and Viewing Processes" in your MSVC documentation.

Author Comment

ID: 1183306
I get a unhandled exception when I run the GetProcessList()!

Can anyone teach me how to compile the PView95 source code?

Author Comment

ID: 1183307
Anyway I just want to close all winword that might be running.
Any sugguestion?
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 11

Accepted Solution

alexo earned 120 total points
ID: 1183308
Oh, why didn't you say so in the first place?

Here ya go:

#define STRICT
#include <Windows.h>
#define WORD_CAPTION    "Microsoft Word"

BOOL CALLBACK FindWord(HWND hwnd, LPARAM lparam)
    char text[sizeof WORD_CAPTION];
    int len = GetWindowText(hwnd, text, sizeof WORD_CAPTION);
    if (len == (sizeof WORD_CAPTION - 1) && !lstrcmp(text, WORD_CAPTION))
        PostMessage(hwnd, WM_QUIT, 0, 0);
    return TRUE;

void main()
    EnumWindows(FindWord, 0);


Author Comment

ID: 1183309
To alexo,
Can you teach me how to compile the PView95 source code?
Using Visual C ++ 5.

Thanks in advance.
LVL 11

Expert Comment

ID: 1183310
I'm a bit stressed at work at the moment.
What seems to be the problem with the PView95 source?
If you have the makefile, just open it in the compiler and shoot.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question