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.

44 lines
1.4 KiB

  1. // LastErrorWin.h: interface for the CLastErrorWin class.
  2. // Implements the subclassed static control for the common prop page
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_LASTERRORWIN_H__A23AB1D9_684C_48D4_A9D1_FD3DCEBD9D5B__INCLUDED_)
  5. #define AFX_LASTERRORWIN_H__A23AB1D9_684C_48D4_A9D1_FD3DCEBD9D5B__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "resource.h" // main symbols
  10. class CLastErrorWin :
  11. public CWindowImpl<CLastErrorWin>
  12. {
  13. public:
  14. CLastErrorWin();
  15. virtual ~CLastErrorWin();
  16. BEGIN_MSG_MAP(CLastErrorWin)
  17. MESSAGE_HANDLER( OCM_CTLCOLORSTATIC, OnCtlColor )
  18. DEFAULT_REFLECTION_HANDLER ()
  19. END_MSG_MAP()
  20. LRESULT OnCtlColor( UINT, WPARAM wParam, LPARAM, BOOL& )
  21. {
  22. // notify bit must be set to get STN_* notifications
  23. ModifyStyle( 0, SS_NOTIFY );
  24. LOGBRUSH lb =
  25. {
  26. BS_SOLID,//style
  27. GetSysColor (COLOR_3DFACE),//color
  28. 0//hatch
  29. };
  30. //make sure we're not leaking the process resources
  31. static HBRUSH hBrNormal = CreateBrushIndirect (&lb);
  32. HDC dc = reinterpret_cast <HDC> (wParam);
  33. SetTextColor (dc, RGB(255, 0, 0));
  34. SetBkColor (dc, GetSysColor (COLOR_3DFACE));
  35. return reinterpret_cast <LRESULT> (hBrNormal);
  36. }
  37. };
  38. #endif // !defined(AFX_LASTERRORWIN_H__A23AB1D9_684C_48D4_A9D1_FD3DCEBD9D5B__INCLUDED_)