//Defination : //static bool SetWindowsMessengerPersonalInfo(LPCSTR lpszMsg,int iMsgType = NULL); bool CStaticPubFunc::SetWindowsMessengerPersonalInfo(LPCSTR lpszMsg, int iMsgType) { // TODO: Add your control notification handler code here HWND hWndMSN = NULL; COPYDATASTRUCT cds; char sz[1000]; char szMsg[1000]; wchar_t wszMsg[1000]; //====================================================================== while(1) { hWndMSN = FindWindowEx(NULL, hWndMSN, "MsnMsgrUIManager", NULL); if(NULL != hWndMSN) { //-------------------------------------------------------------- strcpy(sz,lpszMsg); cds.dwData = 0x0547; //-------------------------------------------------------------- if(0 == iMsgType) { sprintf(szMsg, "//0Music//01//0{0}//0%s//0//0//0//0", sz); } else if(1 == iMsgType) { sprintf(szMsg, "//0Games//01//0{0}//0%s//0//0//0//0", sz); } else { sprintf(szMsg, "//0Office//01//0{0}//0%s//0//0//0//0", sz); } //-------------------------------------------------------------- int iLen = MultiByteToWideChar(CP_ACP, 0, szMsg, -1, NULL, NULL); MultiByteToWideChar(CP_ACP, 0, szMsg, -1, wszMsg, iLen); //-------------------------------------------------------------- cds.lpData = wszMsg; cds.cbData = (wcslen(wszMsg)+1)*2; ::SendMessage(hWndMSN, WM_COPYDATA, NULL, (LPARAM)&cds); } else { break; } } return true; } //Invoke Sample void CPrjWindowsMessengerTestDlg::OnLButtonDblClk(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default SetWindowsMessengerPersonalInfo("Jackie's Mailer"); CDialog::OnLButtonDblClk(nFlags, point); }