本文整理汇总了C++中CListBox::GetItemData方法的典型用法代码示例。如果您正苦于以下问题:C++ CListBox::GetItemData方法的具体用法?C++ CListBox::GetItemData怎么用?C++ CListBox::GetItemData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CListBox
的用法示例。
在下文中一共展示了CListBox::GetItemData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFlags
int DlgGuardFlags::GetFlags()
{
CListBox *lb;
int new_flags = 0;
lb = (CListBox*)GetDlgItem(IDC_GUARD_FLAGS);
for(int i = 0; i < GuardBitCount(); i++)
{
if(lb->GetSel(i))
SET_BIT(new_flags, lb->GetItemData(i));
else
REMOVE_BIT(new_flags, lb->GetItemData(i));
}
return new_flags;
}
示例2: OnKillSocket
void CConnDlg :: OnKillSocket()
{
CWysApp* pApp = (CWysApp*)AfxGetApp();
INT iItem;
CString szTemp;
SCREENLINE sl;
// get the current selection
CWysWnd* pWnd = (CWysWnd*)pApp->m_pMainWnd;
CListBox* pListBox = (CListBox*)GetDlgItem(IDC_LSTCONN);
iItem = pListBox->GetCurSel();
if (iItem == LB_ERR) {
szTemp.LoadString(IDS_NOSEL);
this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
return;
}
// get the socket value
// for currently selected item
SOCKET hSocket;
hSocket = (SOCKET)pListBox->GetItemData(iItem);
if (hSocket == LB_ERR) {
szTemp.LoadString(IDS_SOCKERRLST);
this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
return;
}
szTemp.LoadString(IDS_KILLSOCK);
if (this->MessageBox(szTemp, "Kill Connection", MB_ICONQUESTION |
MB_YESNO | MB_DEFBUTTON2) == IDYES) {
CWySock* pSock = (CWySock*)CAsyncSocket::FromHandle(hSocket);
if (!pSock) {
szTemp.LoadString(IDS_ERRNOSOCK);
this->MessageBox(szTemp, NULL, MB_ICONINFORMATION);
return;
}
// add item to screen list
sl.uColor = COLOR_RED;
szTemp.LoadString(IDS_SERVKILL);
sl.szText.Format(szTemp, pSock->IPAddress);
pWnd->AddListItem(&sl);
// remove socket from array of connected sockets
pSock->Close();
pSock->m_hSocket = INVALID_SOCKET;
pSock->State = FREE;
// refresh list
OnRefresh();
}
return;
}
示例3: OnOK
void CLabelTypeDialog::OnOK()
{
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_LABEL_LIST)) != NULL)
{
int nCurSel = pList->GetCurSel();
if (nCurSel != -1)
{
m_pChosenLabel = (CLabelData*)pList->GetItemData(nCurSel);
}
}
CPmwDialogColor::OnOK();
}
示例4: OnOK
void CEnvelopeTypeDialog::OnOK()
{
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_ENVELOPE_LIST)) != NULL)
{
int nCurSel = pList->GetCurSel();
if (nCurSel != -1)
{
m_pChosenInfo = (CLabelData*)pList->GetItemData(nCurSel);
}
}
CPmwDialogColor::OnOK();
}
示例5: OnSelchangeLabelList
void CLabelTypeDialog::OnSelchangeLabelList()
{
CLabelData* pLabelData = NULL;
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_LABEL_LIST)) != NULL)
{
int nCurSel = pList->GetCurSel();
if (nCurSel != -1)
{
pLabelData = (CLabelData*)pList->GetItemData(nCurSel);
}
}
m_pPreview->SetLabel(pLabelData);
}
示例6: OnSelchangeEnvelopeList
void CEnvelopeTypeDialog::OnSelchangeEnvelopeList()
{
m_pChosenInfo = NULL;
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_ENVELOPE_LIST)) != NULL)
{
int nCurSel = pList->GetCurSel();
if (nCurSel != -1)
{
m_pChosenInfo = (CLabelData*)pList->GetItemData(nCurSel);
}
}
UpdatePreview();
}
示例7: OnSelchangeServerList
//**************************************************************************
void OPCServerDlg::OnSelchangeServerList()
{
CWaitCursor wait;
UpdateData();
CListBox* pList = (CListBox*)GetDlgItem( IDC_SERVER_LIST );
int index = pList->GetCurSel();
OPCServerInfo* pServerInfo = (OPCServerInfo*)pList->GetItemData(index);
if( pServerInfo && (DWORD)pServerInfo != LB_ERR )
{
m_clsid = pServerInfo->m_clsid;
m_Server = pServerInfo->m_ProgID;
}
UpdateData( FALSE );
}
示例8: OnSelchangePhotoProjectsList
void CPhotoProjectsTypeDlg::OnSelchangePhotoProjectsList()
{
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_PHOTOPROJECTS_LIST)) != NULL)
{
int nCurSel = pList->GetCurSel();
if (nCurSel != -1)
{
m_pChosenPhotoProject = (CPhotoPrjData*)pList->GetItemData(nCurSel);
}
}
UpdatePreview();
}
示例9: OnOK
void CPhotoProjectsTypeDlg::OnOK()
{
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_PHOTOPROJECTS_LIST)) != NULL)
{
int nCurSel = pList->GetCurSel();
if (nCurSel != -1)
{
m_pChosenPhotoProject = (CPhotoPrjData*)pList->GetItemData(nCurSel);
int nType = nCurSel;
m_PhotoProjectType = (PHOTO_PROJECT_TYPE)nType;
}
}
CPmwDialogColor::OnOK();
}