本文整理汇总了C++中Protocol::GetStatusMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ Protocol::GetStatusMsg方法的具体用法?C++ Protocol::GetStatusMsg怎么用?C++ Protocol::GetStatusMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Protocol
的用法示例。
在下文中一共展示了Protocol::GetStatusMsg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SendMessage(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), EM_LIMITTEXT, MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE - 1, 0);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), StatusMsgEditSubclassProc);
return TRUE;
case WMU_SETDATA:
{
SetStatusMessageData *data = (SetStatusMessageData *) malloc(sizeof(SetStatusMessageData));
data->status = (int)wParam;
data->proto_num = (int)lParam;
SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) data);
if (data->proto_num >= 0) {
Protocol *proto = protocols->Get(data->proto_num);
HICON hIcon = (HICON)CallProtoService(proto->name, PS_LOADICON, PLI_PROTOCOL, 0);
if (hIcon != NULL) {
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
DestroyIcon(hIcon);
}
TCHAR title[256];
mir_sntprintf(title, SIZEOF(title), TranslateT("Set My Status Message for %s"), proto->description);
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, proto->GetStatusMsg());
}
else if (data->status != 0)
{
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(Status2SkinIcon(data->status)));
TCHAR title[256];
mir_sntprintf(title, SIZEOF(title), TranslateT("Set My Status Message for %s"),
CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, data->status, GSMDF_TCHAR));
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg(data->status));
}
else
{
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg());
}
return TRUE;
}
case WM_COMMAND:
switch(wParam) {
case IDOK:
{
TCHAR tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, sizeof(tmp));
SetStatusMessageData *data = (SetStatusMessageData *) GetWindowLong(hwndDlg, GWLP_USERDATA);
if (data->proto_num >= 0)
protocols->Get(data->proto_num)->SetStatusMsg(tmp);
else if (data->status == 0)
protocols->SetStatusMsgs(tmp);
else
protocols->SetStatusMsgs(data->status, tmp);
DestroyWindow(hwndDlg);
}
break;
case IDCANCEL:
DestroyWindow(hwndDlg);
break;
}
break;
case WM_CLOSE:
DestroyWindow(hwndDlg);
break;
case WM_DESTROY:
SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_WNDPROC,
GetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_USERDATA));
free((SetStatusMessageData *) GetWindowLong(hwndDlg, GWLP_USERDATA));
InterlockedExchange(&status_msg_dialog_open, 0);
break;
}
return FALSE;
}
示例2: if
static BOOL CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch ( msg )
{
case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
SendMessage(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), EM_LIMITTEXT,
MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE - 1, 0);
WNDPROC old_proc = (WNDPROC) SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE),
GWL_WNDPROC, (LONG) StatusMsgEditSubclassProc);
SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWL_USERDATA, (long) old_proc);
return TRUE;
}
case WMU_SETDATA:
{
SetStatusMessageData *data = (SetStatusMessageData *) malloc(sizeof(SetStatusMessageData));
data->status = (int)wParam;
data->proto_num = (int)lParam;
SetWindowLong(hwndDlg, GWL_USERDATA, (LONG) data);
if (data->proto_num >= 0)
{
Protocol proto = GetProtocolByIndex(data->proto_num);
HICON hIcon = (HICON) proto.Call(PS_LOADICON, PLI_PROTOCOL);
if (hIcon != NULL)
{
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
DestroyIcon(hIcon);
}
char title[256];
mir_snprintf(title, sizeof(title), Translate("Set My Status Message for %s"),
proto.GetDescription());
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, proto.GetStatusMsg());
}
else if (data->status != 0)
{
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(Status2SkinIcon(data->status)));
char title[256];
mir_snprintf(title, sizeof(title), Translate("Set My Status Message for %s"),
CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, data->status, 0));
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg(data->status));
}
else
{
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg());
}
return TRUE;
}
case WM_COMMAND:
switch(wParam)
{
case IDOK:
{
char tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, sizeof(tmp));
SetStatusMessageData *data = (SetStatusMessageData *) GetWindowLong(hwndDlg, GWL_USERDATA);
if (data->proto_num >= 0)
GetProtocolByIndex(data->proto_num).SetStatusMsg(tmp);
else if (data->status == 0)
protocols->SetStatusMsgs(tmp);
else
protocols->SetStatusMsgs(data->status, tmp);
// To force a refresh
UpdateFrameData();
DestroyWindow(hwndDlg);
break;
}
case IDCANCEL:
{
DestroyWindow(hwndDlg);
break;
}
}
break;
case WM_CLOSE:
DestroyWindow(hwndDlg);
break;
case WM_DESTROY:
//.........这里部分代码省略.........