2.怎么根据这7个按钮的点击来执行相应得函数?
BOOL CFileOpt::InitListViewColumns(HWND hWndListView)
{
WCHAR szText[256] = L"abc"; // Temporary buffer.
LVCOLUMN lvc;
int iCol;
// Initialize the LVCOLUMN structure.
// The mask specifies that the format, width, text,
// and subitem members of the structure are valid.
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
// Add the columns.
for (iCol = 0; iCol < 7/*C_COLUMNS*/; iCol++)
{
lvc.iSubItem = iCol;
lvc.pszText = (LPSTR)szText;
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.
// Load the names of the column headings from the string resources.
LoadString(m_hInst,
/*IDS_FIRSTCOLUMN*/NULL + iCol,
(LPSTR)szText,
sizeof(szText)/sizeof(szText[0]));
// Insert the columns into the list view.
if (ListView_InsertColumn(hWndListView, iCol, &lvc) == -1)
return FALSE;
}
return TRUE;
}