stopping a process

I want to close an already running process in my system.
Say Yahoo msngr.I  can identify and hide the window but am not able to stop 
the Yahoo Messenger process.
How can I stop that process such that the window is closed and the process 
is stopped as well such that that its entry from the task manager is also 
removed.
Destroy doesnt works.


0
efextra1 (33)
8/22/2006 10:30:04 AM
vc.mfc 33608 articles. 0 followers. Follow

9 Replies
712 Views

Similar Articles

[PageSpeed] 52

you need to use windows shell command "net start/stop SERVICENAME"
the service name is to be used as we can see it in Services using
services.msc at run command.

Sandipan Aich wrote:
> I want to close an already running process in my system.
> Say Yahoo msngr.I  can identify and hide the window but am not able to stop
> the Yahoo Messenger process.
> How can I stop that process such that the window is closed and the process
> is stopped as well such that that its entry from the task manager is also
> removed.
> Destroy doesnt works.

0
8/22/2006 10:56:15 AM
i want to do this using my VC++ code....
I want to write a VC++ program under mfc that will stop the process
"sandy84" <sandeepnk84@gmail.com> wrote in message 
news:1156244175.049066.85870@i42g2000cwa.googlegroups.com...
> you need to use windows shell command "net start/stop SERVICENAME"
> the service name is to be used as we can see it in Services using
> services.msc at run command.
>
> Sandipan Aich wrote:
>> I want to close an already running process in my system.
>> Say Yahoo msngr.I  can identify and hide the window but am not able to 
>> stop
>> the Yahoo Messenger process.
>> How can I stop that process such that the window is closed and the 
>> process
>> is stopped as well such that that its entry from the task manager is also
>> removed.
>> Destroy doesnt works.
> 


0
efextra1 (33)
8/22/2006 11:28:55 AM
This might help:

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

Tom

"Sandipan Aich" <efextra@newsgroups.nospam> wrote in message 
news:%23fUCI5dxGHA.4444@TK2MSFTNGP02.phx.gbl...
>i want to do this using my VC++ code....
> I want to write a VC++ program under mfc that will stop the process
> "sandy84" <sandeepnk84@gmail.com> wrote in message 
> news:1156244175.049066.85870@i42g2000cwa.googlegroups.com...
>> you need to use windows shell command "net start/stop SERVICENAME"
>> the service name is to be used as we can see it in Services using
>> services.msc at run command.
>>
>> Sandipan Aich wrote:
>>> I want to close an already running process in my system.
>>> Say Yahoo msngr.I  can identify and hide the window but am not able to 
>>> stop
>>> the Yahoo Messenger process.
>>> How can I stop that process such that the window is closed and the 
>>> process
>>> is stopped as well such that that its entry from the task manager is 
>>> also
>>> removed.
>>> Destroy doesnt works.
>>
>
> 


0
tserface (3861)
8/22/2006 1:59:01 PM
Not sure what you mean by "destroy".  Do you mean "DestroyWindow"?  In any case, read the
MSDN article on graceful shutdown.  You should try to PostMessage a WM_CLOSE message to
the top-level window.

Barring that, you can use Spy++ to see what message the normal shutdown command sends the
window.
				joe

On Tue, 22 Aug 2006 16:00:04 +0530, "Sandipan Aich" <efextra@newsgroups.nospam> wrote:

>I want to close an already running process in my system.
>Say Yahoo msngr.I  can identify and hide the window but am not able to stop 
>the Yahoo Messenger process.
>How can I stop that process such that the window is closed and the process 
>is stopped as well such that that its entry from the task manager is also 
>removed.
>Destroy doesnt works.
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
8/22/2006 2:03:13 PM
Is Yahoo Messenger a system service?
				joe

On 22 Aug 2006 03:56:15 -0700, "sandy84" <sandeepnk84@gmail.com> wrote:

>you need to use windows shell command "net start/stop SERVICENAME"
>the service name is to be used as we can see it in Services using
>services.msc at run command.
>
>Sandipan Aich wrote:
>> I want to close an already running process in my system.
>> Say Yahoo msngr.I  can identify and hide the window but am not able to stop
>> the Yahoo Messenger process.
>> How can I stop that process such that the window is closed and the process
>> is stopped as well such that that its entry from the task manager is also
>> removed.
>> Destroy doesnt works.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
8/22/2006 2:03:56 PM
> I want to close an already running process in my system.
> Say Yahoo msngr.I  can identify and hide the window but am not able to stop
> the Yahoo Messenger process.
> How can I stop that process such that the window is closed and the process
> is stopped as well such that that its entry from the task manager is also
> removed.
> Destroy doesnt works.

Did you try posting a WM_CLOSE to the window? Typically you should not
destroy the process; it should be a graceful exit unless it is hung.
For processes with top level window, you should use post WM_CLOSE.

---
Ajay

0
ajaykalra (6842)
8/22/2006 2:05:39 PM
thank you friends....
posting the WM_DESTROY worked...
thanx to each one of you....
but dont worry...i'll come back with more silly questions  :-)
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:1156255539.162137.162930@h48g2000cwc.googlegroups.com...
>> I want to close an already running process in my system.
>> Say Yahoo msngr.I  can identify and hide the window but am not able to 
>> stop
>> the Yahoo Messenger process.
>> How can I stop that process such that the window is closed and the 
>> process
>> is stopped as well such that that its entry from the task manager is also
>> removed.
>> Destroy doesnt works.
>
> Did you try posting a WM_CLOSE to the window? Typically you should not
> destroy the process; it should be a graceful exit unless it is hung.
> For processes with top level window, you should use post WM_CLOSE.
>
> ---
> Ajay
> 


0
efextra1 (33)
8/26/2006 9:32:06 AM
NO. You SHOULD NOT send or post WM_DESTROY. It is a notification from window 
manager, not a command message.

You should use WM_CLOSE instead.

"Sandipan Aich" <efextra@newsgroups.nospam> wrote in message 
news:%23zyKiKPyGHA.3512@TK2MSFTNGP04.phx.gbl...
> thank you friends....
> posting the WM_DESTROY worked...
> thanx to each one of you....
> but dont worry...i'll come back with more silly questions  :-)
> "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
> news:1156255539.162137.162930@h48g2000cwc.googlegroups.com...
>>> I want to close an already running process in my system.
>>> Say Yahoo msngr.I  can identify and hide the window but am not able to 
>>> stop
>>> the Yahoo Messenger process.
>>> How can I stop that process such that the window is closed and the 
>>> process
>>> is stopped as well such that that its entry from the task manager is 
>>> also
>>> removed.
>>> Destroy doesnt works.
>>
>> Did you try posting a WM_CLOSE to the window? Typically you should not
>> destroy the process; it should be a graceful exit unless it is hung.
>> For processes with top level window, you should use post WM_CLOSE.
>>
>> ---
>> Ajay
>>
>
> 


0
alegr (1131)
8/27/2006 3:34:40 PM
Posting WM_DESTROY is an error!  It does NOT destroy the window, it erroneously fools the
code into THINKING the window was destroyed without actually destroying it.  This is
incorrect.

There are many messages you must not send yourself as messages.  WM_SETFOCUS,
WM_KILLFOCUS, WM_DESTROY and WM_PAINT are high on the list of messages you must never
send, because they are REPORTING an event, not CAUSING the event.
					joe

On Sat, 26 Aug 2006 15:02:06 +0530, "Sandipan Aich" <efextra@newsgroups.nospam> wrote:

>thank you friends....
>posting the WM_DESTROY worked...
>thanx to each one of you....
>but dont worry...i'll come back with more silly questions  :-)
>"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
>news:1156255539.162137.162930@h48g2000cwc.googlegroups.com...
>>> I want to close an already running process in my system.
>>> Say Yahoo msngr.I  can identify and hide the window but am not able to 
>>> stop
>>> the Yahoo Messenger process.
>>> How can I stop that process such that the window is closed and the 
>>> process
>>> is stopped as well such that that its entry from the task manager is also
>>> removed.
>>> Destroy doesnt works.
>>
>> Did you try posting a WM_CLOSE to the window? Typically you should not
>> destroy the process; it should be a graceful exit unless it is hung.
>> For processes with top level window, you should use post WM_CLOSE.
>>
>> ---
>> Ajay
>> 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
8/29/2006 12:48:27 AM
Reply:

Similar Artilces:

Buttons have stopped working in my Access 2007 database
Thisis my first database in Access 2007, it is in a .accdb file which is linked to tables in an online SQlServer database as well as having local tables. I have imported most of the forms from an earlier Acces 2002 database configuring them to new data sources as neccessary. All this has worked satisfactorily in this development phase until quite suddely the buttons have ceased responding on all my forms. Their function is mostly to open up forms but they do other things as well. The buttons open up forms through using a click event to run code in Visual basic. I am wondering if I ha...

Bank has stopped access
I am getting a message that the bank has stopped my account info because of wrong sign in information. I have called the bank and nothing has changed, same password so they said I should contact Money. I dont know how to contact money and dont know what to do. ...

About protected memory in COM(in-process)
Hello! For several years ago an in-process COM dll was deleloped using ATL/C++/MFC This in-process COM DLL was initially used from VB6 and it has worked ever since then and still works today without any kind of problem. It has never ever been any kind of problems with this COM dll. For about 7 month ago a C# asp.net webb application was deloped where this in-process COM DLL was used. When this C# asp.net webb was finished and put into test where the COM dll was called error began to appear. Not every time but far too often. It wasn't reliable. The errors that appear was the protected mem...

batch script for stop and restart the services
Hello guys, How do I write a batch script to check a particular folder to find any files present. Once the files are present,have to stop a service which running on a server,before cut and paste all the .xml files from that location to another location.then restart the service and copy back into the first location (that I can use robocopy /S for leaving the empty folders/sub folders). then the next step to check whether any files are present at the original queue which haven't processed by the above mentioned sevice,do the same step again and again until all the folders/sub ...

I need a better way to stop an application.
My program needs a utility program to be running. So when my program starts, it does a CreateProcess to start the utility program. When my program terminates it does a ::FindWindow to get the utility program's window. It uses the utility program's title bar text. It then does a PostMessage of a registered message which the utility program then gracefully exits. Also when my program thinks the utility program has stopped working (for whatever reason), it does the same stop proceedure and it then restarts the utility program by doing a CreateProcess. Usually the code works. But ...

WLM creates multiple copies of itself in the processes
..0.8089I have WLM version 2009 (build 14.0.8089.0726) and when I load up WLM it will create a copy of itself in the processes. However, when I close WLM the version in the processes wil not close. So if I open WLM 5 times, then I will wind up with 5 copies of WLM in my processes. Can anyone help? "TADDY" <TADDY@discussions.microsoft.com> wrote in message news:2479CC8B-485E-4016-B364-DF9D250BDCED@microsoft.com... > .0.8089I have WLM version 2009 (build 14.0.8089.0726) and when I load up > WLM it will create a copy of itself in the processes. However, when I...

Outlook Client
In CRM V4 is there anyway to stop a Outlook user from Tracking Contacts in CRM? Ideally the 'Track In CRM' button would be disabled, but if that is not possible is there another way. Can you detect from a PreCreate Contact Plugin that the contact was created from Outlook and abort the creation? We can't deny them security access as they must be able to create contacts through the web client. TJ Hi TJ, Have you tried, in outlook, going to CRM/ options/ synchronization tab / and unchecking the contacts box? Jarrett Coleman Dynamics Four ...

some inbound mails get stopped at Exchange IMS server
Hello, I hope someone can help me understand this dilema. My environment: . A relay (running Sendmail on Linux) sits on DMZ, called RELAY1 . A MS exchange 5.5 IMS server, called SERVER1 . A MS exchange 5.5 mailbox server called SERVER2 Automatically generated emails from a website are sent to our users after they filled out information at the website. The problem is that my users don't received the mail. I investigated and saw that although the message entered our relay RELAY1, then SERVER1, it didn't get delivered to the mailbox server SERVER2. When I did a "Mess...

Queue in retry, connects 7 times, stops at 354+go+ahead on 7th try
Hello all, This is my first post so I'll try to do the issue justice. When trying to send a message with a specific attachment (1.8MB powerpoint) to gmail or comcast, the message makes it to the queue, then this happens: 2007-04-02 18:36:39 64.233.167.27 OutboundConnectionResponse SMTPSVC1 MAIL1 - 25 - - 220+mx.google.com+ESMTP+v15si9737300pyh 0 2007-04-02 18:36:39 64.233.167.27 OutboundConnectionCommand SMTPSVC1 MAIL1 - 25 EHLO - MAIL1.camas.wednet.edu 0 2007-04-02 18:36:39 64.233.167.27 OutboundConnectionResponse SMTPSVC1 MAIL1 - 25 - - 250-mx.google.com+at+your+service,+[169.204...

Creating a process as the local user from a program in the system account?
Assuming that I have an executable that runs in the system context (for example started from AT without /interactive). How would I go about starting a program for the current, logged in user? - Anders G Have you looked at CreateProcessAsUser, maybe that one can help. /Niklas "Anders Gustafsson" <dalNOton@peSPAMdago.fi> wrote in message news:VA.00000066.00b3d048@pespamdago.fi... > Assuming that I have an executable that runs in the system context (for > example started from AT without /interactive). How would I go about > starting a program for the current, logg...

Publisher 2007
Hi, I help our local church with their systems. One of the employees had installed Publisher 2007 Trial on their laptop (A Compaq running Vista Basic with 528MB memory) and everything seemed to work fine. A month or so later I helped them buy a volume license for Office 2007 Pro. She installed Office Pro 2007 on her laptop and again everything seemed fine. Last week Publisher stopped working (this is also about the time the trial would have run out). Publisher opens fine but when she tries to open a new file or an existing one it just shows the working icon then acts like it never rec...

Excel 2007 stopped working
I am experiencing problems with Excel 2007 This occurs each time I try to highlight cell content in colour I get a message stating Excel has stopped working, will try to recover your work etc. etc. The first time it happened windows took me to an important office update which I downloaded and installed but the problem persists. Anyone else come across this and more importantly, a solution ? Thanks in advance. Andy B ...

How to read Item from Public Folder and process it DIRECTLY.
I would like to process item in Public Folder DIRECTLY. I would like to know how to read out that because of that. MAPIFolder.Save(or SaveAs) method is not the way I having made purpose. Again, I would like to read out item and process it DIRECTLY. regard. Hello, if you use WebDAV, you can read the contents of the mail into a MemoryStream class or similar and process it directly. Best regards, Henning Krause "gata" <gata@discussions.microsoft.com> wrote in message news:7B78A75D-D8F3-476B-A2C8-982A99549E81@microsoft.com... >I would like to process item in Public Folde...

How do I stop a linked doc from searching for Source after update?
I have an Excel (2000) spreadsheet that is linked. Everytime I update, it goes to the explorer to search for the source document. How can I make changes without Excel searching for the source? ...

stopping 2003 enterprise CA
Hello all I have an enterprise 2003 CA that's running on a DC. I want to stop the CA services on this box, to get an idea of what might break out in the wild. When stopping the CA services, will machines that already have a cert from the CA, be able to use this cert to authenticate? example we issue certs for wireless access to the network, if the machine already has the cert, they should still be able to use the wireless network, but I wanted to ask the questions to the experts Thanks If you Install CA on AD then you can't modify anything like computer name and ...

Stop SPAM #2
Hi, account@mydomain.com, administrator@mydomain.com, legal@mydomain.com, etc, etc, etc. I have an Exchange 2k3 single server running in 2k3 AD environment. SPAM software creats what reads like common email addresses and sends them to my domain. My postmaster services is consumed replying to those SPAMS that those email addresses do not exist. How can I prevent those SPAMs from entering into my server in the first place? Thanks Yba Use recipient filtering to reject emails not in AD. http://www.exchangeinbox.com/articles/020/dirharvest.htm cheers, Alexander Zammit WinDeveloper Software I...

Caching stops Outlook from sending
We're running Exchange 2007, recently upgraded from 2003; our clients us Outlook 2003. Out of about 300 users, one user has an issue on his laptop: if his Outlook is set to use cached Exchange mode, items will sit in his outbox but never be sent. Outlook will just offer up that Exchange said error 0x80040115 occurred. He'll receive mail fine but outgoing mail will just pile up in his outbox and never go. When we check his OWA, no messages will be in his outbox, though, even though in his Outlook 2003 it will say there are messages waiting to go. And finally, if he tries to send off a...

Web video play issue
This is my computer config; Intel Calpella CPU(i7-620M), Win7 HP 32b, 4GB DDR3, IE8.0.... When I palying some video file on the web, sometiems the audio and video stop shortly or hang the video and make audio noise. Don't you see like this issue? Thanks, Hi BL, Yes, sometimes.... usually when I have exceeded my download limits with my ISP and they throttle back my connection speed, or during peek times when I am watching something that is popular. There is only so much water you can fit in a pipe. You can adjust your Flash buffering by right clicking on some players ...

want excel 2007 to stop calculating processors
Hi There I am running excel 2007. I have a sheet with 167000 lines in it, and have to use vlookup to match fields from other files. Once i made a change, the program start with "Calculating: (Processor) which is taking up to an hour to complete. How can i remove that calculating Regards Johann Terblanche Office Button (top left hand corner) Excel Options (lower right hand corner) Formulas (left hand side) then, on the right hand side, under Calculation options, set Workbook Calculation to Manual / OK If my comments have helped please hit Yes. Thanks. ...

How do I stop opening new publications?
We're working on the literary magazine, and we took something from a floppy and put it on the first page. Then we took out the floppy, put in another one, and put that document on page two. However, it opened a whole new publication and we currently have seven new publications running. How do I stop this? PS: We honestly DO know how to run computers...just NOT Publisher. I promise. Have you tried...Insert / Page... (Ctrl+Shift+N). Also it may be a good idea to copy the files to your hard drive before importing them into Publisher. -- John Inzer "InTooDeep0604" &...

Office 2007 Compatibility Pack stopped working
We are still running Office XP, (I know...I know). I've installed the office 2007 compatibility pack on all the computers in the office. Initially it worked fine but it has stopped working on several machines. On those machines I no longer get the full list of items to convert when double-clicking on a .DOCX file. Most importantly the Word 2007 convert option is no longer listed. I don't get the message as if the compatibility pack is not installed, there is just no option listed in the convert menu. In fact if I just open Word and drag-n-drop a .DOCX file into word it co...

Creating a timer or "stop watch" in excel.
I'm trying to create a timer in an Excel spread sheet. The spread sheet is used for timed tests etc. and I was tryingn to figure out if there is a way of writing a macro to easliy start and stop time? Hi have a look at: http://www.mvps.org/dmcritchie/excel/datetime.htm (at the bottom of this site) -- Regards Frank Kabel Frankfurt, Germany Dan G wrote: > I'm trying to create a timer in an Excel spread sheet. The spread > sheet is used for timed tests etc. and I was tryingn to figure out if > there is a way of writing a macro to easliy start and stop time? ...

Word stopped working
I am using 2003 with XP. Word suddenly stopped opening documents(all including email file attachments). It now comes up encountered error, send report, then it continues to open for a new document. Any suggetions how to correct? Have you tried repairing the installation? -- Stefan Blom Microsoft Word MVP "classylady55" <classylady55@discussions.microsoft.com> wrote in message news:80D6C788-C385-487E-B597-ED911C56A558@microsoft.com... >I am using 2003 with XP. Word suddenly stopped opening documents(all > including email file attachments). It now c...

EXCEL.EXE Process Won't Die After Quitting Excel (Seems MS Query Related)
I recently started using the Database Query feature of Excel. Now, if I create a new query during my Excel session, and then later quit Excel, I notice that the "EXEL.EXE" process is still running (I see it via the task manager). If I then try to run Excel again, the toolbar and menubar show up, but the main window is gone. I have learned now that I need to kill the Excel process in task manager before trying to run Excel again. This only seems necessary, though, when I create a new query using the "New Database Query" menu item. Is this a known bug? I am running Exc...

How to stop someone from hijacking a userid/password?
Hi A couple of days ago someone on the Internet cracked a uid/pwd on our exchange server and were using that to send spam. How can I stop that in the future. Our users change their password frequently - once a month. Refer to http://www.spammarshall.com/SpamMarshallWeb/SMTPIntrusionDetection.jsp Mike Adam wrote: > Hi, > A couple of days ago someone on the Internet cracked a uid/pwd on our exchange server and were using that to send spam. How can I stop that in the future. Our users change their password frequently - once a month. ...