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.

68 lines
1.4 KiB

  1. #include "shellprv.h"
  2. #include "ids.h"
  3. #include "ftcmmn.h"
  4. #include "ftdlg.h"
  5. #include "ftascstr.h" //there only for the new CFTAssocStore
  6. CFTDlg::CFTDlg(ULONG_PTR ulpAHelpIDsArray) :
  7. CBaseDlg(ulpAHelpIDsArray), _pAssocStore(NULL)
  8. {}
  9. CFTDlg::~CFTDlg()
  10. {
  11. if (_pAssocStore)
  12. delete _pAssocStore;
  13. }
  14. HRESULT CFTDlg::_InitAssocStore()
  15. {
  16. ASSERT(!_pAssocStore);
  17. _pAssocStore = new CFTAssocStore();
  18. return _pAssocStore ? S_OK : E_OUTOFMEMORY;
  19. }
  20. ///////////////////////////////////////////////////////////////////////////////
  21. // Windows boiler plate code
  22. LRESULT CFTDlg::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
  23. {
  24. LRESULT lRes = FALSE;
  25. switch(uMsg)
  26. {
  27. case WM_CTRL_SETFOCUS:
  28. lRes = OnCtrlSetFocus(wParam, lParam);
  29. break;
  30. default:
  31. lRes = CBaseDlg::WndProc(uMsg, wParam, lParam);
  32. break;
  33. }
  34. return lRes;
  35. }
  36. LRESULT CFTDlg::OnCtrlSetFocus(WPARAM wParam, LPARAM lParam)
  37. {
  38. SetFocus((HWND)lParam);
  39. return TRUE;
  40. }
  41. //static
  42. void CFTDlg::MakeDefaultProgIDDescrFromExt(LPTSTR pszProgIDDescr, DWORD cchProgIDDescr,
  43. LPTSTR pszExt)
  44. {
  45. TCHAR szTemplate[25];
  46. TCHAR szExt[MAX_EXT];
  47. lstrcpyn(szExt, pszExt, ARRAYSIZE(szExt));
  48. LoadString(g_hinst, IDS_EXTTYPETEMPLATE, szTemplate, ARRAYSIZE(szTemplate));
  49. CharUpper(szExt);
  50. wnsprintf(pszProgIDDescr, cchProgIDDescr, szTemplate, szExt);
  51. }