[MFC] Odczyt state (ptaszek) dla CListCtrl

0

Witam.

Mam liste CListCtrl z kolumnami czyli w stylu REPORT (nazwy kolumn widoczne), włączone style:

	........SetExtendedStyle(LVS_EX_CHECKBOXES |LVS_EX_HEADERDRAGDROP );

czyli można Drag-Drop'ować miejscami kolumny, oraz w pierwszej kolumnie jest CheckBox (ptaszek).

No i jak odczytać stan tego CheckBox (ptaszka) z dowolnej linii ?

robię tak:


//obsługa: NM_CLICK

	UINT uMask = LVIF_TEXT | LVIF_IMAGE | LVIF_INDENT | LVIF_PARAM  | LVIF_STATE;

	char szBuffer1[1000];

	LVITEM lvi1;

	lvi1.pszText = szBuffer1;
	lvi1.cchTextMax  = sizeof(szBuffer1);
	lvi1.mask = uMask;
	lvi1.stateMask=(UINT) -1;
	lvi1.iSubItem= 0;
	lvi1.iItem=     // numer linii od 1 do ostatnia;


	.......GetItem(&lvi1);

i w lvi1.state mam dziwne wyniki 4099 albo 8195 (czyli +/- 4096) - dlaczego ?

0

http://msdn2.microsoft.com/en-us/library/bb774760(VS.85).aspx

state
Indicates the item's state, state image, and overlay image. The stateMask member indicates the valid bits of this member. Bits 0 through 7 of this member contain the item state flags. This can be one or more of the item state values. Bits 8 through 11 of this member specify the one-based overlay

to chyba wiele mowi:) zas w http://msdn2.microsoft.com/en-us/library/bb774732.aspx wyraznie pisza, ze nie tedy droga

You can obtain the state of the check box for a given item with ListView_GetCheckState. To set the check state, use ListView_SetCheckState

1 użytkowników online, w tym zalogowanych: 0, gości: 1