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.

114 lines
3.5 KiB

  1. #ifndef FTADVDLG
  2. #define FTADVDLG
  3. #include "ftdlg.h"
  4. #include "ftcmmn.h"
  5. class CFTAdvDlg : public CFTDlg
  6. {
  7. public:
  8. CFTAdvDlg(LPTSTR pszProgID, LPTSTR pszExt = NULL);
  9. protected:
  10. ~CFTAdvDlg();
  11. ///////////////////////////////////////////////////////////////////////////////
  12. // Implementation
  13. private:
  14. LRESULT WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  15. // Message handlers
  16. // Dialog messages
  17. LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  18. LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  19. LRESULT OnInitDialog(WPARAM wParam, LPARAM lParam);
  20. LRESULT OnDestroy(WPARAM wParam, LPARAM lParam);
  21. LRESULT OnDrawItem(WPARAM wParam, LPARAM lParam);
  22. LRESULT OnMeasureItem(WPARAM wParam, LPARAM lParam);
  23. LRESULT OnOK(WORD wNotif);
  24. LRESULT OnCancel(WORD wNotif);
  25. // Control specific
  26. //
  27. // Action buttons
  28. LRESULT OnNewButton(WORD wNotif);
  29. LRESULT OnEditButton(WORD wNotif);
  30. LRESULT OnChangeIcon(WORD wNotif);
  31. LRESULT OnSetDefault(WORD wNotif);
  32. LRESULT OnRemoveButton(WORD wNotif);
  33. // ListView
  34. LRESULT OnNotifyListView(UINT uCode, LPNMHDR pNMHDR);
  35. LRESULT OnListViewSelItem(int iItem, LPARAM lParam);
  36. private:
  37. // Member variables
  38. TCHAR _szProgID[MAX_PROGID];
  39. TCHAR _szExt[MAX_EXT];
  40. HICON _hIcon;
  41. HFONT _hfontReg;
  42. HFONT _hfontBold;
  43. int _iDefaultAction;
  44. int _iLVSel;
  45. HDPA _hdpaActions;
  46. HDPA _hdpaRemovedActions;
  47. TCHAR _szIconLoc[MAX_ICONLOCATION];
  48. TCHAR _szOldIconLoc[MAX_ICONLOCATION];
  49. int _iOldIcon;
  50. HANDLE _hHeapProgID;
  51. ///////////////////////////////////////////////////////////////////////////////
  52. // Helpers
  53. inline HWND _GetLVHWND();
  54. HRESULT _FillListView();
  55. HRESULT _FillProgIDDescrCombo();
  56. HRESULT _InitDefaultActionFont();
  57. HRESULT _InitListView();
  58. HRESULT _InitDefaultAction();
  59. HRESULT _InitChangeIconButton();
  60. HRESULT _InitDescription();
  61. HRESULT _SetDocIcon(int iIndex = -1);
  62. int _GetIconIndex();
  63. HRESULT _SelectListViewItem(int i);
  64. HRESULT _SetDefaultAction(int iIndex);
  65. void _SetDefaultActionHelper(int iIndex, BOOL fDefault);
  66. HRESULT _UpdateActionButtons();
  67. HRESULT _UpdateCheckBoxes();
  68. // PROGIDACTION helpers
  69. HRESULT _RemovePROGIDACTION(PROGIDACTION* pPIDA);
  70. HRESULT _CreatePROGIDACTION(PROGIDACTION** ppPIDA);
  71. HRESULT _CopyPROGIDACTION(PROGIDACTION* pPIDADest, PROGIDACTION* pPIDASrc);
  72. HRESULT _GetPROGIDACTION(LPTSTR pszAction, PROGIDACTION** ppPIDA);
  73. HRESULT _AppendPROGIDACTION(PROGIDACTION* pPIDA);
  74. HRESULT _FillPROGIDACTION(PROGIDACTION* pPIDA, LPTSTR pszActionReg,
  75. LPTSTR pszActionFN);
  76. void _DeletePROGIDACTION(PROGIDACTION* pPIDA);
  77. BOOL _IsNewPROGIDACTION(LPTSTR pszAction);
  78. BOOL _FindActionLVITEM(LPTSTR pszActionReg, LVITEM* plvItem);
  79. BOOL _GetListViewSelectedItem(UINT uMask, UINT uStateMask, LVITEM* plvItem);
  80. int _InsertListViewItem(int iItem, LPTSTR pszActionReg, LPTSTR pszActionFN);
  81. BOOL _IsDefaultAction(LPTSTR pszActionReg);
  82. BOOL _GetDefaultAction(LPTSTR pszActionReg, DWORD cchActionReg);
  83. void _CleanupProgIDs();
  84. LPTSTR _AddProgID(LPTSTR pszProgID);
  85. void _CheckDefaultAction();
  86. BOOL _CheckForDuplicateEditAction(LPTSTR pszActionRegOriginal, LPTSTR pszActionReg,
  87. LPTSTR pszActionFNOriginal, LPTSTR pszActionFN);
  88. BOOL _CheckForDuplicateNewAction(LPTSTR pszActionReg, LPTSTR pszActionFN);
  89. };
  90. #endif //FTADVDLG