-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathListbox.cpp
More file actions
53 lines (40 loc) · 1.31 KB
/
Copy pathListbox.cpp
File metadata and controls
53 lines (40 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
void CRTUClientDlg::OnItemChangedListip(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
if (m_stationSet.IsInited())
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// int i=pNMListView->iItem;
// char szrow[2];
// itoa(1,szrow,10);
// AfxMessageBox(szrow);
if (pNMListView->uOldState == 0 && pNMListView->uNewState == 0)
return; // No change
// Old check box state
BOOL bPrevState = (BOOL)(((pNMListView->uOldState &
LVIS_STATEIMAGEMASK)>>12)-1);
if (bPrevState < 0) // On startup there's no previous state
bPrevState = 0; // so assign as false (unchecked)
// New check box state
BOOL bChecked =
(BOOL)(((pNMListView->uNewState &LVIS_STATEIMAGEMASK)>>12)-1);
if (bChecked < 0) // On non-checkbox notifications assume false
bChecked = 0;
if (bPrevState == bChecked) // No change in check box
return; // Now bChecked holds the new check box state
//pNMListView->iItem ÐÐ
//pNMListView->iSubItemÁÐ
//m_ListIP.GetItemText()
if (bChecked)
{
//AfxMessageBox("check ");
m_stationSet.SelectOne(pNMListView->iItem);
}
else
{
//AfxMessageBox("check ");
m_stationSet.UnSelectOne(pNMListView->iItem);//,TRUE);
}
}
*pResult = 0;
}