quicwind/quicwind_proc.c
int quicwind_get_cnx_list(picoquic_quic_t * qclient, HWND hDlg, int list_box_id)
{
    
    // Add items to list. 
    HWND hwndList = GetDlgItem(hDlg, list_box_id);
    picoquic_cnx_t * cnx = picoquic_get_first_cnx(qclient);
    int nb_cnx = 0;
    int pos;

    while (cnx != NULL) {
        int cid = 0;
        for (int x = 0; x < cnx->initial_cnxid.id_len && x < 4; x++) {
            cid <<= 8;
            cid |= cnx->initial_cnxid.id[x];
        }
        pos = (int)SendMessageA(hwndList, LB_ADDSTRING, 0,(LPARAM)cnx->sni);
        SendMessageA(hwndList, LB_SETITEMDATA, pos, (LPARAM)cid);
        nb_cnx++;
        cnx = cnx->next_in_table;
    }

    if (nb_cnx > 0){
        /* Set selection to the first item */
        SendMessageA(hwndList, LB_SETCURSEL, 0, 0);
        /* Set input focus to the list box. */
        SetFocus(hwndList);
    }

    return nb_cnx;
}
/* Get a connection list, at it to the menu item */
Get a connection list, at it to the menu item
Get a connection list at it to the menu item
int quicwind_get_cnx_list(picoquic_quic_t * qclient, HWND hDlg, int list_box_id)
{
    HWND hwndList = GetDlgItem(hDlg, list_box_id);
    picoquic_cnx_t * cnx = picoquic_get_first_cnx(qclient);
    int nb_cnx = 0;
    int pos;
    while (cnx != NULL) {
        int cid = 0;
        for (int x = 0; x < cnx->initial_cnxid.id_len && x < 4; x++) {
            cid <<= 8;
            cid |= cnx->initial_cnxid.id[x];
        }
        pos = (int)SendMessageA(hwndList, LB_ADDSTRING, 0,(LPARAM)cnx->sni);
        SendMessageA(hwndList, LB_SETITEMDATA, pos, (LPARAM)cid);
        nb_cnx++;
        cnx = cnx->next_in_table;
    }
    if (nb_cnx > 0){
        SendMessageA(hwndList, LB_SETCURSEL, 0, 0);
        SetFocus(hwndList);
    }
    return nb_cnx;
}
int quicwind_get_cnx_list ( picoquic_quic_t * qclient , HWND hDlg , int list_box_id ) { HWND hwndList = GetDlgItem ( hDlg , list_box_id ) ; picoquic_cnx_t * cnx = picoquic_get_first_cnx ( qclient ) ; int nb_cnx = 0 ; int pos ; while ( cnx != NULL ) { int cid = 0 ; for ( int x = 0 ; x < cnx -> initial_cnxid . id_len && x < 4 ; x ++ ) { cid <<= 8 ; cid |= cnx -> initial_cnxid . id [ x ] ; } pos = ( int ) SendMessageA ( hwndList , LB_ADDSTRING , 0 , ( LPARAM ) cnx -> sni ) ; SendMessageA ( hwndList , LB_SETITEMDATA , pos , ( LPARAM ) cid ) ; nb_cnx ++ ; cnx = cnx -> next_in_table ; } if ( nb_cnx > 0 ) { SendMessageA ( hwndList , LB_SETCURSEL , 0 , 0 ) ; SetFocus ( hwndList ) ; } return nb_cnx ; }
Get a connection list, at it to the menu item
Get a connection list at it to the menu item
// Add items to list.  /* Set selection to the first item */ /* Set input focus to the list box. */