Операционная система Windows 95 для программиста



    d8ef8794     

Исходные тексты приложения List Application - часть 4


if((dwStyle & LVS_TYPEMASK) != LVS_SMALLICON) SetWindowLong(hwndList, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_SMALLICON); break; }

case ID_OPTIONS_LISTVIEW: { 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: 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; APPLINFO * lpAppinfo = (APPLINFO *)(lpLvdi->item.lParam); static char szBuf[20]; 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 = lpAppinfo->szAppName; break;

case 1: lpLvdi->item.pszText = lpAppinfo->szIconName; break;

case 2: itoa(lpAppinfo->iCost, szBuf, 10); lpLvdi->item.pszText = szBuf; break;

default: break; } break; } }

case LVN_COLUMNCLICK: { ListView_SortItems(lpNm->hdr.hwndFrom, LVCompareProc, (LPARAM)(lpNm->iSubItem)); return 0L; break; }

case LVN_BEGINLABELEDIT: { return 0L; break; }

case LVN_ENDLABELEDIT: { if((lpLvdi->item.iItem != -1) && (lpLvdi->item.pszText != NULL)) lstrcpy(lpAppinfo->szAppName, lpLvdi->item.pszText); return 0L; break; }

case NM_DBLCLK: { int index; LV_ITEM lvi; char szBuf[256];

strcpy(szBuf, "Selected item:\n");




Содержание  Назад  Вперед