Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.0 KiB

  1. // FastIoView.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "FileSpyApp.h"
  5. #include "FastIoView.h"
  6. #include "global.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CFastIoView
  14. IMPLEMENT_DYNCREATE(CFastIoView, CListView)
  15. CFastIoView::CFastIoView()
  16. {
  17. pFastIoView = (LPVOID) this;
  18. }
  19. CFastIoView::~CFastIoView()
  20. {
  21. }
  22. BEGIN_MESSAGE_MAP(CFastIoView, CListView)
  23. //{{AFX_MSG_MAP(CFastIoView)
  24. ON_WM_KEYDOWN()
  25. //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CFastIoView drawing
  29. void CFastIoView::OnDraw(CDC* pDC)
  30. {
  31. UNREFERENCED_PARAMETER( pDC );
  32. CDocument* pDoc = GetDocument();
  33. // TODO: add draw code here
  34. }
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CFastIoView diagnostics+
  37. #ifdef _DEBUG
  38. void CFastIoView::AssertValid() const
  39. {
  40. CListView::AssertValid();
  41. }
  42. void CFastIoView::Dump(CDumpContext& dc) const
  43. {
  44. CListView::Dump(dc);
  45. }
  46. #endif //_DEBUG
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CFastIoView message handlers
  49. BOOL CFastIoView::PreCreateWindow(CREATESTRUCT& cs)
  50. {
  51. // TODO: Add your specialized code here and/or call the base class
  52. cs.style |= LVS_REPORT | WS_HSCROLL | WS_VSCROLL;
  53. return CListView::PreCreateWindow(cs);
  54. }
  55. void CFastIoView::OnInitialUpdate()
  56. {
  57. CListView::OnInitialUpdate();
  58. // TODO: Add your specialized code here and/or call the base class
  59. //
  60. // Add the list header items
  61. //
  62. GetListCtrl().InsertColumn(0, L"S. No", LVCFMT_LEFT, 50);
  63. GetListCtrl().InsertColumn(1, L"Fast IO Entry", LVCFMT_LEFT, 100);
  64. GetListCtrl().InsertColumn(2, L"FileObject", LVCFMT_LEFT, 75);
  65. GetListCtrl().InsertColumn(3, L"Name", LVCFMT_LEFT, 250);
  66. GetListCtrl().InsertColumn(4, L"Offset", LVCFMT_LEFT, 100);
  67. GetListCtrl().InsertColumn(5, L"Length", LVCFMT_LEFT, 100);
  68. GetListCtrl().InsertColumn(6, L"Wait", LVCFMT_LEFT, 100);
  69. GetListCtrl().InsertColumn(7, L"Process:Thread", LVCFMT_LEFT, 100);
  70. GetListCtrl().InsertColumn(8, L"OrgnTime", LVCFMT_LEFT, 78);
  71. GetListCtrl().InsertColumn(9, L"CompTime", LVCFMT_LEFT, 78);
  72. GetListCtrl().InsertColumn(10, L"Return Status", LVCFMT_LEFT, 100);
  73. }
  74. void CFastIoView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
  75. {
  76. // TODO: Add your message handler code here and/or call default
  77. int ti, oldti;
  78. if (nChar == VK_DELETE)
  79. {
  80. ti = 0;
  81. oldti = 0;
  82. while(ti < GetListCtrl().GetItemCount())
  83. {
  84. if (GetListCtrl().GetItemState(ti, LVIS_SELECTED) & LVIS_SELECTED)
  85. {
  86. GetListCtrl().DeleteItem(ti);
  87. oldti = ti;
  88. }
  89. else
  90. {
  91. ti++;
  92. }
  93. }
  94. if (oldti < GetListCtrl().GetItemCount())
  95. {
  96. GetListCtrl().SetItemState(oldti, LVIS_SELECTED, LVIS_SELECTED);
  97. }
  98. else
  99. {
  100. GetListCtrl().SetItemState(oldti-1, LVIS_SELECTED, LVIS_SELECTED);
  101. }
  102. }
  103. CListView::OnKeyDown(nChar, nRepCnt, nFlags);
  104. }