本文整理汇总了C++中PINGLIST::start方法的典型用法代码示例。如果您正苦于以下问题:C++ PINGLIST::start方法的具体用法?C++ PINGLIST::start怎么用?C++ PINGLIST::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PINGLIST
的用法示例。
在下文中一共展示了PINGLIST::start方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PingDisableAll
INT_PTR PingDisableAll(WPARAM wParam, LPARAM lParam) {
PINGLIST pl;
CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for(PINGLIST::Iterator i = pl.start(); i.has_val(); i.next()) {
i.val().status = PS_DISABLED;
i.val().miss_count = 0;
}
CallService(PLUG "/SetPingList", (WPARAM)&pl, 0);
return 0;
}
示例2: PingEnableAll
INT_PTR PingEnableAll(WPARAM wParam, LPARAM lParam) {
PINGLIST pl;
CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for(PINGLIST::Iterator i = pl.start(); i.has_val(); i.next()) {
if(i.val().status == PS_DISABLED) {
i.val().status = PS_NOTRESPONDING;
}
}
CallService(PLUG "/SetPingList", (WPARAM)&pl, 0);
return 0;
}
示例3: DblClick
INT_PTR DblClick(WPARAM wParam, LPARAM lParam) {
PINGLIST pl;
CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for(PINGLIST::Iterator i = pl.start(); i.has_val(); i.next()) {
if(i.val().item_id == (DWORD)wParam) {
if(strlen(i.val().pszCommand)) {
ShellExecute(0, "open", i.val().pszCommand, i.val().pszParams, 0, SW_SHOW);
} else {
return CallService(PLUG "/ToggleEnabled", wParam, 0);
}
}
}
return 0;
}
示例4: ToggleEnabled
INT_PTR ToggleEnabled(WPARAM wParam, LPARAM lParam) {
int retval = 0;
PINGLIST pl;
CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for(PINGLIST::Iterator i = pl.start(); i.has_val(); i.next()) {
if(i.val().item_id == (DWORD)wParam) {
if(i.val().status == PS_DISABLED)
i.val().status = PS_NOTRESPONDING;
else {
i.val().status = PS_DISABLED;
i.val().miss_count = 0;
retval = 1;
}
}
}
CallService(PLUG "/SetPingList", (WPARAM)&pl, 0);
return 0;
}
示例5: EditContact
INT_PTR EditContact(WPARAM wParam, LPARAM lParam) {
PINGLIST pl;
HWND hwndList = (HWND)CallService(MS_CLUI_GETHWND, 0, 0);
CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for(PINGLIST::Iterator i = pl.start(); i.has_val(); i.next()) {
if(i.val().item_id == (DWORD)wParam) {
add_edit_addr = i.val();
if(DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG3), hwndList, DlgProcDestEdit) == IDOK) {
i.val() = add_edit_addr;
CallService(PLUG "/SetAndSavePingList", (WPARAM)&pl, 0);
return 0;
}
}
}
return 1;
}
示例6: GetDlgItem
// ping hosts list window
static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
//OPENFILENAME ofn = {0};
HWND hw;
int sel;
switch ( msg ) {
case WM_INITDIALOG:
{
TranslateDialogDefault( hwndDlg );
Lock(&data_list_cs, "init options dialog");
temp_list = data_list;
Unlock(&data_list_cs);
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
for(PINGLIST::Iterator i = temp_list.start(); i.has_val(); i.next()) {
int index = SendMessage(hw, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)i.val().pszLabel);
SendMessage(hw, LB_SETITEMDATA, index, (LPARAM)&i.val());
}
}
return TRUE;
case WM_COMMAND:
if (HIWORD( wParam ) == LBN_SELCHANGE && LOWORD(wParam) == IDC_LST_DEST) {
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
sel = SendMessage(hw, LB_GETCURSEL, 0, 0);
if(sel != LB_ERR) {
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTREM);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTEDIT);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTUP);
EnableWindow(hw, (sel > 0));
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
int count = SendMessage(hw, LB_GETCOUNT, 0, 0);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTDOWN);
EnableWindow(hw, (sel < count - 1));
}
}
if ( HIWORD( wParam ) == BN_CLICKED ) {
switch( LOWORD( wParam )) {
case IDC_BTN_DESTEDIT:
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
sel = SendMessage(hw, LB_GETCURSEL, 0, 0);
if(sel != LB_ERR) {
PINGADDRESS *item = (PINGADDRESS *)SendMessage(hw, LB_GETITEMDATA, sel, 0);
PINGADDRESS temp = *item;
if(Edit(hwndDlg, temp)) {
*item = temp;
SendMessage(hw, LB_DELETESTRING, (WPARAM)sel, (LPARAM)0);
SendMessage(hw, LB_INSERTSTRING, (WPARAM)sel, (LPARAM)item->pszLabel);
SendMessage(hw, LB_SETITEMDATA, (WPARAM)sel, (LPARAM)item);
SendMessage(hw, LB_SETCURSEL, (WPARAM)sel, 0);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTREM);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTEDIT);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTUP);
EnableWindow(hw, sel > 0);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTDOWN);
int count = SendMessage(hw, LB_GETCOUNT, 0, 0);
EnableWindow(hw, (sel < count - 1));
SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
}
}
break;
case IDC_BTN_DESTADD:
memset(&add_edit_addr,0,sizeof(add_edit_addr));
add_edit_addr.cbSize = sizeof(add_edit_addr);
add_edit_addr.port = -1;
add_edit_addr.set_status = ID_STATUS_ONLINE;
add_edit_addr.get_status = ID_STATUS_OFFLINE;
add_edit_addr.status = PS_NOTRESPONDING;
add_edit_addr.item_id = 0;
if(DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG3), hwndDlg, DlgProcDestEdit) == IDOK) {
temp_list.add(add_edit_addr);
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
int index = SendMessage(hw, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)add_edit_addr.pszLabel);
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
SendMessage(hw, LB_SETCURSEL, (WPARAM)index, 0);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTREM);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTEDIT);
EnableWindow(hw, TRUE);
sel = temp_list.size() - 1;
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTUP);
EnableWindow(hw, (sel > 0));
//.........这里部分代码省略.........