我要消息信使API,2000下的。

解决方案 »

  1.   

    查一下MSDN嘛
    NetMessageBufferSendThe NetMessageBufferSend function sends a buffer of information to a registered message alias.
    NET_API_STATUS NetMessageBufferSend(
      LPCWSTR servername,
      LPCWSTR msgname,
      LPCWSTR fromname,
      LPBYTE buf,
      DWORD buflen
    );Parameters
    servername 
    [in] Pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used. Windows NT:  This string must begin with \\.
    msgname 
    [in] Pointer to a constant string that specifies the message alias to which the message buffer should be sent. 
    fromname 
    [in] Pointer to a constant string specifying who the message is from. If this parameter is NULL, the message is sent from the local computer name. 
    buf 
    [in] Pointer to a buffer that contains the message text. For more information, see Network Management Function Buffers. 
    buflen 
    [in] Specifies a value that contains the length, in bytes, of the message text pointed to by the buf parameter. 
    Return Values
    If the function succeeds, the return value is NERR_Success.Requirements
    Client: Included in Windows XP, Windows 2000 Professional, and Windows NT Workstation.
    Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server.
    Header: Declared in Lmmsg.h; include Lm.h.
    Library: Use Netapi32.lib.
      

  2.   

    wchar_t szMsgText[]=L"This is test msg from AkiraChing!哈哈";
    NET_API_STATUS status;
    status=NetMessageBufferSend(NULL,//messeger的服务器
    L"AkiraChing",//要送达的机器名,可以是别名也可以是ip地址
                      NULL,//消息从哪个机器发出的,可以是别名也可以是ip地址
        (LPBYTE)&szMsgText,
    sizeof(szMsgText)
    );
    if(status==NERR_Success)
    AfxMessageBox(_T("消息发送成功"));在stdafx.h中加入
    #include "lm.h"
    #pragma comment(lib,"Netapi32.lib")