本文整理汇总了C++中ListView_GetCheckState函数的典型用法代码示例。如果您正苦于以下问题:C++ ListView_GetCheckState函数的具体用法?C++ ListView_GetCheckState怎么用?C++ ListView_GetCheckState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ListView_GetCheckState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ListView_GetItem
void Twindow::lvSwapItems(int id,int i1,int i2)
{
HWND hlv=GetDlgItem(m_hwnd,id);
LVITEM lvi1;
char_t text1[256];
int check1;
lvi1.mask=LVIF_PARAM|LVIF_STATE|LVIF_TEXT;
lvi1.iItem=i1;
lvi1.iSubItem=0;
lvi1.pszText=text1;
lvi1.cchTextMax=256;
ListView_GetItem(hlv,&lvi1);
check1=ListView_GetCheckState(hlv,i1);
LVITEM lvi2;
char_t text2[256];
int check2;
lvi2.mask=LVIF_PARAM|LVIF_STATE|LVIF_TEXT;
lvi2.iItem=i2;
lvi2.iSubItem=0;
lvi2.pszText=text2;
lvi2.cchTextMax=256;
ListView_GetItem(hlv,&lvi2);
check2=ListView_GetCheckState(hlv,i2);
std::swap(lvi1.iItem,lvi2.iItem);
ListView_SetItem(hlv,&lvi1);
ListView_SetCheckState(hlv,i1,check2);
ListView_SetItem(hlv,&lvi2);
ListView_SetCheckState(hlv,i2,check1);
lvSetSelItem(id,i2);
ListView_EnsureVisible(hlv,i2,FALSE);
}
示例2: SetFocus
// Start the specified threads
// [in] AllThreads : If you start all threads, true is to be passed. Otherwize false is passed.
// [out] Result Code
int StkThreadGuiManager::StartThreads(bool AllThreads)
{
if (DlgWndHndl != NULL) {
SetFocus(DlgWndHndl); // TABフォーカスが失われるのを防止する施策
//Disable Start and Stop button.
EnableWindow(GetDlgItem(DlgWndHndl, IDC_START), false);
EnableWindow(GetDlgItem(DlgWndHndl, IDC_STOP), false);
}
// Change the status on GUI.
for (int RowLoop = 0; RowLoop < GetNumOfStkThread(); RowLoop++) {
if (AllThreads == true || ListView_GetCheckState(ListWndHndl, RowLoop) == TRUE) {
if (GetStkThreadStatusByIndex(RowLoop) != STKTHREAD_STATUS_RUNNING) {
ReplaceStatus(RowLoop, STKTHREAD_STATUS_STARTING);
}
}
}
// Does selected thread IDs are stored into Ids[] variable.
int Ids[MAX_NUM_OF_THREADS];
int IdsIndex = 0;
for (int RowLoop = 0; RowLoop < GetNumOfStkThread(); RowLoop++) {
if ((AllThreads == true || ListView_GetCheckState(ListWndHndl, RowLoop) == TRUE) &&
GetStkThreadStatusByIndex(RowLoop) == STKTHREAD_STATUS_READY) {
Ids[IdsIndex] = GetStkThreadIdByIndex(RowLoop);
IdsIndex++;
}
}
// Start selected threads.
StartSpecifiedStkThreads(Ids, IdsIndex);
// When AllThreads is true, check whether all threads are running or not.
// If some threads are not running, wait for the status change.
while (AllThreads) {
bool AllRunning = true;
for (int RowLoop = 0; RowLoop < GetNumOfStkThread(); RowLoop++) {
if (GetStkThreadStatusByIndex(RowLoop) != STKTHREAD_STATUS_RUNNING) {
AllRunning = false;
break;
}
}
if (AllRunning == true) {
break;
} else {
Sleep(100);
}
}
RefreshLog(false);
return 0;
}
示例3: savePage
void GeneralPage::savePage()
{
// option: auto-start server on startup
SettingsManager::getInstance()->setBool(SettingsManager::AUTOSTART,ListView_GetCheckState(m_hListOptions,0));
// option: automatically check for updates
SettingsManager::getInstance()->setBool(SettingsManager::CHECKFORUPDATES,ListView_GetCheckState(m_hListOptions,1));
// option: confirm on application exit
SettingsManager::getInstance()->setBool(SettingsManager::CONFIRMEXIT,ListView_GetCheckState(m_hListOptions,2));
// option: minimize to tray
SettingsManager::getInstance()->setBool(SettingsManager::MINIMIZETOTRAY,ListView_GetCheckState(m_hListOptions,3));
}
示例4: memset
void UserSetupPage::savePage(User *pUser)
{
char sz[255];
memset(sz,0,sizeof(sz));
GetWindowText(m_hEditName,sz,sizeof(sz));
pUser->setName(sz);
if ( !m_newPassword.empty() ) {
pUser->setPassword(m_newPassword.c_str());
}
pUser->setDisabled(Button_GetCheck(m_hCheckDisabled));
std::list<std::string> groupGuids;
int groupsCount = ListView_GetItemCount(m_hListGroups);
for ( int i=0; i<groupsCount; i++ )
{
if ( ListView_GetCheckState(m_hListGroups,i) ) {
Group *pGroup = (Group*)WinUtil::ListViewUtil::getItemParam(m_hListGroups,i);
groupGuids.push_back(pGroup->getGuid());
}
}
pUser->setGroups(groupGuids);
}
示例5: switch
INT_PTR CLAVVideoFormatsProp::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
if (LOWORD(wParam) == IDC_CODECS_MSWMVDMO && HIWORD(wParam) == BN_CLICKED) {
BOOL bValue = (BOOL)SendDlgItemMessage(m_Dlg, LOWORD(wParam), BM_GETCHECK, 0, 0);
if (bValue != m_bWMVDMO) {
SetDirty();
}
} else if (LOWORD(wParam) == IDC_DVD_VIDEO && HIWORD(wParam) == BN_CLICKED) {
BOOL bValue = (BOOL)SendDlgItemMessage(m_Dlg, LOWORD(wParam), BM_GETCHECK, 0, 0);
if (bValue != m_bDVD) {
SetDirty();
}
}
break;
case WM_NOTIFY:
NMHDR *hdr = (LPNMHDR)lParam;
if (hdr->idFrom == IDC_CODECS) {
switch (hdr->code) {
case LVN_ITEMCHANGED:
LPNMLISTVIEW nmlv = (LPNMLISTVIEW)lParam;
BOOL check = ListView_GetCheckState(hdr->hwndFrom, nmlv->iItem);
if (check != m_bFormats[nmlv->iItem]) {
SetDirty();
}
return TRUE;
}
}
break;
}
// Let the parent class handle the message.
return __super::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
}
示例6: GetDlgItem
void OBS::CheckSources()
{
XElement *curSceneElement = App->sceneElement;
XElement *sources = curSceneElement->GetElement(TEXT("sources"));
if(!sources)
return;
HWND hwndSources = GetDlgItem(hwndMain, ID_SOURCES);
UINT numSources = ListView_GetItemCount(hwndSources);
for(UINT i = 0; i < numSources; i++)
{
bool checked = ListView_GetCheckState(hwndSources, i) > 0;
XElement *source =sources->GetElementByID(i);
bool curRender = source->GetInt(TEXT("render"), 0) > 0;
if(curRender != checked)
{
source->SetInt(TEXT("render"), (checked)?1:0);
if(scene && i < scene->NumSceneItems())
{
SceneItem *sceneItem = scene->GetSceneItem(i);
sceneItem->bRender = checked;
sceneItem->SetRender(checked);
}
ReportSourceChanged(source->GetName(), source);
}
}
}
示例7: ListView_MoveItem
int ListView_MoveItem(HWND hwnd , int pos , int newPos) {
char buff [2000];
int cols = Header_GetItemCount(ListView_GetHeader(hwnd));
LVITEM lvi;
lvi.mask = LVIF_IMAGE|LVIF_INDENT|LVIF_PARAM|LVIF_TEXT|LVIF_STATE;
lvi.iItem = pos;
lvi.iSubItem = 0;
lvi.stateMask= (UINT)-1;
lvi.pszText = buff;
lvi.cchTextMax = 2000;
ListView_GetItem(hwnd , &lvi);
int check = ListView_GetCheckState(hwnd , pos);
if (newPos>pos) newPos++; else pos++;
lvi.iItem = newPos;
newPos = ListView_InsertItem(hwnd , &lvi);
ListView_SetCheckState(hwnd , newPos , check);
lvi.mask = LVIF_TEXT;
for (int i=1; i<cols; i++) {
lvi.iSubItem=i;
lvi.iItem=pos;
ListView_GetItem(hwnd , &lvi);
lvi.iItem=newPos;
ListView_SetItem(hwnd , &lvi);
}
// ListView_SetSelectionMark(hwnd , newPos);
ListView_EnsureVisible(hwnd , newPos , 0);
ListView_DeleteItem(hwnd , pos);
return 1;
}
示例8: wxCHECK_MSG
bool wxCheckListBox::IsChecked(unsigned int uiIndex) const
{
wxCHECK_MSG( IsValid( uiIndex ), false,
wxT("invalid index in wxCheckListBox::IsChecked") );
return (ListView_GetCheckState(((HWND)GetHWND()), uiIndex) != 0);
}
示例9: ListView_GetCheckState
bool CListView::IsItemChecked(int Index) const
{
if (m_hwnd==nullptr)
return false;
return ListView_GetCheckState(m_hwnd,Index)!=FALSE;
}
示例10: SetHeaderCheckbox
void CSysLogQuery::SetHeaderCheckbox(void)
{
BOOL fChecked = TRUE;
for(int nItem = 0;nItem < ListView_GetItemCount(m_Syslog_query);nItem++)
{
if(!ListView_GetCheckState(m_Syslog_query,nItem))
{
fChecked = FALSE;
break;
}
}
HWND header = ListView_GetHeader(m_Syslog_query);
HDITEM hdi = {0};
hdi.mask = HDI_FORMAT;
Header_GetItem(header,0,&hdi);
if (fChecked)
{
hdi.fmt |= HDF_CHECKED;
} else
{
hdi.fmt &= ~HDF_CHECKED;
}
Header_SetItem(header, 0, &hdi);
}
示例11: AfxMessageBox
void CDlgNetlist::OnBnClickedButtonEdit()
{
int n_sel = m_list_ctrl.GetSelectedCount();
if( n_sel == 0 )
AfxMessageBox( "You have no net selected" );
else if( n_sel > 1 )
AfxMessageBox( "You have more than one net selected" );
else
{
POSITION pos = m_list_ctrl.GetFirstSelectedItemPosition();
if( pos == NULL )
ASSERT(0);
int nItem = m_list_ctrl.GetNextSelectedItem(pos);
int i = m_list_ctrl.GetItemData( nItem );
// prepare and invoke dialog
CFreePcbView * view = theApp.m_View;
CFreePcbDoc * doc = theApp.m_Doc;
CDlgEditNet dlg;
dlg.Initialize( doc->m_nlist, &nl, i, m_plist, FALSE, ListView_GetCheckState( m_list_ctrl, nItem ),
MIL, &(doc->m_w), &(doc->m_v_w), &(doc->m_v_h_w) );
int ret = dlg.DoModal();
if( ret == IDOK )
{
// implement edits into nl and update m_list_ctrl
DrawListCtrl();
}
}
}
示例12: GetDlgItem
void CContainer::OnColumnDlgOk(HWND hDlg)
{
HWND hListView;
LVITEM lvItem;
list<Column_t> ColumnTempList;
Column_t Column;
int i = 0;
hListView = GetDlgItem(hDlg,IDC_COLUMNS_LISTVIEW);
for(i = 0; i < ListView_GetItemCount(hListView); i++)
{
lvItem.mask = LVIF_PARAM;
lvItem.iItem = i;
lvItem.iSubItem = 0;
ListView_GetItem(hListView,&lvItem);
Column.id = (int)lvItem.lParam;
Column.bChecked = ListView_GetCheckState(hListView,i);
Column.iWidth = DEFAULT_COLUMN_WIDTH;
ColumnTempList.push_back(Column);
}
m_pActiveShellBrowser->ImportColumns(&ColumnTempList,g_bColumnsSwapped);
if(g_bColumnsSwapped)
RefreshTab(m_iObjectIndex);
SelectColumnsSaveState(hDlg);
EndDialog(hDlg,1);
}
示例13: OnSetupOK
BOOL OnSetupOK(HWND hWnd)
{
// リストビューを走査
HWND hWndLV = GetDlgItem(hWnd, IDC_LIST_MAILBOX);
int iCount = ListView_GetItemCount(hWndLV);
char szName[13];
// チェックボックスにチェックが無いものは,メールボックスから削除
for (int i = 0; i < iCount; ++i) {
if (!ListView_GetCheckState(hWndLV, i)) {
ListView_GetItemText(hWndLV, i, 1, szName, sizeof(szName));
g_temporary_mailbox.erase(szName);
}
}
// ini ファイルの MailBoxes セクションをクリア
WritePrivateProfileString("MailBoxes", NULL, NULL, szIni);
common::array array;
for (TMailBox::iterator mailbox = g_temporary_mailbox.begin(); mailbox != g_temporary_mailbox.end(); ++mailbox) {
// ini ファイルに書き込み
WritePrivateProfileString("MailBoxes", ((*mailbox).first).c_str(), (array.join((*mailbox).second, ",")).c_str(), szIni);
}
// メールボックスをコピー
g_mailbox = g_temporary_mailbox;
return true;
}
示例14: ListView_GetCheckState
void CMainFrame::OnLvnItemchangedListGislayer(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
// TODO: Add your control notification handler code here
*pResult = 0;
CListCtrl * pGISLayerList = (CListCtrl *)m_GISLayerBar.GetDlgItem(IDC_LIST_GISLAYER);
// determine which layer is active
POSITION pos = pGISLayerList->GetFirstSelectedItemPosition();
if (pos != NULL)
{
int nItem = pGISLayerList->GetNextSelectedItem(pos);
m_iSelectedLayer = (layer_mode) nItem;
BOOL bChecked = pGISLayerList->GetCheck(nItem);
m_bShowLayerMap[m_iSelectedLayer] = bChecked;
}
// detemine the selection status
if(bLayerInitialized)
{
for(int nItem =0 ; nItem < pGISLayerList->GetItemCount(); nItem++)
{
BOOL bChecked = ListView_GetCheckState(pGISLayerList->m_hWnd,nItem);
m_bShowLayerMap[(layer_mode) nItem] = bChecked;
}
}
pGISLayerList->Invalidate (1);
UpdateAllViews();
}
示例15: UT_return_val_if_fail
BOOL AP_Win32Dialog_CollaborationAccounts::_onNotify(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
LPNMHDR nmhdr = (LPNMHDR)lParam;
UT_return_val_if_fail(nmhdr, false);
switch (nmhdr->code)
{
case LVN_ITEMCHANGED:
// Not sure if LVN_ITEMCHANGED is the best place to check the selection state,
// but I can't find a "selection changed" signal and this works...
if (!m_bPopulating && wParam == AP_RID_DIALOG_COLLABORATIONACCOUNTS_ACCOUNT_LIST)
{
_updateSelection();
LPNMLISTVIEW item = (LPNMLISTVIEW)lParam;
UT_return_val_if_fail(item->iItem >= 0, false);
UT_return_val_if_fail(item->lParam, false);
AccountHandler* pAccount = reinterpret_cast<AccountHandler*>(item->lParam);
bool isChecked = ListView_GetCheckState(m_hAccountList, item->iItem);
_setOnline(pAccount, isChecked);
return true;
}
return false;
default:
return false;
}
}