Windows NT ( 2)




- 5


lvi.iSubItem = 0;

lvi.cchTextMax = 40;

lvi.lParam = (LPARAM)(pdi + i)->szDriveName;

lvi.iImage = (pdi + i)->iImage;

ListView_InsertItem(hwndList, &lvi);

lvi.iItem = i;

lvi.iSubItem = 1;

ListView_InsertItem(hwndList, &lvi);

lvi.iItem = i;

lvi.iSubItem = 2;

ListView_InsertItem(hwndList, &lvi);

lvi.iItem = i;

lvi.iSubItem = 3;

ListView_InsertItem(hwndList, &lvi);

lvi.iItem = i;

lvi.iSubItem = 4;

ListView_InsertItem(hwndList, &lvi);

lvi.iItem = i;

lvi.iSubItem = 5;

ListView_InsertItem(hwndList, &lvi);

}

return TRUE;

}

// -----------------------------------------------------

// WndProc_OnDestroy

// -----------------------------------------------------

#pragma warning(disable: 4098)

void WndProc_OnDestroy(HWND hWnd)

{

DestroyWindow(hwndList);

//

free(lpLogicalDriveStrings);

free(pdi);

PostQuitMessage(0);

return 0L;

}

// -----------------------------------------------------

// WndProc_OnCommand

// -----------------------------------------------------

#pragma warning(disable: 4098)

void WndProc_OnCommand(HWND hWnd, int id,

HWND hwndCtl, UINT codeNotify)

{

DWORD dwStyle = 0;

switch (id)

{

case ID_OPTIONS_ICONVIEW:

{

dwStyle = GetWindowLong(hwndList, GWL_STYLE);

if((dwStyle & LVS_TYPEMASK) != LVS_ICON)

SetWindowLong(hwndList, GWL_STYLE,

(dwStyle & ~LVS_TYPEMASK) | LVS_ICON);

break;

}

case ID_OPTIONS_SMALLICONVIEW:

{

dwStyle = GetWindowLong(hwndList, GWL_STYLE);

if((dwStyle & LVS_TYPEMASK) != LVS_SMALLICON)

SetWindowLong(hwndList, GWL_STYLE,

(dwStyle & ~LVS_TYPEMASK) | LVS_SMALLICON);

break;

}

case ID_OPTIONS_LISTVIEW: