Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

Kill Process or Close the Window

hi,

Greetings!

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,

Thanks,
Sureka
0
sureka
Asked:
sureka
2 Solutions
 
jkrCommented:
Check out http://support.microsoft.com/default.aspx?scid=KB;en-us;178893& ("How To Terminate an Application "Cleanly" in Win32")
0
 
Jaime OlivaresSoftware ArchitectCommented:
Here you have a tutorial:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k2/html/ppc_2002part1.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k2/html/ppc_2002part2.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k2/html/ppc_2002part3.asp

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.
0
 
jkrCommented:
Wow, I never killed a process using MAPI *LOL* :o)
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Jaime OlivaresSoftware ArchitectCommented:
Sorry, posted on wrong question.

>I never killed a process using MAPI *LOL* :o)
Just try, maybe works ;-)
0
 
KurtVonCommented:
I dunno, MAPI has killed a few of my processes in the past. :-)

Killed a few brain cells too.
0
 
Jaime OlivaresSoftware ArchitectCommented:
OK, forget the MAPI method and read this article. Many ways to kill aprocess:

http://secure.codeproject.com/threads/killprocess.asp

0
 
Jaime OlivaresSoftware ArchitectCommented:
Also have a look to this previous question. You don't need to FindWindow to identify your process:
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20713066.html
0
 
Kiran Paul VJComputer EngineerCommented:
hi..

try this

HWND hwnd;
hwnd = ::FindWindow(NULL,"title of the program");
if(hwnd)
{
  AfxMessageBox("Window detected.Press OK to close");
  ::SendMessage(hwnd,WM_CLOSE,0,0);
}

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
kiranvj
0
 
jkrCommented:
>>You don't need to FindWindow to identify your process

Have you read the article I linked above?
0
 
jkrCommented:
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...
0
 
Jaime OlivaresSoftware ArchitectCommented:
Maybe links are not valid now, but there are valid once, because I test and READ links before posting.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now