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.

78 lines
1.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: ccomboex.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // ccomboex.h - Class wrapper for ComboBoxEx control
  11. #ifndef _CCOMBOEX_H_
  12. #define _CCOMBOEX_H_
  13. class CComboBoxEx2 : public WTL::CComboBox
  14. {
  15. public:
  16. WTL::CImageList SetImageList ( WTL::CImageList ImageList );
  17. int InsertItem ( COMBOBOXEXITEM* pItem );
  18. int DeleteItem ( int iItem );
  19. BOOL GetItem ( COMBOBOXEXITEM* pItem );
  20. int FindItem ( COMBOBOXEXITEM* pItem, int nStart = -1 );
  21. int FindNextBranch ( int iItem );
  22. void DeleteBranch ( int iItem );
  23. HWND GetComboControl( void );
  24. void FixUp( void );
  25. };
  26. inline WTL::CImageList CComboBoxEx2::SetImageList( WTL::CImageList ImageList)
  27. {
  28. ASSERT(::IsWindow(m_hWnd));
  29. HIMAGELIST himlOld = (HIMAGELIST) SendMessage(CBEM_SETIMAGELIST, 0, (LPARAM)(ImageList.m_hImageList));
  30. return (WTL::CImageList (himlOld));
  31. }
  32. inline int CComboBoxEx2::InsertItem(COMBOBOXEXITEM* pItem)
  33. {
  34. ASSERT(::IsWindow(m_hWnd));
  35. ASSERT(pItem != NULL);
  36. return SendMessage(CBEM_INSERTITEM, (WPARAM)0, (LPARAM)pItem);
  37. }
  38. inline int CComboBoxEx2::DeleteItem(int iItem)
  39. {
  40. ASSERT(::IsWindow(m_hWnd));
  41. return SendMessage(CBEM_DELETEITEM, (WPARAM)iItem, (LPARAM)0);
  42. }
  43. inline BOOL CComboBoxEx2::GetItem(COMBOBOXEXITEM* pItem)
  44. {
  45. ASSERT(::IsWindow(m_hWnd));
  46. ASSERT(pItem != NULL);
  47. return SendMessage(CBEM_GETITEM, (WPARAM)0, (LPARAM)pItem);
  48. }
  49. inline HWND CComboBoxEx2::GetComboControl(void)
  50. {
  51. ASSERT(::IsWindow(m_hWnd));
  52. return (HWND)SendMessage(CBEM_GETCOMBOCONTROL, (WPARAM)0, (LPARAM)0);
  53. }
  54. #endif // _CCOMBOEX_H_