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.

63 lines
2.0 KiB

  1. // This class will implement an owner draw button for the ICW when
  2. // running in Customized App mode.
  3. #define MAX_BUTTON_TITLE 50
  4. class CICWButton
  5. {
  6. public:
  7. void DrawButton(HDC hdc, UINT itemState, LPPOINT lppt);
  8. void SetButtonText(LPTSTR lpszText)
  9. {
  10. lstrcpyn(m_szButtonText, lpszText, MAX_BUTTON_TITLE);
  11. };
  12. void SetYPos(long yPos)
  13. {
  14. m_yPos = yPos;
  15. };
  16. void SetButtonDisplay(BOOL bDisplay)
  17. {
  18. m_bDisplayButton = bDisplay;
  19. };
  20. HRESULT Enable( BOOL bEnable );
  21. HRESULT Show( int nShowCmd );
  22. HRESULT GetClientRect( LPRECT lpRect );
  23. HRESULT CreateButtonWindow(HWND hWndParent, UINT uiCtlID);
  24. HRESULT SetButtonParams(long xPos,
  25. LPTSTR lpszPressedBmp,
  26. LPTSTR lpszUnpressedBmp,
  27. LPTSTR lpszFontFace,
  28. long lFontSize,
  29. long lFontWeight,
  30. COLORREF clrFontColor,
  31. COLORREF clrTransparentColor,
  32. COLORREF clrDisabled,
  33. long vAlign);
  34. CICWButton( void );
  35. ~CICWButton( void );
  36. HWND m_hWndButton; // Window Handle of the button
  37. long m_xPos;
  38. long m_yPos;
  39. private:
  40. HBITMAP m_hbmPressed;
  41. HBITMAP m_hbmUnpressed;
  42. TCHAR m_szButtonText[MAX_BUTTON_TITLE+1];
  43. COLORREF m_clrTransparent;
  44. COLORREF m_clrText;
  45. COLORREF m_clrDisabledText;
  46. HFONT m_hfont;
  47. RECT m_rcBtnClient;
  48. UINT m_vAlign;
  49. BOOL m_bDisplayButton;
  50. };