A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Microsoft Messenger
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Shutdown Windows Messenger programatically?



 
 
Thread Tools Display Modes
  #1  
Old April 29th 04, 02:02 PM
Leo Havmøller
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Leo Havmøller.


Ads
  #2  
Old April 29th 04, 02:02 PM
Leo Havmøller
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

"Leo Havmøller" wrote in message
...
How do I request Windows Messenger shutdown from C/C++?


Also, what is the correct way to launch it again?

Leo Havmøller.


  #3  
Old April 29th 04, 02:02 PM
massimo874
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Also, what is the correct way to launch it again?

Leo Havmøller.


I think you have to read something about c/c++ process (exec funtions
family) and thread (p_thrread.h header file under linux) management.
However you could try using c routine system("name of command") for
calling the application but it is not very 'powerfull'; se also dos.h
header, it include many function corresponding to system calls such as cd ,
copy and so on.

Hi


  #4  
Old April 29th 04, 02:02 PM
massimo874
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Also, what is the correct way to launch it again?

Leo Havmøller.


I think you have to read something about c/c++ process (exec funtions
family) and thread (p_thrread.h header file under linux) management.
However you could try using c routine system("name of command") for
calling the application but it is not very 'powerfull'; se also dos.h
header, it include many function corresponding to system calls such as cd ,
copy and so on.

Hi


  #5  
Old April 29th 04, 02:02 PM
massimo874
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Also, what is the correct way to launch it again?

Leo Havmøller.


I think you have to read something about c/c++ process (exec funtions
family) and thread (p_thrread.h header file under linux) management.
However you could try using c routine system("name of command") for
calling the application but it is not very 'powerfull'; se also dos.h
header, it include many function corresponding to system calls such as cd ,
copy and so on.

Hi


  #6  
Old April 29th 04, 02:02 PM
massimo874
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Also, what is the correct way to launch it again?

Leo Havmøller.


I think you have to read something about c/c++ process (exec funtions
family) and thread (p_thrread.h header file under linux) management.
However you could try using c routine system("name of command") for
calling the application but it is not very 'powerfull'; se also dos.h
header, it include many function corresponding to system calls such as cd ,
copy and so on.

Hi


  #7  
Old April 29th 04, 02:02 PM
massimo874
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Also, what is the correct way to launch it again?

Leo Havmøller.


I think you have to read something about c/c++ process (exec funtions
family) and thread (p_thrread.h header file under linux) management.
However you could try using c routine system("name of command") for
calling the application but it is not very 'powerfull'; se also dos.h
header, it include many function corresponding to system calls such as cd ,
copy and so on.

Hi


  #8  
Old April 29th 04, 02:02 PM
massimo874
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Also, what is the correct way to launch it again?

Leo Havmøller.


I think you have to read something about c/c++ process (exec funtions
family) and thread (p_thrread.h header file under linux) management.
However you could try using c routine system("name of command") for
calling the application but it is not very 'powerfull'; se also dos.h
header, it include many function corresponding to system calls such as cd ,
copy and so on.

Hi


  #9  
Old April 29th 04, 02:02 PM
massimo874
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Also, what is the correct way to launch it again?

Leo Havmøller.


I think you have to read something about c/c++ process (exec funtions
family) and thread (p_thrread.h header file under linux) management.
However you could try using c routine system("name of command") for
calling the application but it is not very 'powerfull'; se also dos.h
header, it include many function corresponding to system calls such as cd ,
copy and so on.

Hi


  #10  
Old April 29th 04, 02:02 PM
massimo874
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

How do I request Windows Messenger shutdown from C/C++?

Also, what is the correct way to launch it again?

Leo Havmøller.


I think you have to read something about c/c++ process (exec funtions
family) and thread (p_thrread.h header file under linux) management.
However you could try using c routine system("name of command") for
calling the application but it is not very 'powerfull'; se also dos.h
header, it include many function corresponding to system calls such as cd ,
copy and so on.

Hi


  #11  
Old April 30th 04, 01:15 PM
Leo Havmøller
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

"Leo Havmøller" wrote in message
...
How do I request Windows Messenger shutdown from C/C++?


Found the solution myself. The following will gracefully shutdown both MSN
Messenger and Windows Messenger:

void ShutdownMessenger(void)
{
HWND hwnd;
UINT msgid;

// MSN Messenger.
hwnd = FindWindow("MSNHiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryMsnMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}

// Windows Messenger.
hwnd = FindWindow("HiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryWindowsMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}
}

Leo Havmøller.


  #12  
Old April 30th 04, 01:15 PM
Leo Havmøller
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

"Leo Havmøller" wrote in message
...
How do I request Windows Messenger shutdown from C/C++?


Found the solution myself. The following will gracefully shutdown both MSN
Messenger and Windows Messenger:

void ShutdownMessenger(void)
{
HWND hwnd;
UINT msgid;

// MSN Messenger.
hwnd = FindWindow("MSNHiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryMsnMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}

// Windows Messenger.
hwnd = FindWindow("HiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryWindowsMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}
}

Leo Havmøller.


  #13  
Old April 30th 04, 01:15 PM
Leo Havmøller
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

"Leo Havmøller" wrote in message
...
How do I request Windows Messenger shutdown from C/C++?


Found the solution myself. The following will gracefully shutdown both MSN
Messenger and Windows Messenger:

void ShutdownMessenger(void)
{
HWND hwnd;
UINT msgid;

// MSN Messenger.
hwnd = FindWindow("MSNHiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryMsnMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}

// Windows Messenger.
hwnd = FindWindow("HiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryWindowsMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}
}

Leo Havmøller.


  #14  
Old April 30th 04, 01:15 PM
Leo Havmøller
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

"Leo Havmøller" wrote in message
...
How do I request Windows Messenger shutdown from C/C++?


Found the solution myself. The following will gracefully shutdown both MSN
Messenger and Windows Messenger:

void ShutdownMessenger(void)
{
HWND hwnd;
UINT msgid;

// MSN Messenger.
hwnd = FindWindow("MSNHiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryMsnMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}

// Windows Messenger.
hwnd = FindWindow("HiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryWindowsMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}
}

Leo Havmøller.


  #15  
Old April 30th 04, 01:15 PM
Leo Havmøller
external usenet poster
 
Posts: n/a
Default Shutdown Windows Messenger programatically?

"Leo Havmøller" wrote in message
...
How do I request Windows Messenger shutdown from C/C++?


Found the solution myself. The following will gracefully shutdown both MSN
Messenger and Windows Messenger:

void ShutdownMessenger(void)
{
HWND hwnd;
UINT msgid;

// MSN Messenger.
hwnd = FindWindow("MSNHiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryMsnMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}

// Windows Messenger.
hwnd = FindWindow("HiddenWindowClass", NULL);
if (hwnd)
{
msgid = RegisterWindowMessage("TryWindowsMsgrShutdown");
PostMessage(hwnd, msgid, 1, 0);
}
}

Leo Havmøller.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 03:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.