Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Kill Process or Close the Window

Posted on 2004-09-01
Medium Priority
Last Modified: 2013-11-20


I want to Kill process so, anybody give me idea.

Better ,Give me idea on  FindWindowEx()--Its returns handler then i can sendMessage() with WM_CLOSE to that handler.

I was tried with FindWindowEx,but i unable get  window handler based on Window Title.
Is there any other way to get the window handler based on WIndow Title or Window exe.

Give me idea,

Question by:sureka
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
LVL 86

Accepted Solution

jkr earned 252 total points
ID: 11952084
Check out;en-us;178893& ("How To Terminate an Application "Cleanly" in Win32")
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11952483
Here you have a tutorial:

Also go to you eVC help and write on the search tab:
sample sending mail cemapi mapidefs

You will see an article with a full working code of a sending mail application using mapi.
LVL 86

Expert Comment

ID: 11952527
Wow, I never killed a process using MAPI *LOL* :o)
Technology Partners: 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!

LVL 55

Expert Comment

by:Jaime Olivares
ID: 11952638
Sorry, posted on wrong question.

>I never killed a process using MAPI *LOL* :o)
Just try, maybe works ;-)
LVL 11

Expert Comment

ID: 11952713
I dunno, MAPI has killed a few of my processes in the past. :-)

Killed a few brain cells too.
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 248 total points
ID: 11959860
OK, forget the MAPI method and read this article. Many ways to kill aprocess:

LVL 55

Expert Comment

by:Jaime Olivares
ID: 11959885
Also have a look to this previous question. You don't need to FindWindow to identify your process:
LVL 16

Expert Comment

by:Kiran Paul VJ
ID: 11960317

try this

HWND hwnd;
hwnd = ::FindWindow(NULL,"title of the program");
  AfxMessageBox("Window detected.Press OK to close");

note : the title of the window is not case sensitive, but the given string should be exactly same as the window title. Here i used FindWindow.
FindWindowEx is used to find the child windows(edit box, combobox etc) of a program.

hope this helps
LVL 86

Expert Comment

ID: 11964228
>>You don't need to FindWindow to identify your process

Have you read the article I linked above?
LVL 86

Expert Comment

ID: 12218195
Um, since the article I posted is quite complete and jaime_olicares' comment deals with MAPI(!) and the links are 404, I cannot see a reason for a split...
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12218258
Maybe links are not valid now, but there are valid once, because I test and READ links before posting.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 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