本文整理汇总了C++中COptions::GetSyncStatusMsgFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ COptions::GetSyncStatusMsgFlag方法的具体用法?C++ COptions::GetSyncStatusMsgFlag怎么用?C++ COptions::GetSyncStatusMsgFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COptions
的用法示例。
在下文中一共展示了COptions::GetSyncStatusMsgFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkypeAPI_WindowProc
LRESULT APIENTRY SkypeAPI_WindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
{
LRESULT lReturnCode = 0;
bool bIssueDefProc = false;
switch (msg) {
case WM_DESTROY:
g_wndMainWindow = NULL;
break;
case WM_COPYDATA:
break;
default:
if (msg == g_MsgIDSkypeControlAPIAttach) {
switch (lp) {
case SKYPECONTROLAPI_ATTACH_SUCCESS:
{
CStatusInfo si;
{
mir_cslock guard(g_csStatusInfo);
si = g_CurrStatusInfo;
}
if (INVALID_INDEX != si.StatusIndex() && si.StatusIndex() < _countof(g_aStatusCode)) {
const CMirandaStatus2SkypeStatus& ms = g_aStatusCode[si.StatusIndex()];
HWND wndSkypeAPIWindow = reinterpret_cast<HWND>(wp);
enum { BUFFER_SIZE = 256 };
char szSkypeCmd[BUFFER_SIZE];
const char szSkypeCmdSetStatus[] = "SET USERSTATUS ";
::strncpy_s(szSkypeCmd, szSkypeCmdSetStatus, sizeof(szSkypeCmdSetStatus) / sizeof(szSkypeCmdSetStatus[0]));
::strncat_s(szSkypeCmd, ms.m_pszSkypeStatus, _countof(szSkypeCmd) - mir_strlen(szSkypeCmd));
DWORD cLength = static_cast<DWORD>(mir_strlen(szSkypeCmd));
COPYDATASTRUCT oCopyData;
oCopyData.dwData = 0;
oCopyData.lpData = szSkypeCmd;
oCopyData.cbData = cLength + 1;
SendMessage(wndSkypeAPIWindow, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&oCopyData);
if (g_Options.GetSyncStatusMsgFlag()) {
TCHAR* pszStatusMsg = NULL;
if (ProtoServiceExists(si.Module(), PS_GETMYAWAYMSG))
pszStatusMsg = reinterpret_cast<TCHAR*>(CallProtoService(si.Module(), PS_GETMYAWAYMSG, (WPARAM)ms.m_nMirandaStatus, SGMA_TCHAR));
if ((NULL == pszStatusMsg) || (CALLSERVICE_NOTFOUND == INT_PTR(pszStatusMsg)))
pszStatusMsg = reinterpret_cast<TCHAR*>(CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)ms.m_nMirandaStatus, 0));
if (pszStatusMsg && reinterpret_cast<LPARAM>(pszStatusMsg) != CALLSERVICE_NOTFOUND) {
T2Utf pMsg(pszStatusMsg);
mir_free(pszStatusMsg);
const char szSkypeCmdSetStatusMsg[] = "SET PROFILE MOOD_TEXT ";
::strncpy_s(szSkypeCmd, szSkypeCmdSetStatusMsg, sizeof(szSkypeCmdSetStatusMsg) / sizeof(szSkypeCmdSetStatusMsg[0]));
::strncat_s(szSkypeCmd, pMsg, _countof(szSkypeCmd) - mir_strlen(szSkypeCmd));
oCopyData.dwData = 0;
oCopyData.lpData = szSkypeCmd;
oCopyData.cbData = static_cast<DWORD>(mir_strlen(szSkypeCmd)) + 1;
SendMessage(wndSkypeAPIWindow, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&oCopyData);
}
}
}
}
break;
case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION:
break;
case SKYPECONTROLAPI_ATTACH_REFUSED:
break;
case SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE:
break;
case SKYPECONTROLAPI_ATTACH_API_AVAILABLE:
break;
}
lReturnCode = 1;
}
else bIssueDefProc = true;
break;
}
if (true == bIssueDefProc)
lReturnCode = DefWindowProc(hWnd, msg, wp, lp);
return lReturnCode;
}