0

I have code like this and I get 2 errors:

  • " [Error] 'LVS_EX_FULLROWSELECT' was not declared in this scope "
  • " [Error] 'ListView_SetExtendedListViewStyle' was not declared in this scope "

I've tried to define it like this: "#define LVS_EX_FULLROWSELECT 32", but it doesn't work:(

Code as below:

    if(LOWORD( wParam ) == 103 ){
GetClientRect( hwnd, & rcl );
HWND hListView = CreateWindowEx( 0, WC_LISTVIEW, NULL, WS_CHILD | WS_VISIBLE | LVS_REPORT |
LVS_EDITLABELS, 0, 200, rcl.right - rcl.left, 300,
hwnd,( HMENU ) 1000, hInstance, NULL );


ListView_SetExtendedListViewStyle( hListView, LVS_EX_FULLROWSELECT );
//POCZĄTEK NAZW KOLUMN
lvc.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;


lvc.iSubItem = 0;
lvc.cx = 200;
lvc.pszText = "Player";
ListView_InsertColumn( hListView, 0, & lvc );

lvc.iSubItem = 1;
lvc.cx = 100;
lvc.pszText = "Number of games";
ListView_InsertColumn( hListView, 1, & lvc );

lvc.iSubItem = 2;
lvc.cx = 60;
lvc.pszText = "In game";
ListView_InsertColumn( hListView, 2, & lvc );


//KONIEC NAZW KOLUMN


//POCZĄTEK DODAWANIA ZAWARTOŚCI


lvi.mask = LVIF_TEXT;

for (int i=0; i<1000; i++) {
ostringstream i1a;
i1a << i;
string i1b = i1a.str();

TCHAR *player=new TCHAR[i1b.size()+1];
player[i1b.size()]=0;
copy(i1b.begin(),i1b.end(),player);

lvi.iItem = i;
lvi.pszText = player;
lvi.iSubItem = 0;
ListView_InsertItem( hListView, & lvi );




ListView_SetItemText( hListView, 0, 1, "15" );
ListView_SetItemText( hListView, 0, 2, "3" );
ListView_SetItemText( hListView, 1, 1, "15" );
ListView_SetItemText( hListView, 1, 2, "6" );
}

break;
}
4

1 回答 1

0
#define _WIN32_IE 0x0300

这对我有用

于 2018-05-20T12:29:28.097 回答