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.

79 lines
1.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: helptable.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "stdafx.h"
  11. #include "resource.h"
  12. #include "helptable.h"
  13. // from net\ias\mmc\common
  14. #include "hlptable.h"
  15. const CGlobalHelpTable __pGlobalCSHelpTable[] =
  16. {
  17. DLG_HELP_ENTRY(IDD_EAP_NEGOCIATE),
  18. DLG_HELP_ENTRY(IDD_EAP_ADD),
  19. {0,0}
  20. };
  21. IMPLEMENT_DYNCREATE(CHelpDialog, CDialog)
  22. BEGIN_MESSAGE_MAP(CHelpDialog, CDialog)
  23. //{{AFX_MSG_MAP(CHelpDialog)
  24. ON_WM_HELPINFO()
  25. ON_WM_CONTEXTMENU()
  26. //}}AFX_MSG_MAP
  27. END_MESSAGE_MAP()
  28. void CHelpDialog::OnContextMenu(CWnd* pWnd, ::CPoint point)
  29. {
  30. if (m_pHelpTable)
  31. ::WinHelp (pWnd->m_hWnd, AfxGetApp()->m_pszHelpFilePath,
  32. HELP_CONTEXTMENU, (DWORD_PTR)(LPVOID)m_pHelpTable);
  33. }
  34. BOOL CHelpDialog::OnHelpInfo(HELPINFO* pHelpInfo)
  35. {
  36. if (pHelpInfo->iContextType == HELPINFO_WINDOW && m_pHelpTable)
  37. {
  38. ::WinHelp ((HWND)pHelpInfo->hItemHandle,
  39. AfxGetApp()->m_pszHelpFilePath,
  40. HELP_WM_HELP,
  41. (DWORD_PTR)(LPVOID)m_pHelpTable);
  42. }
  43. return TRUE;
  44. }
  45. void CHelpDialog::setButtonStyle(int controlId, long flags, bool set)
  46. {
  47. // Get the button handle.
  48. HWND button = ::GetDlgItem(m_hWnd, controlId);
  49. // Retrieve the current style.
  50. long style = ::GetWindowLong(button, GWL_STYLE);
  51. // Update the flags.
  52. if (set)
  53. {
  54. style |= flags;
  55. }
  56. else
  57. {
  58. style &= ~flags;
  59. }
  60. // Set the new style.
  61. ::SendMessage(button, BM_SETSTYLE, LOWORD(style), MAKELPARAM(1,0));
  62. }
  63. void CHelpDialog::setFocusControl(int controlId)
  64. {
  65. ::SetFocus(::GetDlgItem(m_hWnd, controlId));
  66. }