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.

50 lines
1.1 KiB

  1. // Copyright (C) 1996-1997 Microsoft Corporation. All rights reserved.
  2. #include "header.h"
  3. #include "topics.h"
  4. #include "strtable.h"
  5. void CHtmlHelpControl::OnHelpTopics(void)
  6. {
  7. CPropSheet cprop(GetStringResource(IDS_HELP_TOPICS),
  8. PSH_NOAPPLYNOW, m_hwnd);
  9. cprop.m_fNoCsHelp = TRUE;
  10. CPageContents pageContents(this);
  11. CPageIndex pageIndex(this);
  12. cprop.AddPage(&pageContents);
  13. cprop.AddPage(&pageIndex);
  14. ModalDialog(TRUE);
  15. cprop.DoModal();
  16. ModalDialog(FALSE);
  17. }
  18. BOOL CPageContents::OnBeginOrEnd()
  19. {
  20. return TRUE;
  21. }
  22. BOOL CPageIndex::OnBeginOrEnd()
  23. {
  24. if (m_fInitializing) {
  25. BEGIN_MSG_LIST()
  26. ON_CDLG_MSG(LBN_DBLCLK, IDC_LIST, OnDblClick)
  27. ON_CDLG_MSG(LBN_SELCHANGE, IDC_LIST, OnSelChange)
  28. END_MSG_LIST()
  29. }
  30. return TRUE;
  31. }
  32. void CPageIndex::OnSelChange()
  33. {
  34. INT_PTR pos = SendMessage(IDC_LIST, LB_GETCURSEL, 0, 0L);
  35. if (pos == LB_ERR)
  36. return;
  37. SITEMAP_ENTRY* pSiteMapEntry = m_phhCtrl->m_pindex->GetSiteMapEntry((int)pos + 1);
  38. m_fSelectionChange = TRUE; // ignore EN_CHANGE
  39. SetWindowText(IDC_EDIT, pSiteMapEntry->GetKeyword());
  40. m_fSelectionChange = FALSE; // ignore EN_CHANGE
  41. }