Source code of Windows XP (NT5)
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.

48 lines
1.1 KiB

  1. #include <lmcons.h> // for UNLEN
  2. // window class name of user pane control
  3. #define WC_USERPANE TEXT("Desktop User Pane")
  4. // hardcoded width and height of user picture
  5. #define USERPICWIDTH 48
  6. #define USERPICHEIGHT 48
  7. class CUserPane
  8. {
  9. public:
  10. CUserPane();
  11. ~CUserPane();
  12. static LRESULT CALLBACK s_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  13. LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  14. void Paint(HDC hdc);
  15. void OnDrawItem(DRAWITEMSTRUCT *pdis);
  16. LRESULT OnSize();
  17. BOOL _IsCursorInPicture();
  18. private:
  19. HRESULT _UpdateUserInfo();
  20. HWND _hwnd;
  21. HWND _hwndStatic;
  22. TCHAR _szUserName[UNLEN + 1];
  23. HTHEME _hTheme;
  24. MARGINS _mrgnPictureFrame; // the margins for the frame around the user picture
  25. int _iFramedPicHeight;
  26. int _iFramedPicWidth;
  27. int _iUnframedPicHeight;
  28. int _iUnframedPicWidth;
  29. UINT _uidChangeRegister;
  30. HFONT _hFont;
  31. COLORREF _crColor;
  32. HBITMAP _hbmUserPicture;
  33. enum { UPM_CHANGENOTIFY = WM_USER };
  34. friend BOOL UserPane_RegisterClass();
  35. };