LB_GETCURSEL和LB_GETTEXT的使用

case IDC_LIST1:
            {
                switch (HIWORD(wParam)) 
                { 
                case LBN_DBLCLK:
                    {
                        HWND hwndList = GetDlgItem(hDlg, IDC_LIST1); 

                        // Get selected index.
                        int lbItem = (int)SendMessage(hwndList, LB_GETCURSEL, 0, 0); 

                        // display item's text 
                        TCHAR buff[MAX_PATH];
                        SendMessage(hwndList, LB_GETTEXT, lbItem, (LPARAM)buff);

                        SetDlgItemText(hDlg, IDC_EDIT1, buff); 
                        return TRUE; 
                    } 
                }
            }
            return TRUE;

左键双击后,获取控件的名称

上一篇:举报检举IDC骗子


下一篇:六、传统IDC部署网站