当前位置: 首页>>代码示例>>C++>>正文


C++ COptions::GetSyncStatusMsgFlag方法代码示例

本文整理汇总了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;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:88,代码来源:main.cpp


注:本文中的COptions::GetSyncStatusMsgFlag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。