- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
int CALLBACK ZDll::Compare(ZDll* p, ZDll* q, LPARAM lParamSort)
{
ULONG_PTR a, b;
int s = GET_Y_LPARAM(lParamSort) ? -1 : +1;
switch (GET_X_LPARAM(lParamSort))
{
default: __assume(false);
case 0:
a = p->_index, b = q->_index;
break;
case 1:
a = (ULONG_PTR)p->_BaseOfDll, b = (ULONG_PTR)q->_BaseOfDll;
break;
case 2:
a = p->_SizeOfImage, b = q->_SizeOfImage;
break;
case 3:
PCWSTR pa = p->_ImageName, pb = q->_ImageName;
if (!pa) return -s;
if (!pb) return +s;
return _wcsicmp(pa, pb)*s;
}
if (a < b) return -s;
if (a > b) return +s;
return 0;
}
INT_PTR ZModulesDlg::DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == IDC_LIST1)
{
LVITEM lvi;
switch (((LPNMHDR)lParam)->code)
{
case LVN_COLUMNCLICK:
if ((DWORD)(lvi.iSubItem = ((LPNMLISTVIEW)lParam)->iSubItem) < 4)
{
ListView_SortItems(((LPNMHDR)lParam)->hwndFrom, ZDll::Compare,
MAKELPARAM(lvi.iSubItem, _bittestandcomplement(&_SortOrder, lvi.iSubItem)));
}
break;
case LVN_GETINFOTIP:
lvi.iItem = ((LPNMLVGETINFOTIP)lParam)->iItem;
lvi.mask = LVIF_PARAM;
if (ListView_GetItem(((LPNMHDR)lParam)->hwndFrom, &lvi))
{
if (PWSTR ImagePath = ((ZDll*)lvi.lParam)->_ImagePath)
{
if (DWORD n = ((LPNMLVGETINFOTIP)lParam)->cchTextMax)
{
WCHAR *pszText = ((LPNMLVGETINFOTIP)lParam)->pszText, c;
do
{
*pszText++ = c = *ImagePath++;
} while (c && --n);
if (c)
{
pszText[-1] = 0;
}
}
}
}
break;
}
}
break;
Комментарии (0) RSS
Добавить комментарий