deadcode.cpp
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 2k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. // CODE WHICH I REMOVED BUT THAT I'M AFRAID TO THROW AWAY IN CASE I NEED IT
  2. //
  3. // NOT IN THE BUILD
  4.  
  5.  
  6. /*++ CPerfPage::DrawLegend
  7. Routine Description:
  8.     Draws the legend on the performance page
  9. Arguments:
  10.     lpdi    - LPDRAWITEMSTRUCT describing area we need to paint
  11. Return Value:
  12. Revision History:
  13.       Jan-18-95 Davepl  Created
  14. --*/
  15. void CPerfPage::DrawLegend(LPDRAWITEMSTRUCT lpdi)
  16. {
  17.           int xPos    = 10;     // X pos for drawing
  18.     const int yLine   = 6;      // Y pos for drawing the lines
  19.     const int yText   = 0;      // Y pos for drawing the text
  20.     const int LineLen = 10;     // Length of legend lines
  21.     FillRect(lpdi->hDC, &lpdi->rcItem, (HBRUSH) GetStockObject(GRAPH_BRUSH));
  22.     SetBkColor(lpdi->hDC, RGB(0,0,0));
  23.     SetTextColor(lpdi->hDC, aColors[MEM_PEN]);
  24.     SelectObject(lpdi->hDC, m_hPens[MEM_PEN]);
  25.     MoveToEx(lpdi->hDC, xPos, yLine, (LPPOINT) NULL);
  26.     xPos += LineLen;
  27.     LineTo(lpdi->hDC, xPos, yLine);
  28.     xPos += 5;
  29.     xPos = TextToLegend(lpdi->hDC, xPos, yText, g_szMemUsage) + 10;
  30.     {
  31.         static const LPCTSTR pszLabels[2] = { g_szTotalCPU, g_szKernelCPU };
  32.         for (int i = 0; i < 2; i++)
  33.         {
  34.             SetTextColor(lpdi->hDC, aColors[i]);
  35.             SelectObject(lpdi->hDC, m_hPens[i]);
  36.             MoveToEx(lpdi->hDC, xPos, yLine, (LPPOINT) NULL);
  37.             xPos += LineLen;
  38.             LineTo(lpdi->hDC, xPos, yLine);
  39.             xPos += 5;
  40.             xPos = TextToLegend(lpdi->hDC, xPos, yText, pszLabels[i]) + 10;
  41.             // Don't both with the kernel legend unless needed
  42.             if (FALSE == g_Options.m_fKernelTimes)
  43.             {
  44.                 break;
  45.             }
  46.         }
  47.     }
  48. }