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.

77 lines
2.8 KiB

  1. // shcombox.h : Shared shell comboboxEx methods
  2. #ifndef __SHCOMBOX_H__
  3. #define __SHCOMBOX_H__
  4. // COMBOITEMEX wrap with string storage.
  5. typedef struct
  6. {
  7. UINT mask;
  8. INT_PTR iItem;
  9. TCHAR szText[MAX_PATH] ;
  10. int cchTextMax;
  11. int iImage;
  12. int iSelectedImage;
  13. int iOverlay;
  14. int iIndent;
  15. int iID; // application-specific item identifier.
  16. ULONG Reserved;
  17. LPARAM lParam;
  18. } CBXITEM, *PCBXITEM;
  19. typedef CBXITEM CONST *PCCBXITEM;
  20. // ADDCBXITEMCALLBACK fAction flags
  21. #define CBXCB_ADDING 0x00000001 // if callback returns E_ABORT, combo population aborts
  22. #define CBXCB_ADDED 0x00000002 // callback's return value is ignored.
  23. // SendMessageTimeout constants
  24. #define CBX_SNDMSG_TIMEOUT_FLAGS SMTO_BLOCK
  25. #define CBX_SNDMSG_TIMEOUT 15000 // milliseconds
  26. #define CBX_SNDMSG_TIMEOUT_HRESULT HRESULT_FROM_WIN32(ERROR_TIMEOUT)
  27. // Misc constants
  28. #define NO_ITEM_NOICON_INDENT -2 // -1 to make up for the icon indent.
  29. #define NO_ITEM_INDENT 0
  30. #define ITEM_INDENT 1
  31. #define LISTINSERT_FIRST 0
  32. #define LISTINSERT_LAST -1
  33. #ifdef __cplusplus
  34. extern "C"
  35. {
  36. #endif
  37. // General shell comboboxex methods
  38. typedef HRESULT (WINAPI *LPFNPIDLENUM_CB)(LPCITEMIDLIST, void *);
  39. typedef HRESULT (WINAPI *ADDCBXITEMCALLBACK)(ULONG fAction, PCBXITEM pItem, LPARAM lParam);
  40. STDAPI AddCbxItemToComboBox(IN HWND hwndComboEx, IN PCCBXITEM pItem, IN INT_PTR *pnPosAdded);
  41. STDAPI AddCbxItemToComboBoxCallback(IN HWND hwndComboEx, IN OUT PCBXITEM pItem, IN ADDCBXITEMCALLBACK pfn, IN LPARAM lParam);
  42. STDAPI_(void) MakeCbxItem(OUT PCBXITEM pcbi, IN LPCTSTR pszDisplayName, IN void *pvData, IN LPCITEMIDLIST pidlIcon, IN INT_PTR nPos, IN int iIndent);
  43. STDAPI EnumSpecialItemIDs(int csidl, DWORD dwSHCONTF, LPFNPIDLENUM_CB pfn, void *pvData);
  44. STDAPI_(HIMAGELIST) GetSystemImageListSmallIcons();
  45. // local drive picker combo methods
  46. STDAPI PopulateLocalDrivesCombo(IN HWND hwndComboEx, IN ADDCBXITEMCALLBACK pfn, IN LPARAM lParam);
  47. // helpers (note: once all dependents are brought into line using the above methods, we can eliminate
  48. // decl of the following:
  49. typedef HRESULT (*LPFNRECENTENUM_CB)(IN LPCTSTR pszPath, IN BOOL fAddEntries, IN void *pvParam);
  50. // File Associations picker combo methods.
  51. STDAPI PopulateFileAssocCombo(IN HWND, IN ADDCBXITEMCALLBACK, IN LPARAM);
  52. STDAPI_(LONG) GetFileAssocComboSelItemText(IN HWND, OUT LPTSTR *ppszText);
  53. STDAPI_(LRESULT) DeleteFileAssocComboItem(IN LPNMHDR pnmh);
  54. #define FILEASSOCIATIONSID_ALLFILETYPES 20
  55. #define FILEASSOCIATIONSID_FILE_PATH 1 // Go parse it.
  56. #define FILEASSOCIATIONSID_MAX FILEASSOCIATIONSID_ALLFILETYPES
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif __SHCOMBOX_H__