Windows NT ( 2)




- 6


{

dwStyle = GetWindowLong(hwndList, GWL_STYLE);

if((dwStyle & LVS_TYPEMASK) != LVS_LIST)

SetWindowLong(hwndList, GWL_STYLE,

(dwStyle & ~LVS_TYPEMASK) | LVS_LIST);

break;

}

case ID_OPTIONS_REPORTVIEW:

{

dwStyle = GetWindowLong(hwndList, GWL_STYLE);

if((dwStyle & LVS_TYPEMASK) != LVS_REPORT)

SetWindowLong(hwndList, GWL_STYLE,

(dwStyle & ~LVS_TYPEMASK) | LVS_REPORT);

break;

}

case ID_FILE_EXIT:

PostQuitMessage(0);

return 0L;

break;

case ID_HELP_ABOUT:

MessageBox(hWnd,

"Disk Information Browser\n"

"(C) Alexandr Frolov, 1996\n"

"Email: frolov@glas.apc.org",

szAppTitle, MB_OK | MB_ICONINFORMATION);

break;

default:

break;

}

return FORWARD_WM_COMMAND(hWnd, id, hwndCtl, codeNotify,

DefWindowProc);

}

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

// WndProc_OnNotify

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

LRESULT WndProc_OnNotify(HWND hWnd, int idFrom, NMHDR* pnmhdr)

{

LV_DISPINFO * lpLvdi = (LV_DISPINFO *)pnmhdr;

DISKINFO* lpDiskInfo = (DISKINFO *)(lpLvdi->item.lParam);

static char szBuf[20];

DWORD dwSectors, dwClusters, dwFreeClusters, dwBytes;

NM_LISTVIEW *lpNm = (NM_LISTVIEW *)pnmhdr;

if(idFrom != IDC_LISTVIEW)

return 0L;

switch(pnmhdr->code)

{

case LVN_GETDISPINFO:

{

if(lpLvdi->item.mask & LVIF_TEXT)

{

switch(lpLvdi->item.iSubItem)

{

case 0:

lpLvdi->item.pszText = lpDiskInfo->szDriveName;

break;

case 1:

lpLvdi->item.pszText = lpDiskInfo->szVolumeName;

break;

case 2:

lpLvdi->item.pszText =

lpDiskInfo->szFileSystemName;