这个控件没有id,case WM_COMMAND 里没法做响应,不知道咋办。
下面是我创建ListView控件代码。
LPSTR pText[2] = { "InfoLog", "ErrLog"};
LVCOLUMN lvc;
int iCol;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
// Add the columns.
for (iCol = 0; iCol < 2/*C_COLUMNS*/; iCol++)
{
lvc.iSubItem = iCol;
lvc.pszText = (LPSTR)pText[iCol];
lvc.cx = 100; // Width of column in pixels.
if ( iCol < 2 )
lvc.fmt = LVCFMT_LEFT; // Left-aligned column.
else
lvc.fmt = LVCFMT_RIGHT; // Right-aligned column.
if (ListView_InsertColumn(hWndListView, iCol, &lvc) == -1)
return FALSE;
}