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.

2781 lines
127 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. HelpCenterExternal.cpp
  5. Abstract:
  6. This file contains the implementation of the class exposed as the "pchealth" object.
  7. Revision History:
  8. Ghim-Sim Chua (gschua) 07/23/99
  9. created
  10. Davide Massarenti (dmassare) 07/25/99
  11. modified
  12. ******************************************************************************/
  13. #include "stdafx.h"
  14. /////////////////////////////////////////////////////////////////////////////
  15. static const WCHAR s_szPanelName_NAVBAR [] = L"NavBar" ;
  16. static const WCHAR s_szPanelName_MININAVBAR[] = L"MiniNavBar";
  17. static const WCHAR s_szPanelName_CONTEXT [] = L"Context" ;
  18. static const WCHAR s_szPanelName_CONTENTS [] = L"Contents" ;
  19. static const WCHAR s_szPanelName_HHWINDOW [] = L"HHWindow" ;
  20. static const WCHAR c_szURL_Err_BadUrl [] = L"hcp://system/errors/badurl.htm";
  21. static const LPCWSTR c_szEntryUrls [] =
  22. {
  23. L"hcp://help/tshoot/Err_Hardw_Error3.htm",
  24. L"hcp://help/tshoot/Err_Hardw_Error10.htm",
  25. L"hcp://help/tshoot/hwcon.htm",
  26. L"hcp://help/tshoot/Err_Hardw_Error16.htm",
  27. L"hcp://help/tshoot/Err_Hardw_Error19.htm",
  28. L"hcp://help/tshoot/Err_Hardw_Error24.htm",
  29. L"hcp://help/tshoot/Err_Hardw_Error29.htm",
  30. L"hcp://help/tshoot/Err_Hardw_Error31.htm",
  31. L"hcp://help/tshoot/Err_Hardw_Error19.htm",
  32. L"hcp://help/tshoot/Err_Hardw_Error33.htm",
  33. L"hcp://help/tshoot/Err_Hardw_Error34.htm",
  34. L"hcp://help/tshoot/Err_Hardw_Error35.htm",
  35. L"hcp://help/tshoot/Err_Hardw_Error36.htm",
  36. L"hcp://help/tshoot/Err_Hardw_Error31.htm",
  37. L"hcp://help/tshoot/Err_Hardw_Error38.htm",
  38. L"hcp://help/tshoot/Err_Hardw_Error31.htm",
  39. L"hcp://help/tshoot/Err_Hardw_Error31.htm",
  40. L"hcp://help/tshoot/Err_Hardw_Error41.htm",
  41. L"hcp://help/tshoot/Err_Hardw_Error42.htm",
  42. L"hcp://help/tshoot/Err_Hardw_Error19.htm",
  43. L"hcp://help/tshoot/Err_Hardw_Error42.htm",
  44. L"hcp://help/tshoot/Err_Hardw_Error47.htm",
  45. L"hcp://help/tshoot/tsUSB.htm",
  46. L"hcp://help/tshoot/tsdrive.htm",
  47. L"hcp://help/tshoot/tsdisp.htm",
  48. L"hcp://help/tshoot/hdw_keyboard.htm",
  49. L"hcp://help/tshoot/tssound.htm",
  50. L"hcp://help/tshoot/tsmodem.htm",
  51. L"hcp://help/tshoot/hdw_mouse.htm",
  52. L"hcp://help/tshoot/tsInputDev.htm",
  53. L"hcp://help/tshoot/hdw_tape.htm",
  54. L"hcp://services/subsite?node=TopLevelBucket_3/Customizing_your_computer",
  55. L"hcp://services/subsite?node=TopLevelBucket_3/Customizing_your_computer",
  56. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web",
  57. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web",
  58. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web",
  59. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web",
  60. L"hcp://services/subsite?node=TopLevelBucket_1/Windows_basics",
  61. L"hcp://services/subsite?node=TopLevelBucket_1/Windows_basics",
  62. L"hcp://services/layout/fullwindow?topic=MS-ITS%3A%25HELP_LOCATION%25%5Carticle.chm%3A%3A/ap_intro.htm",
  63. L"hcp://services/layout/fullwindow?topic=MS-ITS%3A%25HELP_LOCATION%25%5Carticle.chm%3A%3A/ahn_intro.htm",
  64. L"hcp://services/layout/fullwindow?topic=MS-ITS%3A%25HELP_LOCATION%25%5Carticle.chm%3A%3A/asa_intro.htm",
  65. L"hcp://services/layout/fullwindow?topic=MS-ITS%3A%2525HELP_LOCATION%2525%5Carticle.chm%3A%3A/asa_intro.htm",
  66. L"hcp://services/layout/fullwindow?topic=MS-ITS%3A%2525HELP_LOCATION%2525%5Carticle.chm%3A%3A/ahn_intro.htm",
  67. L"hcp://services/layout/fullwindow?topic=MS-ITS%3A%2525HELP_LOCATION%2525%5Carticle.chm%3A%3A/ap_intro.htm",
  68. L"hcp://services/layout/fullwindow?topic=MS-ITS%3A%2525HELP_LOCATION%2525%5Carticle.chm%3A%3A/avj_intro.htm",
  69. L"hcp://help/tshoot/hdw_keyboard.htm",
  70. L"hcp://help/tshoot/tsdrive.htm",
  71. L"hcp://help/tshoot/hdw_mouse.htm",
  72. L"hcp://help/tshoot/tsInputDev.htm",
  73. L"hcp://help/tshoot/hdw_tape.htm",
  74. L"hcp://help/tshoot/tsUSB.htm",
  75. L"hcp://help/tshoot/tssound.htm",
  76. L"hcp://help/tshoot/tsgame.htm",
  77. L"hcp://help/tshoot/tsInputDev.htm",
  78. L"hcp://help/tshoot/tsgame.htm",
  79. L"hcp://services/subsite?node=HP_home/HP_library",
  80. L"hcp://services/subsite?node=Dell/Dell2",
  81. L"hcp://services/subsite?node=Dell/Dell1",
  82. L"hcp://help/tshoot/ts_dvd.htm",
  83. L"hcp://help/tshoot/tsdisp.htm",
  84. L"hcp://help/tshoot/tsdrive.htm",
  85. L"hcp://help/tshoot/tsnetwrk.htm",
  86. L"hcp://help/tshoot/tshardw.htm",
  87. L"hcp://help/tshoot/tshomenet.htm",
  88. L"hcp://help/tshoot/tsinputdev.htm",
  89. L"hcp://help/tshoot/tsics.htm",
  90. L"hcp://help/tshoot/tsie.htm",
  91. L"hcp://help/tshoot/tsmodem.htm",
  92. L"hcp://help/tshoot/tsgame.htm",
  93. L"hcp://help/tshoot/tsmessaging.htm",
  94. L"hcp://help/tshoot/tsprint.htm",
  95. L"hcp://help/tshoot/tssound.htm",
  96. L"hcp://help/tshoot/tsstartup.htm",
  97. L"hcp://help/tshoot/tsusb.htm",
  98. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_requirements.htm",
  99. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_checklistP.htm",
  100. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_checklistW.htm",
  101. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_howto_connectP.htm",
  102. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_howto_connectW.htm",
  103. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\netcfg.chm%3A%3A/share_conn_overvw.htm",
  104. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_determine_internet_connection.htm",
  105. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_nohost_computerP.htm",
  106. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_nohost_computerW.htm",
  107. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_change_ics_host.htm",
  108. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\netcfg.chm%3A%3A/hnw_understanding_bridge.htm",
  109. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_comp_name_description.htm",
  110. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\filefold.chm%3A%3A/sharing_files_overviewP.htm",
  111. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\filefold.chm%3A%3A/sharing_files_overviewW.htm",
  112. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\filefold.chm%3A%3A/windows_shared_documents.htm",
  113. L"hcp://help/tshoot/tsInputDev.htm",
  114. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cdatetime.chm%3A%3A/windows_date_IT_overview.htm&select=Date_Time_Language_and_Regional_Settings",
  115. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/using_webfolders_for_file_transfer.htm&select=TopLevelBucket_2/Networking_and_the_Web/E-mail_and_the_Web/Security_online",
  116. L"hcp://services/subsite?node=Unmapped/Control_Panel&select=Unmapped/Control_Panel/Appearance_and_Themes/Fonts",
  117. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/sharing_files_overviewP.htm&select=Networking_and_the_Web/Sharing_files__printers__and_other_resources",
  118. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/sharing_files_overviewW.htm&select=Networking_and_the_Web/Sharing_files__printers__and_other_resources",
  119. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/sharing_files_overviewP.htm&select=Networking_and_the_Web/Sharing_files__printers__and_other_resources",
  120. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/sharing_files_overviewW.htm&select=Networking_and_the_Web/Sharing_files__printers__and_other_resources",
  121. L"hcp://help/tshoot/hdw_generic.htm",
  122. L"hcp://services/subsite?node=Unmapped/Recycle_Bin",
  123. L"hcp://services/subsite?node=Unmapped/Briefcase",
  124. L"hcp://services/subsite?node=TopLevelBucket_4/Hardware&topic=MS-ITS%3A%25HELP_LOCATION%25%5Ccdmedia.chm%3A%3A/cdmedia_fail2_moreinfo_buffer_underrun.htm&select=TopLevelBucket_4/Hardware/CDs_and_other_storage_devices",
  125. L"hcp://services/subsite?node=TopLevelBucket_4/Hardware&topic=MS-ITS%3A%25HELP_LOCATION%25%5Ccdmedia.chm%3A%3A/cdmedia_fail3_moreinfo_disk_full.htm&select=TopLevelBucket_4/Hardware/CDs_and_other_storage_devices",
  126. L"hcp://system/netdiag/dglogs.htm",
  127. L"hcp://services/subsite?node=Unmapped/Search",
  128. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/using_shared_documents_folder.htm&select=TopLevelBucket_2/Networking_and_the_Web/Sharing_files__printers__and_other_resources",
  129. L"hcp://services/layout/xml?definition=MS-ITS%3A%25HELP_LOCATION%25%5Cntdef.chm%3A%3A/Printers_and_Faxes.xml",
  130. L"hcp://help/tshoot/tsprint.htm",
  131. L"hcp://services/subsite?node=TopLevelBucket_1/Music__video__games_and_photos&topic=MS-ITS%3A%25HELP_LOCATION%25%5CDisplay.chm%3A%3A/display_switch_to_256_colors.htm&select=TopLevelBucket_1/Music__video__games_and_photos/Games",
  132. L"hcp://services/subsite?node=TopLevelBucket_4/Fixing_a_problem&select=TopLevelBucket_4/Fixing_a_problem/Using_System_Restore_to_undo_changes",
  133. L"hcp://system/netdiag/dglogs.htm",
  134. L"hcp://system/sysinfo/msinfo.htm",
  135. L"hcp://help/tshoot/tsdrive.htm",
  136. L"hcp://help/tshoot/tsdisp.htm",
  137. L"hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/zawbug/start.htm",
  138. L"hcp://system/updatectr/updatecenter.htm",
  139. L"hcp://system/compatctr/compatmode.htm",
  140. L"hcp://help/tshoot00/DVDVideoStream.htm",
  141. L"hcp://help/tshoot00/DVDAudio2.htm",
  142. L"hcp://help/tshoot00/DVDRegion.htm",
  143. L"hcp://help/tshoot00/DVDCopyProtection.htm",
  144. L"hcp://help/tshoot00/DVDDecoder.htm",
  145. L"hcp://help/tshoot00/DVDOverlay.htm",
  146. L"hcp://help/tshoot00/DVDCopyProtection.htm",
  147. L"hcp://help/tshoot/DVDVideoStream.htm",
  148. L"hcp://help/tshoot/DVDAudio2.htm",
  149. L"hcp://help/tshoot/DVDRegion.htm",
  150. L"hcp://help/tshoot/DVDCopyProtection.htm",
  151. L"hcp://help/tshoot/DVDDecoder.htm",
  152. L"hcp://help/tshoot/DVDOverlay.htm",
  153. L"hcp://help/tshoot/DVDCopyProtection.htm",
  154. L"hcp://help/tshoot/tssound.htm",
  155. L"hcp://services/subsite?node=Unmapped/Network_connections&select=Unmapped/Network_connections/Getting_started",
  156. L"hcp://system/netdiag/dglogs.htm",
  157. L"hcp://system/panels/Topics.htm?path=TopLevelBucket_4/Fixing_a_problem/Home_Networking_and_network_problems",
  158. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\infrared.chm%3A%3A/WLAN_client_configure.htm",
  159. L"hcp://system/netdiag/dglogs.htm",
  160. L"hcp://help/tshoot/tsmodem.htm",
  161. L"hcp://help/tshoot/tsprint.htm",
  162. L"hcp://services/layout/xml?definition=MS-ITS%3A%25HELP_LOCATION%25%5Cntdef.chm%3A%3A/Scanners_and_Cameras.xml",
  163. L"hcp://services/subsite?node=TopLevelBucket_1/Music__video__games_and_photos&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/manage_your_pictures.htm&select=TopLevelBucket_1/Music__video__games_and_photos/photos_and_other_digital_images",
  164. L"hcp://help/tshoot/tsInputDev.htm",
  165. L"hcp://help/tshoot/tsInputDev.htm",
  166. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cdatetime.chm%3A%3A/windows_date_IT_overview.htm&select=Date_Time_Language_and_Regional_Settings",
  167. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/using_webfolders_for_file_transfer.htm&select=TopLevelBucket_2/Networking_and_the_Web/E-mail_and_the_Web/Security_online",
  168. L"hcp://services/subsite?node=Unmapped/Control_Panel&select=Unmapped/Control_Panel/Appearance_and_Themes/Fonts",
  169. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/sharing_files_overviewP.htm&select=Networking_and_the_Web/Sharing_files__printers__and_other_resources",
  170. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/sharing_files_overviewW.htm&select=Networking_and_the_Web/Sharing_files__printers__and_other_resources",
  171. L"hcp://help/tshoot/hdw_generic.htm",
  172. L"hcp://services/subsite?node=Unmapped/Recycle_Bin",
  173. L"hcp://services/subsite?node=Unmapped/Briefcase",
  174. L"hcp://services/subsite?node=TopLevelBucket_4/Hardware&topic=MS-ITS%3A%25HELP_LOCATION%25%5Ccdmedia.chm%3A%3A/cdmedia_fail2_moreinfo_buffer_underrun.htm&select=TopLevelBucket_4/Hardware/CDs_and_other_storage_devices",
  175. L"hcp://services/subsite?node=TopLevelBucket_4/Hardware&topic=MS-ITS%3A%25HELP_LOCATION%25%5Ccdmedia.chm%3A%3A/cdmedia_fail3_moreinfo_disk_full.htm&select=TopLevelBucket_4/Hardware/CDs_and_other_storage_devices",
  176. L"hcp://system/netdiag/dglogs.htm",
  177. L"hcp://services/subsite?node=Unmapped/Search",
  178. L"hcp://services/subsite?node=TopLevelBucket_2/Networking_and_the_Web&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cfilefold.chm%3A%3A/using_shared_documents_folder.htm&select=TopLevelBucket_2/Networking_and_the_Web/Sharing_files__printers__and_other_resources",
  179. L"hcp://services/layout/xml?definition=MS-ITS%3A%25HELP_LOCATION%25%5Cntdef.chm%3A%3A/Printers_and_Faxes.xml",
  180. L"hcp://help/tshoot/tsprint.htm",
  181. L"hcp://help/tshoot/tsdisp.htm",
  182. L"hcp://services/subsite?node=TopLevelBucket_1/Music__video__games_and_photos&topic=MS-ITS%3A%25HELP_LOCATION%25%5CDisplay.chm%3A%3A/display_switch_to_256_colors.htm&select=TopLevelBucket_1/Music__video__games_and_photos/Games",
  183. L"hcp://services/layout/contentonly?topic=ms-its%3Aarticle.chm%3A%3A/ahn_intro.htm",
  184. L"hcp://services/layout/contentonly?topic=MS-ITS%3Anetcfg.chm%3A%3A/Howto_conn_directparallel.htm",
  185. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm",
  186. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel",
  187. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Accessibility",
  188. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Security_and_User_Accounts",
  189. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Appearance_and_Themes",
  190. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Add_or_Remove_Programs",
  191. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Printers_and_Other_Hardware",
  192. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Network_Connections",
  193. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Performance_and_Maintenance",
  194. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Date__Time__Language_and_Regional_Settings",
  195. L"hcp://services/subsite?node=Unmapped/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Sounds__Speech_and_Audio_Devices",
  196. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm",
  197. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel",
  198. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Accessibility",
  199. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Security_and_User_Accounts",
  200. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Appearance_and_Themes",
  201. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Add_or_Remove_Programs",
  202. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Printers_and_Other_Hardware",
  203. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Network_Connections",
  204. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Performance_and_Maintenance",
  205. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Date__Time__Language_and_Regional_Settings",
  206. L"hcp://services/subsite?node=Unmapped/L/Control_Panel&topic=MS-ITS%3A%25HELP_LOCATION%25%5Chs.chm%3A%3A/hs_control_panel.htm&select=Unmapped/Control_Panel/Sounds__Speech_and_Audio_Devices",
  207. L"hcp://help/tshoot/tsdisp.htm",
  208. L"hcp://help/tshoot/ts_dvd.htm",
  209. L"hcp://help/tshoot/tsie.htm",
  210. L"hcp://help/tshoot/tsmodem.htm",
  211. L"hcp://help/tshoot/tshomenet.htm",
  212. L"hcp://help/tshoot/tsnetwrk.htm",
  213. L"hcp://help/tshoot/tsstartup.htm",
  214. L"hcp://help/tshoot/tssound.htm",
  215. L"hcp://help/tshoot/tssound.htm",
  216. L"hcp://help/tshoot/tsgame.htm",
  217. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_requirements.htm",
  218. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_checklistP.htm",
  219. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_checklistW.htm",
  220. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_howto_connectP.htm",
  221. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_howto_connectW.htm",
  222. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_nohost_computerP.htm",
  223. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_nohost_computerW.htm",
  224. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_determine_internet_connection.htm",
  225. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\network.chm%3A%3A/hnw_change_ics_host.htm",
  226. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\netcfg.chm%3A%3A/share_conn_overvw.htm",
  227. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\netcfg.chm%3A%3A/hnw_understanding_bridge.htm",
  228. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\filefold.chm%3A%3A/sharing_files_overviewP.htm",
  229. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\filefold.chm%3A%3A/sharing_files_overviewW.htm",
  230. L"hcp://services/layout/contentonly?topic=ms-its%3A%25help_location%25\\filefold.chm%3A%3A/windows_shared_documents.htm",
  231. L"hcp://system/HomePage.htm",
  232. L"hcp://system/sysinfo/sysinfomain.htm",
  233. L"hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Common/rcscreen1.htm",
  234. L"hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/UnSolicitedRCUI.htm",
  235. L"hcp://system/netdiag/dglogs.htm",
  236. L"hcp://system/sysinfo/sysInfoLaunch.htm",
  237. L"hcp://system/sysinfo/sysConfigLaunch.htm",
  238. L"hcp://system/compatctr/compatmode.htm",
  239. L"hcp://help/tshoot/tssetup.htm",
  240. L"hcp://services/centers/support?topic=hcp://system/sysinfo/sysinfomain.htm",
  241. L"hcp://help/tshoot/hdw_infrared.htm",
  242. L"hcp://services/layout/contentonly?topic=MS-ITS%3Anetcfg.chm%3A%3A/Howto_conn_directparallel.htm",
  243. L"hcp://services/layout/contentonly?topic=ms-its%3Aarticle.chm%3A%3A/ahn_intro.htm",
  244. L"hcp://system/blurbs/windows_newsgroups.htm",
  245. L"hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/Connection.htm",
  246. L"hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Common/rcscreen1.htm",
  247. L"hcp://services/subsite?node=Security/Public_Key_Infrastructure/Certificate_Servicestopic=MS-ITS:csconcepts.chm::/sag_CS_procs_setup.htm",
  248. L"hcp://system/updatectr/updatecenter.htm",
  249. L"hcp://services/layout/fullwindow?topic=MS-ITS:filefold.chm::/manage_your_pictures.htm",
  250. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  251. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_calibratethepen.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  252. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_changeyourscreenorientationtoportraitorlandscape.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  253. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletbuttons.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  254. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletPCforleftorrighthandeduse.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  255. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_enableordisableapenbutton.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  256. L"hcp://services/subsite?node=TopLevelBucket_1/Windows_basics&topic=MS-ITS%3A%25HELP_LOCATION%25%5Cntchowto.chm.chm%3A%3A/app_tutorial.htm",
  257. L"hcp://services/subsite?node=TopLevelBucket_2/Working_Remotely/Remote_Desktop&topic=MS-ITS:rdesktop.chm::/rdesktop_overview.htm",
  258. L"hcp://services/subsite?node=Administration_and_Scripting_Tools/Remote_Administration_Tools/Remote_Administration_Using_Terminal_Services&topic=MS-ITS:rdesktop.chm::/rdesktops_chm_topnode.htm",
  259. L"hcp://services/subsite?node=Software_Deployment/Terminal_Services&topic=MS-ITS:termsrv.chm::/ts_chm_top.htm",
  260. L"hcp://services/layout/contentonly?topic=ms-its:article.chm::/ahn_intro.htm",
  261. L"hcp://services/layout/contentonly?topic=MS-ITS:netcfg.chm::/Howto_conn_directparallel.htm",
  262. L"hcp://services/layout/fullwindow?topic=MS-ITS:%HELP_LOCATION%\\article.chm::/ap_intro.htm",
  263. L"hcp://services/layout/fullwindow?topic=MS-ITS:%HELP_LOCATION%\\article.chm::/ahn_intro.htm",
  264. L"hcp://services/layout/fullwindow?topic=MS-ITS:%HELP_LOCATION%\\article.chm::/asa_intro.htm",
  265. L"hcp://services/layout/fullwindow?topic=MS-ITS:%25HELP_LOCATION%25\\article.chm::/asa_intro.htm",
  266. L"hcp://services/layout/fullwindow?topic=MS-ITS:%25HELP_LOCATION%25\\article.chm::/ahn_intro.htm",
  267. L"hcp://services/layout/fullwindow?topic=MS-ITS:%25HELP_LOCATION%25\\article.chm::/ap_intro.htm",
  268. L"hcp://services/layout/fullwindow?topic=MS-ITS:%25HELP_LOCATION%25\\article.chm::/avj_intro.htm",
  269. L"hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/Remote Assistance/Escalation/Common/rcscreen1.htm",
  270. L"hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/Remote Assistance/Escalation/Unsolicited/UnSolicitedRCUI.htm",
  271. L"hcp://services/subsite?node=TopLevelBucket_1/Windows_basics&topic=MS-ITS:%HELP_LOCATION%\\ntchowto.chm.chm::/app_tutorial.htm",
  272. L"hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/bugrep.htm",
  273. L"hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/bugrep.htm",
  274. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_TIPoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  275. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_notebookoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  276. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_stickynotesoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  277. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inkballoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  278. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/accessibility_overview.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  279. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/accessibility_options_installs.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  280. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/AccessOptions_ct.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  281. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:pwrmn.chm::/pwrmn_managing_power.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Conserving_power_on_your_computer",
  282. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/hsc_adjustscreenbrightness.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Conserving_power_on_your_computer",
  283. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/hsc_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  284. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_intheoffice.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  285. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  286. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_athome.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  287. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_TIPoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  288. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_notebookoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  289. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_stickynotesoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  290. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inkballoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  291. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/accessibility_overview.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  292. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/accessibility_options_installs.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  293. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/AccessOptions_ct.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  294. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:pwrmn.chm::/pwrmn_managing_power.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Conserving_power_on_your_computer",
  295. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/hsc_adjustscreenbrightness.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Conserving_power_on_your_computer",
  296. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/hsc_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  297. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_intheoffice.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  298. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  299. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_athome.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  300. L"hcp://system/panels/Topics.htm?path=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen/Tablet_Pen_Overview",
  301. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  302. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_TIPoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  303. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_notebookoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  304. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_stickynotesoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  305. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inkballoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  306. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/accessibility_overview.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  307. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/accessibility_options_installs.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  308. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/AccessOptions_ct.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  309. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:pwrmn.chm::/pwrmn_managing_power.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Conserving_power_on_your_computer",
  310. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/hsc_adjustscreenbrightness.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Conserving_power_on_your_computer",
  311. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/hsc_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  312. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_intheoffice.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  313. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  314. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_athome.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  315. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  316. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizepenactions.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  317. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletbuttons.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  318. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_TIPoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  319. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  320. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizepenactions.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  321. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  322. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizepenactions.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  323. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  324. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizepenactions.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  325. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_TIPoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  326. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_changeyourscreenorientationtoportraitorlandscape.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  327. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_changeyourscreenorientationsequencesettings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  328. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_adjustscreenbrightness.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  329. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_calibratethepen.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  330. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletPCforleftorrighthandeduse.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  331. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_movemenustotheleftorright.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  332. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-its:tabsys.chm::/hsc_tabletpcoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_your_tablet_computer",
  333. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  334. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizepenactions.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  335. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_enableordisableapenbutton.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  336. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_enableordisablepeneraser.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  337. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletbuttons.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  338. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_changeyourscreenorientationtoportraitorlandscape.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  339. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_changeyourscreenorientationsequencesettings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  340. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_TIPoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  341. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_notebookoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  342. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_stickynotesoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  343. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inkballoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  344. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/accessibility_overview.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  345. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/accessibility_options_installs.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  346. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-ITS:access.chm::/AccessOptions_ct.htm&select=TopLevelBucket_3/Accessibility/Understanding_Windows_XP_accessibility_features",
  347. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:pwrmn.chm::/pwrmn_managing_power.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Conserving_power_on_your_computer",
  348. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/hsc_adjustscreenbrightness.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Conserving_power_on_your_computer",
  349. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/hsc_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  350. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_intheoffice.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  351. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  352. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_athome.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  353. L"hcp://services/subsite?node=TopLevelBucket_3/Accessibility&topic=MS-its:osk.chm::/OSK_overview.htm&select=TopLevelBucket_3/ Accessibility/Features_for_people_who_have_a_mobility_impairment",
  354. L"hcp://services/subsite?node=TopLevelBucket_3/Customizing_your_computer&topic=ms-its:input.chm::/input_toolbar_overview.htm&select=TopLevelBucket_3/Customizing_your_computer/Date__time__region__and_language/Region_and_language",
  355. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_inmeetings.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  356. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  357. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  358. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  359. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  360. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  361. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  362. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  363. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  364. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_calibratethepen.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  365. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_changeyourscreenorientationtoportraitorlandscape.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  366. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletPCforleftorrighthandeduse.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  367. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletbuttons.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  368. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_enableordisableapenbutton.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  369. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  370. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  371. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  372. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_penoverview.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Tablet_PC_Pen",
  373. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Increasing_Your_Productivitiy_with_Tablet_PC",
  374. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  375. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  376. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  377. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/About_Tablet_PC_Accessories",
  378. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  379. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_calibratethepen.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  380. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_changeyourscreenorientationtoportraitorlandscape.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  381. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletPCforleftorrighthandeduse.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  382. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_customizetabletbuttons.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  383. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&topic=MS-ITS:tabsys.chm::/HSC_enableordisableapenbutton.htm&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  384. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  385. L"hcp://services/subsite?node=TopLevelBucket_1/Getting_Started_with_Tablet_PC&select=TopLevelBucket_1/Getting_Started_with_Tablet_PC/Customizing_your_Tablet_PC",
  386. };
  387. static const LPCWSTR c_szEntryUrlsPartial [] =
  388. {
  389. L"hcp://system/DVDUpgrd/dvdupgrd.htm?website=",
  390. L"hcp://services/layout/xml?definition=hcp://system/dfs/viewmode.xml&topic=hcp://system/dfs/uplddrvinfo.htm%3F",
  391. L"hcp://services/layout/contentonly?topic=hcp://system/dfs/uplddrvinfo.htm%3f",
  392. };
  393. static const LPCWSTR c_szEntryUrlsEnv [] =
  394. {
  395. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_complete.htm",
  396. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_confirm_select.htm",
  397. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_confirm_undo.htm",
  398. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_created.htm",
  399. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_createRP.htm",
  400. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_for_Wizard_Only.htm",
  401. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_renamedFolder.htm",
  402. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_select.htm",
  403. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_undo_complete.htm",
  404. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_unsuccessful.htm",
  405. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_unsuccessful2.htm",
  406. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_unsuccessful3.htm",
  407. L"hcp://services/layout/contentonly?topic=ms-its:%windir%\\help\\SR_ui.chm::/app_system_restore_welcome.htm",
  408. };
  409. static HscPanel local_LookupPanelName( /*[in]*/ BSTR bstrName )
  410. {
  411. if(bstrName)
  412. {
  413. if(!wcscmp( bstrName, s_szPanelName_NAVBAR )) return HSCPANEL_NAVBAR ;
  414. if(!wcscmp( bstrName, s_szPanelName_MININAVBAR)) return HSCPANEL_MININAVBAR;
  415. if(!wcscmp( bstrName, s_szPanelName_CONTEXT )) return HSCPANEL_CONTEXT ;
  416. if(!wcscmp( bstrName, s_szPanelName_CONTENTS )) return HSCPANEL_CONTENTS ;
  417. if(!wcscmp( bstrName, s_szPanelName_HHWINDOW )) return HSCPANEL_HHWINDOW ;
  418. }
  419. return HSCPANEL_INVALID;
  420. }
  421. static LPCWSTR local_ReverseLookupPanelName( /*[in]*/ HscPanel id )
  422. {
  423. switch(id)
  424. {
  425. case HSCPANEL_NAVBAR : return s_szPanelName_NAVBAR ;
  426. case HSCPANEL_MININAVBAR: return s_szPanelName_MININAVBAR;
  427. case HSCPANEL_CONTEXT : return s_szPanelName_CONTEXT ;
  428. case HSCPANEL_CONTENTS : return s_szPanelName_CONTENTS ;
  429. case HSCPANEL_HHWINDOW : return s_szPanelName_HHWINDOW ;
  430. }
  431. return NULL;
  432. }
  433. static HRESULT local_ReloadPanel( /*[in]*/ IMarsPanel* pPanel )
  434. {
  435. __HCP_FUNC_ENTRY( "local_ReloadPanel" );
  436. HRESULT hr;
  437. if(pPanel)
  438. {
  439. CComPtr<IDispatch> disp;
  440. CComQIPtr<IWebBrowser2> wb2;
  441. CComQIPtr<IHTMLDocument2> doc2;
  442. __MPC_EXIT_IF_METHOD_FAILS(hr, pPanel->get_content( &disp ));
  443. wb2 = disp;
  444. if(wb2)
  445. {
  446. disp.Release();
  447. __MPC_EXIT_IF_METHOD_FAILS(hr, wb2->get_Document( &disp ));
  448. }
  449. doc2 = disp;
  450. if(doc2)
  451. {
  452. CComPtr<IHTMLLocation> spLoc;
  453. __MPC_EXIT_IF_METHOD_FAILS(hr, doc2->get_location( &spLoc ));
  454. if(spLoc)
  455. {
  456. __MPC_EXIT_IF_METHOD_FAILS(hr, spLoc->reload( VARIANT_TRUE ));
  457. __MPC_SET_ERROR_AND_EXIT(hr, S_OK);
  458. }
  459. }
  460. }
  461. hr = E_NOINTERFACE;
  462. __HCP_FUNC_CLEANUP;
  463. __HCP_FUNC_EXIT(hr);
  464. }
  465. ////////////////////////////////////////////////////////////////////////////////
  466. static HRESULT local_ReloadStyle( /*[in]*/ IHTMLWindow2* win )
  467. {
  468. __HCP_FUNC_ENTRY( "local_ReloadStyle" );
  469. HRESULT hr;
  470. CComPtr<IHTMLDocument2> doc;
  471. CComPtr<IHTMLStyleSheetsCollection> styles;
  472. VARIANT vIdx;
  473. long lNumStyles;
  474. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(doc , win , document );
  475. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(styles , doc , styleSheets);
  476. MPC_SCRIPTHELPER_GET__DIRECT (lNumStyles, styles, length );
  477. vIdx.vt = VT_I4;
  478. for(vIdx.lVal=0; vIdx.lVal<lNumStyles; vIdx.lVal++)
  479. {
  480. CComQIPtr<IHTMLStyleSheet> css;
  481. CComVariant v;
  482. __MPC_EXIT_IF_METHOD_FAILS(hr, styles->item( &vIdx, &v ));
  483. if(v.vt == VT_DISPATCH && (css = v.pdispVal))
  484. {
  485. CComBSTR bstrHREF;
  486. MPC_SCRIPTHELPER_GET__DIRECT(bstrHREF, css, href);
  487. if(!MPC::StrICmp( bstrHREF, L"hcp://system/css/shared.css" ))
  488. {
  489. MPC_SCRIPTHELPER_PUT__DIRECT(css, href, bstrHREF);
  490. break;
  491. }
  492. }
  493. }
  494. hr = S_OK;
  495. __HCP_FUNC_CLEANUP;
  496. __HCP_FUNC_EXIT(hr);
  497. }
  498. static HRESULT local_ApplySettings( /*[in]*/ IDispatch* disp )
  499. {
  500. __HCP_FUNC_ENTRY( "local_ApplySettings" );
  501. HRESULT hr;
  502. CComPtr<IHTMLDocument2> doc;
  503. CComPtr<IHTMLWindow2> win;
  504. CComPtr<IHTMLWindow2> winTop;
  505. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::HTML::IDispatch_To_IHTMLDocument2( doc, disp ));
  506. MPC_SCRIPTHELPER_GET__DIRECT(win , doc, parentWindow);
  507. MPC_SCRIPTHELPER_GET__DIRECT(winTop, win, top );
  508. __MPC_EXIT_IF_METHOD_FAILS(hr, local_ReloadStyle( winTop ));
  509. {
  510. CComPtr<IHTMLFramesCollection2> frames;
  511. VARIANT vIdx;
  512. long lNumFrames;
  513. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(frames , winTop, frames);
  514. MPC_SCRIPTHELPER_GET__DIRECT (lNumFrames, frames, length);
  515. vIdx.vt = VT_I4;
  516. for(vIdx.lVal=0; vIdx.lVal<lNumFrames; vIdx.lVal++)
  517. {
  518. CComQIPtr<IHTMLWindow2> frame;
  519. CComVariant v;
  520. __MPC_EXIT_IF_METHOD_FAILS(hr, frames->item( &vIdx, &v ));
  521. if(v.vt == VT_DISPATCH && (frame = v.pdispVal))
  522. {
  523. __MPC_EXIT_IF_METHOD_FAILS(hr, local_ReloadStyle( frame ));
  524. }
  525. }
  526. }
  527. hr = S_OK;
  528. __HCP_FUNC_CLEANUP;
  529. __HCP_FUNC_EXIT(hr);
  530. }
  531. ////////////////////////////////////////////////////////////////////////////////
  532. static HRESULT local_GetProperty( /*[in ]*/ CComDispatchDriver& driver ,
  533. /*[in ]*/ LPCWSTR szName ,
  534. /*[out]*/ CComVariant& v )
  535. {
  536. v.Clear();
  537. return driver.GetPropertyByName( CComBSTR( szName ), &v );
  538. }
  539. static HRESULT local_GetProperty( /*[in ]*/ CComDispatchDriver& driver ,
  540. /*[in ]*/ LPCWSTR szName ,
  541. /*[out]*/ MPC::wstring& res )
  542. {
  543. HRESULT hr;
  544. CComVariant v;
  545. res.erase();
  546. if(SUCCEEDED(hr = local_GetProperty( driver, szName, v )))
  547. {
  548. if(SUCCEEDED(hr = v.ChangeType( VT_BSTR )))
  549. {
  550. res = SAFEBSTR(v.bstrVal);
  551. }
  552. }
  553. return hr;
  554. }
  555. static HRESULT local_GetProperty( /*[in ]*/ CComDispatchDriver& driver ,
  556. /*[in ]*/ LPCWSTR szName ,
  557. /*[out]*/ long& res )
  558. {
  559. HRESULT hr;
  560. CComVariant v;
  561. res = 0;
  562. if(SUCCEEDED(hr = local_GetProperty( driver, szName, v )))
  563. {
  564. if(SUCCEEDED(hr = v.ChangeType( VT_I4 )))
  565. {
  566. res = v.lVal;
  567. }
  568. }
  569. return hr;
  570. }
  571. static bool local_IsValidTopicURL(BSTR bstrUrl)
  572. {
  573. __HCP_FUNC_ENTRY( "local_IsValidTopicURL" );
  574. CComPtr<IPCHTaxonomyDatabase> db;
  575. CComPtr<IPCHCollection> coll;
  576. CComVariant v;
  577. long lCount;
  578. bool fValid = false;
  579. HRESULT hr;
  580. // Grant trust
  581. CPCHHelpCenterExternal::TLS* tlsOld = CPCHHelpCenterExternal::s_GLOBAL->GetTLS();
  582. CPCHHelpCenterExternal::TLS tlsNew; CPCHHelpCenterExternal::s_GLOBAL->SetTLS( &tlsNew );
  583. tlsNew.m_fSystem = true;
  584. tlsNew.m_fTrusted = true;
  585. // Lookup database
  586. __MPC_EXIT_IF_METHOD_FAILS(hr, CPCHHelpCenterExternal::s_GLOBAL->get_Database(&db));
  587. __MPC_EXIT_IF_METHOD_FAILS(hr, db->LocateContext(bstrUrl, v, &coll));
  588. __MPC_EXIT_IF_METHOD_FAILS(hr, coll->get_Count(&lCount));
  589. if (lCount >= 1) fValid = true;
  590. __HCP_FUNC_CLEANUP;
  591. // Restore trust
  592. CPCHHelpCenterExternal::s_GLOBAL->SetTLS( tlsOld );
  593. __HCP_FUNC_EXIT(fValid);
  594. }
  595. static bool local_IsValidEntryURL(BSTR bstrUrl)
  596. {
  597. HyperLinks::ParsedUrl pu;
  598. CComBSTR bstrTopic;
  599. bool fValid = true;
  600. if (!bstrUrl) return false;
  601. pu.Initialize(bstrUrl);
  602. switch (pu.m_fmt)
  603. {
  604. case HyperLinks::FMT_CENTER_HOMEPAGE : // hcp://services/centers/homepage
  605. break;
  606. case HyperLinks::FMT_CENTER_SUPPORT : // hcp://services/centers/support
  607. case HyperLinks::FMT_CENTER_OPTIONS : // hcp://services/centers/options
  608. case HyperLinks::FMT_CENTER_UPDATE : // hcp://services/centers/update
  609. case HyperLinks::FMT_CENTER_COMPAT : // hcp://services/centers/compat
  610. case HyperLinks::FMT_CENTER_TOOLS : // hcp://services/centers/tools
  611. case HyperLinks::FMT_CENTER_ERRMSG : // hcp://services/centers/errmsg
  612. case HyperLinks::FMT_SEARCH : // hcp://services/search?query=<text to look up>
  613. case HyperLinks::FMT_INDEX : // hcp://services/index?application=<optional island of help ID>
  614. case HyperLinks::FMT_SUBSITE : // hcp://services/subsite?node=<subsite location>&topic=<url of the topic to display>&select=<subnode to highlight>
  615. case HyperLinks::FMT_LAYOUT_FULLWINDOW : // hcp://services/layout/fullwindow?topic=<url of the topic to display>
  616. case HyperLinks::FMT_LAYOUT_CONTENTONLY : // hcp://services/layout/contentonly?topic=<url of the topic to display>
  617. case HyperLinks::FMT_LAYOUT_KIOSK : // hcp://services/layout/kiosk?topic=<url of the topic to display>
  618. if (pu.GetQueryField(L"topic", bstrTopic))
  619. fValid = local_IsValidTopicURL(bstrTopic);
  620. break;
  621. case HyperLinks::FMT_REDIRECT : // hcp://services/redirect?online=<url>&offline=<backup url>
  622. if (pu.GetQueryField(L"online", bstrTopic))
  623. fValid = local_IsValidTopicURL(bstrTopic);
  624. if (fValid && pu.GetQueryField(L"offline", bstrTopic))
  625. fValid = local_IsValidTopicURL(bstrTopic);
  626. break;
  627. default:
  628. fValid = false;
  629. break;
  630. }
  631. if (!fValid)
  632. {
  633. // Check explicit entry URLs
  634. for (int i=0; i<sizeof(c_szEntryUrls)/sizeof(c_szEntryUrls[0]); i++)
  635. {
  636. if (_wcsicmp(bstrUrl, c_szEntryUrls[i]) == 0)
  637. {
  638. fValid = true; break;
  639. }
  640. }
  641. }
  642. if (!fValid)
  643. {
  644. // Check explicit entry URLs (partial)
  645. for (int i=0; i<sizeof(c_szEntryUrlsPartial)/sizeof(c_szEntryUrlsPartial[0]); i++)
  646. {
  647. if (wcslen(bstrUrl) >= wcslen(c_szEntryUrlsPartial[i]) &&
  648. _wcsnicmp(bstrUrl, c_szEntryUrlsPartial[i], wcslen(c_szEntryUrlsPartial[i])) == 0)
  649. {
  650. fValid = true; break;
  651. }
  652. }
  653. }
  654. if (!fValid)
  655. {
  656. // Check explicit entry URLs (env expanded)
  657. for (int i=0; i<sizeof(c_szEntryUrlsEnv)/sizeof(c_szEntryUrlsEnv[0]); i++)
  658. {
  659. MPC::wstring strExpanded( c_szEntryUrlsEnv[i] ); MPC::SubstituteEnvVariables( strExpanded );
  660. if (_wcsicmp(bstrUrl, strExpanded.c_str()) == 0)
  661. {
  662. fValid = true; break;
  663. }
  664. }
  665. }
  666. return fValid;
  667. }
  668. ////////////////////////////////////////////////////////////////////////////////
  669. CPCHHelpCenterExternal::DelayedExecution::DelayedExecution()
  670. {
  671. mode = DELAYMODE_INVALID; // DelayedExecutionMode mode;
  672. //
  673. iVal = HSCCONTEXT_INVALID; // HscContext iVal;
  674. // CComBSTR bstrInfo;
  675. // CComBSTR bstrURL;
  676. fAlsoContent = false; // bool fAlsoContent;
  677. }
  678. CPCHHelpCenterExternal::CPCHHelpCenterExternal() : m_constHELPCTR( &LIBID_HelpCenterTypeLib ),
  679. m_constHELPSVC( &LIBID_HelpServiceTypeLib )
  680. {
  681. m_fFromStartHelp = false; // bool m_fFromStartHelp;
  682. m_fLayout = false; // bool m_fLayout;
  683. m_fWindowVisible = true; // bool m_fWindowVisible;
  684. m_fControlled = false; // bool m_fControlled;
  685. m_fPersistSettings = false; // bool m_fPersistSettings;
  686. m_fHidden = false; // bool m_fHidden;
  687. //
  688. // CComBSTR m_bstrExtraArgument
  689. m_HelpHostCfg = NULL; // HelpHost::XMLConfig* m_HelpHostCfg;
  690. // CComBSTR m_bstrStartURL;
  691. // CComBSTR m_bstrCurrentPlace;
  692. m_pMTP = NULL; // MARSTHREADPARAM* m_pMTP;
  693. //
  694. // MPC::CComConstantHolder m_constHELPCTR;
  695. // MPC::CComConstantHolder m_constHELPSVC;
  696. //
  697. //////////////////////////////////////////////////////////////////////////////////////////////////////
  698. //
  699. // CPCHSecurityHandle m_SecurityHandle;
  700. m_tlsID = -1; // DWORD m_tlsID;
  701. m_fPassivated = false; // bool m_fPassivated;
  702. m_fShuttingDown = false; // bool m_fShuttingDown;
  703. //
  704. // CComPtr<HelpHost::Main> m_HelpHost;
  705. //
  706. // CComPtr<CPCHHelpSession> m_hs;
  707. // CComPtr<CPCHSecurityManager> m_SECMGR;
  708. // CComPtr<CPCHElementBehaviorFactory> m_BEHAV;
  709. // CComPtr<CPCHHelper_IDocHostUIHandler> m_DOCUI;
  710. //
  711. m_Service = NULL; // CPCHProxy_IPCHService* m_Service;
  712. m_Utility = NULL; // CPCHProxy_IPCHUtility* m_Utility;
  713. m_UserSettings = NULL; // CPCHProxy_IPCHUserSettings2* m_UserSettings;
  714. //
  715. m_panel_ThreadID = -1; // DWORD m_panel_ThreadID;
  716. //
  717. // CComPtr<IMarsPanel> m_panel_NAVBAR;
  718. // CComPtr<IMarsPanel> m_panel_MININAVBAR;
  719. //
  720. // CComPtr<IMarsPanel> m_panel_CONTEXT;
  721. // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_CONTEXT_WebBrowser;
  722. // CPCHWebBrowserEvents m_panel_CONTEXT_Events;
  723. //
  724. // CComPtr<IMarsPanel> m_panel_CONTENTS;
  725. // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_CONTENTS_WebBrowser;
  726. // CPCHWebBrowserEvents m_panel_CONTENTS_Events;
  727. //
  728. // CComPtr<IMarsPanel> m_panel_HHWINDOW;
  729. // CComPtr<IPCHHelpViewerWrapper> m_panel_HHWINDOW_Wrapper;
  730. // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_HHWINDOW_WebBrowser;
  731. // CPCHWebBrowserEvents m_panel_HHWINDOW_Events;
  732. //
  733. // CComPtr<IMarsWindowOM> m_shell;
  734. // CComPtr<ITimer> m_timer;
  735. // CPCHTimerHandle m_DisplayTimer;
  736. //
  737. m_dwInBeforeNavigate = 0; // DWORD m_dwInBeforeNavigate;
  738. // DelayedExecList m_DelayedActions;
  739. // CPCHTimerHandle m_ActionsTimer;
  740. //
  741. m_hwnd = NULL; // HWND m_hwnd;
  742. // CPCHEvents m_Events;
  743. //
  744. // MsgProcList m_lstMessageCrackers;
  745. }
  746. CPCHHelpCenterExternal::~CPCHHelpCenterExternal()
  747. {
  748. if(m_tlsID != -1)
  749. {
  750. ::TlsFree( m_tlsID );
  751. m_tlsID = -1;
  752. }
  753. (void)Passivate();
  754. MPC::_MPC_Module.UnregisterCallback( this );
  755. }
  756. ////////////////////
  757. CPCHHelpCenterExternal* CPCHHelpCenterExternal::s_GLOBAL( NULL );
  758. HRESULT CPCHHelpCenterExternal::InitializeSystem()
  759. {
  760. if(s_GLOBAL) return S_OK;
  761. return MPC::CreateInstance( &CPCHHelpCenterExternal::s_GLOBAL );
  762. }
  763. void CPCHHelpCenterExternal::FinalizeSystem()
  764. {
  765. if(s_GLOBAL)
  766. {
  767. s_GLOBAL->Release(); s_GLOBAL = NULL;
  768. }
  769. }
  770. ////////////////////
  771. bool CPCHHelpCenterExternal::IsServiceRunning()
  772. {
  773. bool fResult = false;
  774. SC_HANDLE hSCM;
  775. //
  776. // First, let's try to query the service status.
  777. //
  778. if((hSCM = ::OpenSCManager( NULL, NULL, GENERIC_READ )))
  779. {
  780. SC_HANDLE hService;
  781. if((hService = ::OpenServiceW( hSCM, HC_HELPSVC_NAME, SERVICE_QUERY_STATUS )))
  782. {
  783. SERVICE_STATUS ss;
  784. if(::QueryServiceStatus( hService, &ss ))
  785. {
  786. if(ss.dwCurrentState == SERVICE_RUNNING)
  787. {
  788. fResult = true;
  789. }
  790. }
  791. ::CloseServiceHandle( hService );
  792. }
  793. ::CloseServiceHandle( hSCM );
  794. }
  795. //
  796. // Then, let's make sure it's not DISABLED.
  797. //
  798. if((hSCM = ::OpenSCManager( NULL, NULL, GENERIC_READ )))
  799. {
  800. SC_HANDLE hService;
  801. if((hService = ::OpenServiceW( hSCM, HC_HELPSVC_NAME, SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG )))
  802. {
  803. BYTE rgBuf[2048];
  804. DWORD dwLen;
  805. LPQUERY_SERVICE_CONFIGW cfg = (LPQUERY_SERVICE_CONFIG)rgBuf;
  806. if(::QueryServiceConfigW( hService, cfg, sizeof(rgBuf), &dwLen ) && cfg->dwStartType == SERVICE_DISABLED)
  807. {
  808. if(::ChangeServiceConfigW( hService , // handle to service
  809. cfg->dwServiceType , // type of service
  810. SERVICE_AUTO_START , // when to start service
  811. cfg->dwErrorControl , // severity of start failure
  812. NULL , // service binary file name
  813. NULL , // load ordering group name
  814. NULL , // tag identifier
  815. NULL , // array of dependency names
  816. NULL , // account name
  817. NULL , // account password
  818. cfg->lpDisplayName )) // display name
  819. {
  820. }
  821. }
  822. ::CloseServiceHandle( hService );
  823. }
  824. ::CloseServiceHandle( hSCM );
  825. }
  826. //
  827. // In case it's not running, let's try to start it.
  828. //
  829. if(fResult == false)
  830. {
  831. if((hSCM = ::OpenSCManager( NULL, NULL, GENERIC_READ )))
  832. {
  833. SC_HANDLE hService;
  834. if((hService = ::OpenServiceW( hSCM, HC_HELPSVC_NAME, SERVICE_START )))
  835. {
  836. if(::StartService( hService, 0, NULL ))
  837. {
  838. fResult = true;
  839. }
  840. ::CloseServiceHandle( hService );
  841. }
  842. ::CloseServiceHandle( hSCM );
  843. }
  844. }
  845. //
  846. // Last resort, try to connect to HelpSvc.
  847. //
  848. if(fResult == false)
  849. {
  850. CComPtr<IPCHService> svc;
  851. if(m_Service && SUCCEEDED(m_Service->EnsureDirectConnection( svc, false )))
  852. {
  853. fResult = true;
  854. }
  855. }
  856. return fResult;
  857. }
  858. HRESULT CPCHHelpCenterExternal::Initialize()
  859. {
  860. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::Initialize" );
  861. HRESULT hr;
  862. CLSID clsid = CLSID_PCHHelpCenter;
  863. //
  864. // Register for shutdown.
  865. //
  866. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::_MPC_Module.RegisterCallback( this, (void (CPCHHelpCenterExternal::*)())Passivate ));
  867. m_SecurityHandle.Initialize( this, (IPCHHelpCenterExternal*)this );
  868. //
  869. // Thread Local Storage.
  870. //
  871. m_tlsID = ::TlsAlloc();
  872. if(m_tlsID == -1)
  873. {
  874. __MPC_SET_WIN32_ERROR_AND_EXIT(hr, ERROR_NO_SYSTEM_RESOURCES);
  875. }
  876. SetTLS( NULL );
  877. //
  878. // Create Browser Events handlers.
  879. //
  880. m_panel_CONTEXT_Events .Initialize( this, HSCPANEL_CONTEXT );
  881. m_panel_CONTENTS_Events.Initialize( this, HSCPANEL_CONTENTS );
  882. m_panel_HHWINDOW_Events.Initialize( this, HSCPANEL_HHWINDOW );
  883. m_Events .Initialize( this );
  884. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_hs )); m_hs ->Initialize( this );
  885. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_SECMGR )); m_SECMGR->Initialize( this );
  886. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_BEHAV )); m_BEHAV ->Initialize( this );
  887. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_DOCUI )); m_DOCUI ->Initialize( this );
  888. //
  889. // Create the HelpHost objects.
  890. //
  891. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_HelpHost )); __MPC_EXIT_IF_METHOD_FAILS(hr, m_HelpHost->Initialize( this ));
  892. //
  893. // Create all the proxies.
  894. //
  895. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_Service ));
  896. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Service->ConnectToParent ( this ));
  897. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Service->GetUtility ( &m_Utility ));
  898. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Utility->GetUserSettings2( &m_UserSettings ));
  899. hr = S_OK;
  900. __HCP_FUNC_CLEANUP;
  901. __HCP_FUNC_EXIT(hr);
  902. }
  903. void CPCHHelpCenterExternal::Passivate()
  904. {
  905. MPC::ReleaseAll( m_lstMessageCrackers );
  906. if(m_fPassivated == false)
  907. {
  908. if(DoesPersistSettings())
  909. {
  910. if(m_hs) (void)m_hs->Persist();
  911. }
  912. else
  913. {
  914. //
  915. // Signal the option object to ignore SKU info during save.
  916. //
  917. if(CPCHOptions::s_GLOBAL) CPCHOptions::s_GLOBAL->DontPersistSKU();
  918. }
  919. if(m_UserSettings) (void)m_UserSettings->SaveUserSettings();
  920. if(CPCHOptions::s_GLOBAL) CPCHOptions::s_GLOBAL->Save();
  921. }
  922. ////////////////////////////////////////////////////////////////////////////////
  923. m_fPassivated = true;
  924. delete m_HelpHostCfg; m_HelpHostCfg = NULL;
  925. if(m_HelpHost) m_HelpHost->Passivate();
  926. if(m_Service ) m_Service ->Passivate();
  927. m_panel_CONTEXT_Events .Passivate();
  928. m_panel_CONTENTS_Events.Passivate();
  929. m_panel_HHWINDOW_Events.Passivate();
  930. m_Events .Passivate();
  931. m_DisplayTimer.Stop();
  932. m_ActionsTimer.Stop();
  933. ////////////////////////////////////////////////////////////////////////////////
  934. // bool m_fFromStartHelp;
  935. // bool m_fLayout;
  936. // bool m_fWindowVisible;
  937. // bool m_fControlled;
  938. // bool m_fPersistSettings;
  939. // bool m_fHidden;
  940. //
  941. // CComBSTR m_bstrExtraArgument
  942. // HelpHost::XMLConfig* m_HelpHostCfg;
  943. // CComBSTR m_bstrStartURL;
  944. // CComBSTR m_bstrCurrentPlace;
  945. // MARSTHREADPARAM* m_pMTP;
  946. //
  947. // MPC::CComConstantHolder m_constHELPCTR;
  948. // MPC::CComConstantHolder m_constHELPSVC;
  949. //
  950. // ////////////////////////////////////////
  951. //
  952. // CPCHSecurityHandle m_SecurityHandle;
  953. // DWORD m_tlsID;
  954. // bool m_fPassivated;
  955. //
  956. m_HelpHost .Release(); // CComPtr<HelpHost::Main> m_HelpHost;
  957. //
  958. m_hs .Release(); // CComPtr<CPCHHelpSession> m_hs;
  959. // CComPtr<CPCHSecurityManager> m_SECMGR;
  960. // CComPtr<CPCHElementBehaviorFactory> m_BEHAV;
  961. // CComPtr<CPCHHelper_IDocHostUIHandler> m_DOCUI;
  962. //
  963. MPC::Release2<IPCHService >( m_Service ); // CPCHProxy_IPCHService* m_Service;
  964. MPC::Release2<IPCHUtility >( m_Utility ); // CPCHProxy_IPCHUtility* m_Utility;
  965. MPC::Release2<IPCHUserSettings2>( m_UserSettings ); // CPCHProxy_IPCHUserSettings2* m_UserSettings;
  966. //
  967. m_panel_ThreadID = -1; // DWORD m_panel_ThreadID;
  968. //
  969. m_panel_NAVBAR .Release(); // CComPtr<IMarsPanel> m_panel_NAVBAR;
  970. m_panel_MININAVBAR .Release(); // CComPtr<IMarsPanel> m_panel_MININAVBAR;
  971. //
  972. m_panel_CONTEXT .Release(); // CComPtr<IMarsPanel> m_panel_CONTEXT;
  973. m_panel_CONTEXT_WebBrowser .Release(); // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_CONTEXT_WebBrowser;
  974. // CPCHWebBrowserEvents m_panel_CONTEXT_Events;
  975. //
  976. m_panel_CONTENTS .Release(); // CComPtr<IMarsPanel> m_panel_CONTENTS;
  977. m_panel_CONTENTS_WebBrowser .Release(); // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_CONTENTS_WebBrowser;
  978. // CPCHWebBrowserEvents m_panel_CONTENTS_Events;
  979. //
  980. m_panel_HHWINDOW .Release(); // CComPtr<IMarsPanel> m_panel_HHWINDOW;
  981. m_panel_HHWINDOW_Wrapper .Release(); // CComPtr<IPCHHelpViewerWrapper> m_panel_HHWINDOW_Wrapper;
  982. m_panel_HHWINDOW_WebBrowser .Release(); // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_HHWINDOW_WebBrowser;
  983. // CPCHWebBrowserEvents m_panel_HHWINDOW_Events;
  984. //
  985. m_shell .Release(); // CComPtr<IMarsWindowOM> m_shell;
  986. m_timer .Release(); // CComPtr<ITimer> m_timer;
  987. // CPCHTimerHandle m_DisplayTimer;
  988. //
  989. // DWORD m_dwInBeforeNavigate;
  990. // DelayedExecList m_DelayedActions;
  991. // CPCHTimerHandle m_ActionsTimer;
  992. //
  993. m_hwnd = NULL; // HWND m_hwnd;
  994. // CPCHEvents m_Events;
  995. m_SecurityHandle.Passivate();
  996. }
  997. ////////////////////////////////////////////////////////////////////////////////
  998. HRESULT CPCHHelpCenterExternal::ProcessLayoutXML( /*[in]*/ LPCWSTR szURL )
  999. {
  1000. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::ProcessLayoutXML" );
  1001. HRESULT hr;
  1002. delete m_HelpHostCfg; __MPC_EXIT_IF_ALLOC_FAILS(hr, m_HelpHostCfg, new HelpHost::XMLConfig);
  1003. if(FAILED(MPC::Config::LoadFile( m_HelpHostCfg, szURL )))
  1004. {
  1005. delete m_HelpHostCfg; m_HelpHostCfg = NULL;
  1006. m_fLayout = false;
  1007. }
  1008. else
  1009. {
  1010. m_fLayout = true;
  1011. m_fPersistSettings = false;
  1012. }
  1013. hr = S_OK;
  1014. __HCP_FUNC_CLEANUP;
  1015. __HCP_FUNC_EXIT(hr);
  1016. }
  1017. HRESULT CPCHHelpCenterExternal::ProcessArgument( /*[in]*/ int& pos, /*[in]*/ LPCWSTR szArg, /*[in]*/ const int argc, /*[in]*/ LPCWSTR* const argv )
  1018. {
  1019. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::ProcessArgument" );
  1020. static bool fFromHCP = false;
  1021. HRESULT hr;
  1022. // From HCP, no parameters other than Url are allowed
  1023. if (fFromHCP && _wcsicmp( szArg, L"Url" ) != 0)
  1024. __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1025. if(_wcsicmp( szArg, L"Url" ) == 0)
  1026. {
  1027. HyperLinks::ParsedUrl pu;
  1028. bool fValid = true;
  1029. if(pos >= argc) __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1030. m_bstrStartURL = argv[++pos];
  1031. if (fFromHCP) fValid = local_IsValidEntryURL(m_bstrStartURL);
  1032. if (fValid)
  1033. {
  1034. if(SUCCEEDED(pu.Initialize( m_bstrStartURL )) && pu.m_state == HyperLinks::STATE_NOTPROCESSED)
  1035. {
  1036. if(pu.m_fmt == HyperLinks::FMT_LAYOUT_XML)
  1037. {
  1038. CComBSTR bstrMode;
  1039. (void)pu.GetQueryField( L"topic" , m_bstrStartURL );
  1040. (void)pu.GetQueryField( L"definition", bstrMode );
  1041. (void)ProcessLayoutXML( bstrMode );
  1042. }
  1043. }
  1044. else
  1045. {
  1046. m_bstrStartURL.Empty();
  1047. }
  1048. }
  1049. else
  1050. {
  1051. CComBSTR bstrURL = m_bstrStartURL;
  1052. m_bstrStartURL = c_szURL_Err_BadUrl;
  1053. m_bstrStartURL.Append(L"?");
  1054. if (bstrURL) m_bstrStartURL.Append(bstrURL);
  1055. }
  1056. }
  1057. else if(_wcsicmp( szArg, L"ExtraArgument" ) == 0)
  1058. {
  1059. if(pos >= argc) __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1060. m_bstrExtraArgument = argv[++pos];
  1061. }
  1062. else if(_wcsicmp( szArg, L"Hidden" ) == 0)
  1063. {
  1064. m_fHidden = true;
  1065. m_fWindowVisible = false;
  1066. m_fPersistSettings = false;
  1067. }
  1068. else if(_wcsicmp( szArg, L"FromStartHelp" ) == 0)
  1069. {
  1070. m_fFromStartHelp = true;
  1071. m_fPersistSettings = true;
  1072. }
  1073. else if(_wcsicmp( szArg, L"Controlled" ) == 0)
  1074. {
  1075. if(pos >= argc) __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1076. {
  1077. CLSID clsid;
  1078. __MPC_EXIT_IF_METHOD_FAILS(hr, ::CLSIDFromString( CComBSTR( argv[++pos] ), &clsid ));
  1079. __MPC_EXIT_IF_METHOD_FAILS(hr, m_HelpHost->Register( clsid ));
  1080. }
  1081. m_fWindowVisible = false;
  1082. m_fControlled = true;
  1083. m_fPersistSettings = false;
  1084. }
  1085. else if(_wcsicmp( szArg, L"Mode" ) == 0)
  1086. {
  1087. if(pos >= argc) __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1088. (void)ProcessLayoutXML( argv[++pos] );
  1089. }
  1090. else if(_wcsicmp( szArg, L"FromHCP" ) == 0)
  1091. {
  1092. fFromHCP = true;
  1093. }
  1094. if(m_UserSettings)
  1095. {
  1096. __MPC_EXIT_IF_METHOD_FAILS(hr, m_UserSettings->Initialize());
  1097. }
  1098. hr = S_OK;
  1099. __HCP_FUNC_CLEANUP;
  1100. __HCP_FUNC_EXIT(hr);
  1101. }
  1102. bool CPCHHelpCenterExternal::DoWeNeedUI()
  1103. {
  1104. if(IsFromStartHelp ()) return true;
  1105. if(IsControlled ()) return true;
  1106. if(HasLayoutDefinition()) return true;
  1107. //
  1108. // In case we are called through the HCP: shell association, try to forward to an existing instance.
  1109. //
  1110. {
  1111. CComPtr<IPCHHelpHost> hhEXISTING;
  1112. CLSID clsid = CLSID_PCHHelpCenter;
  1113. if(SUCCEEDED(m_HelpHost->Locate( clsid, hhEXISTING )))
  1114. {
  1115. CComVariant v;
  1116. if(SUCCEEDED(hhEXISTING->DisplayTopicFromURL( m_bstrStartURL, v )))
  1117. {
  1118. return false;
  1119. }
  1120. }
  1121. (void)m_HelpHost->Register( clsid );
  1122. }
  1123. return true;
  1124. }
  1125. HRESULT CPCHHelpCenterExternal::RunUI( /*[in]*/ const MPC::wstring& szTitle, /*[in]*/ PFNMARSTHREADPROC pMarsThreadProc )
  1126. {
  1127. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::RunUI" );
  1128. HRESULT hr;
  1129. CComPtr<CPCHMarsHost> pchmh;
  1130. {
  1131. static LPCWSTR rgCriticalFiles[] =
  1132. {
  1133. L"blurbs/about_support.htm" ,
  1134. L"blurbs/Favorites.htm" ,
  1135. L"blurbs/ftshelp.htm" ,
  1136. L"blurbs/History.htm" ,
  1137. L"blurbs/Index.htm" ,
  1138. L"blurbs/isupport.htm" ,
  1139. L"blurbs/keywordhelp.htm" ,
  1140. L"blurbs/options.htm" ,
  1141. L"blurbs/searchblurb.htm" ,
  1142. L"blurbs/searchtips.htm" ,
  1143. L"blurbs/tools.htm" ,
  1144. L"blurbs/windows_newsgroups.htm" ,
  1145. L"css/Behaviors.css" ,
  1146. L"css/Layout.css" ,
  1147. L"dialogs/DlgLib.js" ,
  1148. L"dialogs/Print.dlg" ,
  1149. L"errors/badurl.htm" ,
  1150. L"errors/connection.htm" ,
  1151. L"errors/indexfirstlevel.htm" ,
  1152. L"errors/notfound.htm" ,
  1153. L"errors/offline.htm" ,
  1154. L"errors/redirect.htm" ,
  1155. L"errors/unreachable.htm" ,
  1156. L"Headlines.htm" ,
  1157. L"HelpCtr.mmf" ,
  1158. L"HomePage__DESKTOP.htm" ,
  1159. L"HomePage__SERVER.htm" ,
  1160. L"panels/AdvSearch.htm" ,
  1161. L"panels/blank.htm" ,
  1162. L"panels/Context.htm" ,
  1163. L"panels/firstpage.htm" ,
  1164. L"panels/HHWrapper.htm" ,
  1165. L"panels/MiniNavBar.htm" ,
  1166. L"panels/MiniNavBar.xml" ,
  1167. L"panels/NavBar.htm" ,
  1168. L"panels/NavBar.xml" ,
  1169. L"panels/Options.htm" ,
  1170. L"panels/RemoteHelp.htm" ,
  1171. L"panels/ShareHelp.htm" ,
  1172. L"panels/subpanels/Channels.htm" ,
  1173. L"panels/subpanels/Favorites.htm",
  1174. L"panels/subpanels/History.htm" ,
  1175. L"panels/subpanels/Index.htm" ,
  1176. L"panels/subpanels/Options.htm" ,
  1177. L"panels/subpanels/Search.htm" ,
  1178. L"panels/subpanels/Subsite.htm" ,
  1179. L"panels/Topics.htm" ,
  1180. L"scripts/Common.js" ,
  1181. L"scripts/HomePage__DESKTOP.js" ,
  1182. L"scripts/HomePage__SERVER.js" ,
  1183. L"scripts/HomePage__SHARED.js" ,
  1184. L"scripts/wrapperparam.js" ,
  1185. };
  1186. HyperLinks::ParsedUrl pu;
  1187. bool fOk = true;
  1188. bool fFirstWinInetUse = true;
  1189. MPC::wstring strTmp;
  1190. for(int i=0; i<ARRAYSIZE(rgCriticalFiles); i++)
  1191. {
  1192. strTmp = L"hcp://system/";
  1193. strTmp += rgCriticalFiles[i];
  1194. if(SUCCEEDED(pu.Initialize( strTmp.c_str() )) && pu.CheckState( fFirstWinInetUse ) != HyperLinks::STATE_ALIVE)
  1195. {
  1196. fOk = false; break;
  1197. }
  1198. }
  1199. if(fOk == false)
  1200. {
  1201. CComPtr<IPCHService> svc;
  1202. if(m_Service == NULL) __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1203. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Service->EnsureDirectConnection( svc, false ));
  1204. __MPC_EXIT_IF_METHOD_FAILS(hr, svc->ForceSystemRestore());
  1205. }
  1206. }
  1207. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &pchmh ));
  1208. __MPC_EXIT_IF_METHOD_FAILS(hr, pchmh->Init( this, szTitle, m_pMTP ));
  1209. __MPC_EXIT_IF_METHOD_FAILS(hr, pMarsThreadProc( pchmh, m_pMTP ));
  1210. hr = S_OK;
  1211. __HCP_FUNC_CLEANUP;
  1212. Passivate();
  1213. __HCP_FUNC_EXIT(hr);
  1214. }
  1215. ////////////////////////////////////////////////////////////////////////////////
  1216. CPCHHelpCenterExternal::TLS* CPCHHelpCenterExternal::GetTLS()
  1217. {
  1218. if(m_tlsID != -1)
  1219. {
  1220. return (TLS*)::TlsGetValue( m_tlsID );
  1221. }
  1222. return NULL;
  1223. }
  1224. void CPCHHelpCenterExternal::SetTLS( TLS* tls )
  1225. {
  1226. if(m_tlsID != -1)
  1227. {
  1228. ::TlsSetValue( m_tlsID, (LPVOID)tls );
  1229. }
  1230. }
  1231. HRESULT CPCHHelpCenterExternal::IsTrusted()
  1232. {
  1233. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::IsTrusted" );
  1234. HRESULT hr = E_ACCESSDENIED;
  1235. TLS* tls = GetTLS();
  1236. if(tls)
  1237. {
  1238. if(tls->m_fTrusted ||
  1239. tls->m_fSystem )
  1240. {
  1241. hr = S_OK;
  1242. }
  1243. }
  1244. __HCP_FUNC_EXIT(hr);
  1245. }
  1246. HRESULT CPCHHelpCenterExternal::IsSystem()
  1247. {
  1248. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::IsSystem" );
  1249. HRESULT hr = E_ACCESSDENIED;
  1250. TLS* tls = GetTLS();
  1251. if(tls)
  1252. {
  1253. if(tls->m_fSystem)
  1254. {
  1255. hr = S_OK;
  1256. }
  1257. }
  1258. __HCP_FUNC_EXIT(hr);
  1259. }
  1260. ////////////////////////////////////////////////////////////////////////////////
  1261. STDMETHODIMP CPCHHelpCenterExternal::RegisterForMessages( /*[in]*/ IOleInPlaceObjectWindowless* ptr, /*[in]*/ bool fRemove )
  1262. {
  1263. MsgProcIter it;
  1264. if(!ptr) return E_POINTER;
  1265. for(it = m_lstMessageCrackers.begin(); it != m_lstMessageCrackers.end(); it++)
  1266. {
  1267. if(*it == ptr)
  1268. {
  1269. ptr->Release();
  1270. m_lstMessageCrackers.erase( it );
  1271. break;
  1272. }
  1273. }
  1274. if(fRemove == false)
  1275. {
  1276. ptr->AddRef();
  1277. m_lstMessageCrackers.push_back( ptr );
  1278. }
  1279. return S_OK;
  1280. }
  1281. STDMETHODIMP CPCHHelpCenterExternal::ProcessMessage( /*[in]*/ MSG* msg )
  1282. {
  1283. if(msg->message == WM_SYSCHAR ||
  1284. msg->message == WM_SYSCOMMAND ||
  1285. msg->message == WM_SETTINGCHANGE ) // (weizhao) Relay WM_SETTINGCHANGE messages to registered windows
  1286. // (i.e. HTMLToolBar activeX controls) for appropriate handling.
  1287. {
  1288. MsgProcIter it;
  1289. for(it = m_lstMessageCrackers.begin(); it != m_lstMessageCrackers.end(); it++)
  1290. {
  1291. LRESULT lres;
  1292. if((*it)->OnWindowMessage( msg->message, msg->wParam, msg->lParam, &lres ) == S_OK)
  1293. {
  1294. return S_OK;
  1295. }
  1296. }
  1297. }
  1298. return E_NOTIMPL;
  1299. }
  1300. /////////////////////////////////////////////////////////////////////////////
  1301. HRESULT CPCHHelpCenterExternal::SetTLSAndInvoke( /*[in] */ IDispatch* obj ,
  1302. /*[in] */ DISPID id ,
  1303. /*[in] */ LCID lcid ,
  1304. /*[in] */ WORD wFlags ,
  1305. /*[in] */ DISPPARAMS* pdp ,
  1306. /*[out]*/ VARIANT* pvarRes ,
  1307. /*[out]*/ EXCEPINFO* pei ,
  1308. /*[in] */ IServiceProvider* pspCaller )
  1309. {
  1310. HRESULT hr;
  1311. TLS* tlsOld = GetTLS();
  1312. TLS tlsNew; SetTLS( &tlsNew );
  1313. //
  1314. // Let's see if the caller support the IHTMLDocument2 interface...
  1315. //
  1316. if(pspCaller && m_fPassivated == false)
  1317. {
  1318. (void)pspCaller->QueryService( SID_SContainerDispatch, IID_IHTMLDocument2, (void**)&tlsNew.m_Doc );
  1319. (void)pspCaller->QueryService( IID_IWebBrowserApp , IID_IWebBrowser2 , (void**)&tlsNew.m_WB );
  1320. if(tlsNew.m_Doc)
  1321. {
  1322. CComBSTR bstrURL;
  1323. //
  1324. // Yes! So get the URL and set the TRUSTED flag.
  1325. //
  1326. if(SUCCEEDED(tlsNew.m_Doc->get_URL( &bstrURL )))
  1327. {
  1328. tlsNew.m_fTrusted = m_SECMGR->IsUrlTrusted( SAFEBSTR( bstrURL ), &tlsNew.m_fSystem );
  1329. }
  1330. }
  1331. }
  1332. hr = obj->Invoke( id, IID_NULL, lcid, wFlags, pdp, pvarRes, pei, NULL );
  1333. SetTLS( tlsOld );
  1334. return hr;
  1335. }
  1336. /////////////////////////////////////////////////////////////////////////////
  1337. STDMETHODIMP CPCHHelpCenterExternal::GetIDsOfNames( REFIID riid ,
  1338. LPOLESTR* rgszNames ,
  1339. UINT cNames ,
  1340. LCID lcid ,
  1341. DISPID* rgdispid )
  1342. {
  1343. HRESULT hr = self::GetIDsOfNames( riid ,
  1344. rgszNames ,
  1345. cNames ,
  1346. lcid ,
  1347. rgdispid );
  1348. if(FAILED(hr))
  1349. {
  1350. hr = m_constHELPCTR.GetIDsOfNames( rgszNames, cNames, lcid, rgdispid );
  1351. if(FAILED(hr))
  1352. {
  1353. hr = m_constHELPSVC.GetIDsOfNames( rgszNames, cNames, lcid, rgdispid );
  1354. }
  1355. }
  1356. return hr;
  1357. }
  1358. STDMETHODIMP CPCHHelpCenterExternal::Invoke( DISPID dispidMember ,
  1359. REFIID riid ,
  1360. LCID lcid ,
  1361. WORD wFlags ,
  1362. DISPPARAMS* pdispparams ,
  1363. VARIANT* pvarResult ,
  1364. EXCEPINFO* pexcepinfo ,
  1365. UINT* puArgErr )
  1366. {
  1367. HRESULT hr = self::Invoke( dispidMember ,
  1368. riid ,
  1369. lcid ,
  1370. wFlags ,
  1371. pdispparams ,
  1372. pvarResult ,
  1373. pexcepinfo ,
  1374. puArgErr );
  1375. if(FAILED(hr) && wFlags == DISPATCH_PROPERTYGET)
  1376. {
  1377. hr = m_constHELPCTR.GetValue( dispidMember, lcid, pvarResult );
  1378. if(FAILED(hr))
  1379. {
  1380. hr = m_constHELPSVC.GetValue( dispidMember, lcid, pvarResult );
  1381. }
  1382. }
  1383. return hr;
  1384. }
  1385. /////////////////////////////////////////////////////////////////////////////
  1386. HWND CPCHHelpCenterExternal::Window() const
  1387. {
  1388. return m_hwnd;
  1389. }
  1390. ITimer* CPCHHelpCenterExternal::Timer() const
  1391. {
  1392. return m_timer;
  1393. }
  1394. IMarsWindowOM* CPCHHelpCenterExternal::Shell() const
  1395. {
  1396. return m_shell;
  1397. }
  1398. IMarsPanel* CPCHHelpCenterExternal::Panel( /*[in]*/ HscPanel id ) const
  1399. {
  1400. switch(id)
  1401. {
  1402. case HSCPANEL_NAVBAR : return m_panel_NAVBAR ;
  1403. case HSCPANEL_MININAVBAR: return m_panel_MININAVBAR;
  1404. case HSCPANEL_CONTEXT : return m_panel_CONTEXT ;
  1405. case HSCPANEL_CONTENTS : return m_panel_CONTENTS ;
  1406. case HSCPANEL_HHWINDOW : return m_panel_HHWINDOW ;
  1407. }
  1408. return NULL;
  1409. }
  1410. LPCWSTR CPCHHelpCenterExternal::PanelName( /*[in]*/ HscPanel id ) const
  1411. {
  1412. return local_ReverseLookupPanelName( id );
  1413. }
  1414. //////////////////////////////
  1415. IWebBrowser2* CPCHHelpCenterExternal::Context()
  1416. {
  1417. IWebBrowser2* pRes = NULL;
  1418. (void)m_panel_CONTEXT_WebBrowser.Access( &pRes );
  1419. return pRes;
  1420. }
  1421. IWebBrowser2* CPCHHelpCenterExternal::Contents()
  1422. {
  1423. IWebBrowser2* pRes = NULL;
  1424. (void)m_panel_CONTENTS_WebBrowser.Access( &pRes );
  1425. return pRes;
  1426. }
  1427. IWebBrowser2* CPCHHelpCenterExternal::HHWindow()
  1428. {
  1429. IWebBrowser2* pRes = NULL;
  1430. (void)m_panel_HHWINDOW_WebBrowser.Access( &pRes );
  1431. return pRes;
  1432. }
  1433. bool CPCHHelpCenterExternal::IsHHWindowVisible()
  1434. {
  1435. CComPtr<IMarsPanel> panel;
  1436. VARIANT_BOOL fContentsVisible;
  1437. GetPanelDirect( HSCPANEL_HHWINDOW, panel );
  1438. if(panel && SUCCEEDED(panel->get_visible( &fContentsVisible )) && fContentsVisible == VARIANT_TRUE) return true;
  1439. return false;
  1440. }
  1441. ////////////////////////////////////////////////////////////////////////////////
  1442. HRESULT CPCHHelpCenterExternal::NavigateHH( /*[in]*/ LPCWSTR szURL )
  1443. {
  1444. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::NavigateHH" );
  1445. HRESULT hr;
  1446. MPC::wstring strUrlModified;
  1447. CPCHWrapProtocolInfo::NormalizeUrl( szURL, strUrlModified, /*fReverse*/false );
  1448. //
  1449. // Delayed execution if inside OnBeforeNavigate.
  1450. //
  1451. if(m_dwInBeforeNavigate)
  1452. {
  1453. DelayedExecution& de = DelayedExecutionAlloc();
  1454. de.mode = DELAYMODE_NAVIGATEHH;
  1455. de.bstrURL = strUrlModified.c_str();
  1456. __MPC_SET_ERROR_AND_EXIT(hr, DelayedExecutionStart());
  1457. }
  1458. if(!m_panel_HHWINDOW_Wrapper)
  1459. {
  1460. __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1461. }
  1462. __MPC_EXIT_IF_METHOD_FAILS(hr, m_panel_HHWINDOW_Wrapper->Navigate( CComBSTR( strUrlModified.c_str() ) ));
  1463. hr = S_OK;
  1464. __HCP_FUNC_CLEANUP;
  1465. __HCP_FUNC_EXIT(hr);
  1466. }
  1467. HRESULT CPCHHelpCenterExternal::SetPanelUrl( /*[in]*/ HscPanel id, /*[in]*/ LPCWSTR szURL )
  1468. {
  1469. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::SetPanelUrl" );
  1470. HRESULT hr;
  1471. //
  1472. // Delayed execution if inside OnBeforeNavigate.
  1473. //
  1474. if(m_dwInBeforeNavigate)
  1475. {
  1476. DelayedExecution& de = DelayedExecutionAlloc();
  1477. de.mode = DELAYMODE_NAVIGATEWEB;
  1478. de.bstrURL = szURL;
  1479. __MPC_SET_ERROR_AND_EXIT(hr, DelayedExecutionStart());
  1480. }
  1481. if(m_shell && szURL)
  1482. {
  1483. IMarsPanel* panel = Panel( id );
  1484. if(panel)
  1485. {
  1486. __MPC_EXIT_IF_METHOD_FAILS(hr, panel->navigate( CComVariant( szURL ), CComVariant() ));
  1487. }
  1488. else
  1489. {
  1490. CComPtr<IMarsPanel> panel2; GetPanelDirect( id, panel2 );
  1491. if(panel2)
  1492. {
  1493. (void)panel2->put_startUrl( CComBSTR( szURL ) );
  1494. }
  1495. }
  1496. }
  1497. hr = S_OK;
  1498. __HCP_FUNC_CLEANUP;
  1499. __HCP_FUNC_EXIT(hr);
  1500. }
  1501. HRESULT CPCHHelpCenterExternal::GetPanel( /*[in]*/ HscPanel id, /*[out]*/ IMarsPanel* *pVal, /*[in]*/ bool fEnsurePresence )
  1502. {
  1503. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::GetPanel" );
  1504. HRESULT hr;
  1505. IMarsPanel* *pPanel;
  1506. HelpHost::CompId idComp;
  1507. __MPC_PARAMCHECK_BEGIN(hr)
  1508. __MPC_PARAMCHECK_POINTER_AND_SET(pVal,NULL);
  1509. __MPC_PARAMCHECK_END();
  1510. //
  1511. // Only return the interface pointer if called from the same thread...
  1512. //
  1513. if(m_panel_ThreadID != ::GetCurrentThreadId())
  1514. {
  1515. __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1516. }
  1517. switch(id)
  1518. {
  1519. case HSCPANEL_NAVBAR : pPanel = &m_panel_NAVBAR ; idComp = HelpHost::COMPID_NAVBAR ; break;
  1520. case HSCPANEL_MININAVBAR: pPanel = &m_panel_MININAVBAR; idComp = HelpHost::COMPID_MININAVBAR; break;
  1521. case HSCPANEL_CONTEXT : pPanel = &m_panel_CONTEXT ; idComp = HelpHost::COMPID_CONTEXT ; break;
  1522. case HSCPANEL_CONTENTS : pPanel = &m_panel_CONTENTS ; idComp = HelpHost::COMPID_MAX ; break; // Not gated!!
  1523. case HSCPANEL_HHWINDOW : pPanel = &m_panel_HHWINDOW ; idComp = HelpHost::COMPID_HHWINDOW ; break;
  1524. default: __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1525. }
  1526. if(*pPanel == NULL && fEnsurePresence)
  1527. {
  1528. CComPtr<IMarsPanel> tmp; GetPanelDirect( id, tmp );
  1529. if(tmp)
  1530. {
  1531. USES_CONVERSION;
  1532. CComPtr<IDispatch> disp;
  1533. //
  1534. // Requesting the content actually triggers the creation of the control.
  1535. //
  1536. (void)tmp->get_content( &disp );
  1537. DEBUG_AppendPerf( DEBUG_PERF_MARS, "Wait Panel: %s start", W2A( local_ReverseLookupPanelName( id ) ) );
  1538. if(idComp != HelpHost::COMPID_MAX)
  1539. {
  1540. if(m_HelpHost->WaitUntilLoaded( idComp ) == false)
  1541. {
  1542. __MPC_EXIT_IF_METHOD_FAILS(hr, E_INVALIDARG);
  1543. }
  1544. }
  1545. DEBUG_AppendPerf( DEBUG_PERF_MARS, "Wait Panel: %s done", W2A( local_ReverseLookupPanelName( id ) ) );
  1546. }
  1547. if(*pPanel == NULL)
  1548. {
  1549. __MPC_EXIT_IF_METHOD_FAILS(hr, E_INVALIDARG);
  1550. }
  1551. }
  1552. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CopyTo( *pPanel, pVal ));
  1553. hr = S_OK;
  1554. __HCP_FUNC_CLEANUP;
  1555. __HCP_FUNC_EXIT(hr);
  1556. }
  1557. HRESULT CPCHHelpCenterExternal::GetPanelWindowObject( /*[in] */ HscPanel id ,
  1558. /*[out]*/ IHTMLWindow2* *pVal ,
  1559. /*[in] */ LPCWSTR szFrame )
  1560. {
  1561. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::GetPanelWindowObject" );
  1562. HRESULT hr;
  1563. CComPtr<IMarsPanel> panel;
  1564. CComPtr<IDispatch> disp;
  1565. CComPtr<IHTMLWindow2> window;
  1566. __MPC_PARAMCHECK_BEGIN(hr)
  1567. __MPC_PARAMCHECK_POINTER_AND_SET(pVal,NULL);
  1568. __MPC_PARAMCHECK_END();
  1569. __MPC_EXIT_IF_METHOD_FAILS(hr, GetPanel( id, &panel, true ));
  1570. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(disp, panel, content);
  1571. //
  1572. // If the panel is a web browser, we have to go through it to get to the document.
  1573. //
  1574. {
  1575. CComQIPtr<IWebBrowser2> wb( disp );
  1576. if(wb)
  1577. {
  1578. disp.Release();
  1579. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(disp, wb, Document);
  1580. }
  1581. }
  1582. //
  1583. // From the document, get to the window.
  1584. //
  1585. {
  1586. CComQIPtr<IHTMLDocument2> doc( disp );
  1587. if(doc == NULL)
  1588. {
  1589. __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1590. }
  1591. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(window, doc, parentWindow);
  1592. }
  1593. if(szFrame)
  1594. {
  1595. CComPtr<IHTMLFramesCollection2> frames;
  1596. CComVariant vName( szFrame );
  1597. CComVariant vRes;
  1598. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(frames, window, frames);
  1599. __MPC_EXIT_IF_METHOD_FAILS(hr, frames->item( &vName, &vRes ));
  1600. if(vRes.vt != VT_DISPATCH || vRes.pdispVal == NULL)
  1601. {
  1602. __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1603. }
  1604. window.Release();
  1605. __MPC_EXIT_IF_METHOD_FAILS(hr, vRes.pdispVal->QueryInterface( IID_IHTMLWindow2, (void**)&window ));
  1606. }
  1607. *pVal = window.Detach();
  1608. hr = S_OK;
  1609. __HCP_FUNC_CLEANUP;
  1610. __HCP_FUNC_EXIT(hr);
  1611. }
  1612. void CPCHHelpCenterExternal::GetPanelDirect( /*[in ]*/ HscPanel id ,
  1613. /*[out]*/ CComPtr<IMarsPanel>& pVal )
  1614. {
  1615. pVal.Release();
  1616. if(m_shell)
  1617. {
  1618. LPCWSTR szPanelName = local_ReverseLookupPanelName( id );
  1619. if(szPanelName)
  1620. {
  1621. CComPtr<IMarsPanelCollection> coll;
  1622. if(SUCCEEDED(m_shell->get_panels( &coll )) && coll)
  1623. {
  1624. (void)coll->get_item( CComVariant( szPanelName ), &pVal );
  1625. }
  1626. }
  1627. }
  1628. }
  1629. ////////////////////////////////////////////////////////////////////////////////
  1630. static void local_GetNumber( /*[in]*/ BSTR bstrData ,
  1631. /*[in]*/ LONG lMax ,
  1632. /*[out]*/ LONG& lValue ,
  1633. /*[out]*/ bool& fCenter )
  1634. {
  1635. if(bstrData)
  1636. {
  1637. if(!_wcsicmp( bstrData, L"CENTER" ))
  1638. {
  1639. lValue = 0;
  1640. fCenter = true;
  1641. }
  1642. else
  1643. {
  1644. lValue = _wtoi( bstrData );
  1645. if(wcschr( bstrData, '%' ))
  1646. {
  1647. if(lValue < 0) lValue = 0;
  1648. if(lValue > 100) lValue = 100;
  1649. lValue = lMax * lValue / 100;
  1650. }
  1651. fCenter = false;
  1652. }
  1653. }
  1654. if(lValue < 0) lValue = 0;
  1655. if(lValue > lMax) lValue = lMax;
  1656. }
  1657. HRESULT CPCHHelpCenterExternal::OnHostNotify( /*[in]*/ MARSHOSTEVENT event ,
  1658. /*[in]*/ IUnknown *punk ,
  1659. /*[in]*/ LPARAM lParam )
  1660. {
  1661. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::OnHostNotify" );
  1662. HRESULT hr;
  1663. if(m_panel_ThreadID == -1)
  1664. {
  1665. m_panel_ThreadID = ::GetCurrentThreadId();
  1666. }
  1667. if(event == MARSHOST_ON_WIN_INIT)
  1668. {
  1669. CComQIPtr<IProfferService> ps = punk;
  1670. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - MARSHOST_ON_WIN_INIT" );
  1671. m_hwnd = (HWND)lParam;
  1672. m_shell.Release(); __MPC_EXIT_IF_METHOD_FAILS(hr, punk->QueryInterface( __uuidof(IMarsWindowOM), (void**)&m_shell ));
  1673. if(ps)
  1674. {
  1675. CComQIPtr<IServiceProvider> sp;
  1676. //
  1677. // Handle security-related things.
  1678. //
  1679. if((sp = m_SECMGR))
  1680. {
  1681. DWORD dwCookie;
  1682. __MPC_EXIT_IF_METHOD_FAILS(hr, ps->ProfferService( SID_SInternetSecurityManager, sp, &dwCookie ));
  1683. }
  1684. //
  1685. // Handle behavior-related things.
  1686. //
  1687. if((sp = m_BEHAV))
  1688. {
  1689. DWORD dwCookie;
  1690. __MPC_EXIT_IF_METHOD_FAILS(hr, ps->ProfferService( SID_SElementBehaviorFactory, sp, &dwCookie ));
  1691. }
  1692. //
  1693. // Handle DocUI requires.
  1694. //
  1695. if((sp = m_DOCUI))
  1696. {
  1697. DWORD dwCookie;
  1698. __MPC_EXIT_IF_METHOD_FAILS(hr, ps->ProfferService( IID_IDocHostUIHandler, sp, &dwCookie ));
  1699. }
  1700. }
  1701. }
  1702. if(event == MARSHOST_ON_WIN_READY)
  1703. {
  1704. CComVariant v;
  1705. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - MARSHOST_ON_WIN_READY" );
  1706. ////////////////////////////////////////
  1707. //
  1708. // Force loading of the NavBar.
  1709. //
  1710. {
  1711. CComPtr<IMarsPanel> panel;
  1712. __MPC_EXIT_IF_METHOD_FAILS(hr, GetPanel( HSCPANEL_NAVBAR, &panel, true ));
  1713. }
  1714. //
  1715. // Force loading of the Context.
  1716. //
  1717. {
  1718. CComPtr<IMarsPanel> panel;
  1719. __MPC_EXIT_IF_METHOD_FAILS(hr, GetPanel( HSCPANEL_CONTEXT, &panel, true ));
  1720. }
  1721. //
  1722. // Force loading of the Contents.
  1723. //
  1724. {
  1725. CComPtr<IMarsPanel> panel;
  1726. __MPC_EXIT_IF_METHOD_FAILS(hr, GetPanel( HSCPANEL_CONTENTS, &panel, true ));
  1727. if(m_HelpHost->WaitUntilLoaded( HelpHost::COMPID_FIRSTPAGE ) == false)
  1728. {
  1729. __MPC_EXIT_IF_METHOD_FAILS(hr, E_INVALIDARG);
  1730. }
  1731. }
  1732. ////////////////////////////////////////
  1733. //
  1734. // If the registry cache says the system is ready, we can skip the startup phase!!
  1735. //
  1736. if(OfflineCache::Root::s_GLOBAL->IsReady() == false)
  1737. {
  1738. CComPtr<IPCHService> svc;
  1739. if(!m_Service) __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1740. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Service->EnsureDirectConnection( svc, false ));
  1741. }
  1742. ////////////////////////////////////////
  1743. {
  1744. HscContext iVal = HSCCONTEXT_STARTUP;
  1745. CComBSTR bstrInfo;
  1746. CComBSTR bstrUrl;
  1747. bool fAlsoContent = true;
  1748. if(m_HelpHostCfg)
  1749. {
  1750. for(HelpHost::XMLConfig::ApplyToIter it = m_HelpHostCfg->m_lstSessions.begin(); it != m_HelpHostCfg->m_lstSessions.end(); it++)
  1751. {
  1752. HelpHost::XMLConfig::ApplyTo& at = *it;
  1753. Taxonomy::HelpSet ths;
  1754. if(at.MatchSystem( this, ths ))
  1755. {
  1756. if(!(ths == m_UserSettings->THS()))
  1757. {
  1758. CPCHHelpCenterExternal::TLS* tlsOld = GetTLS();
  1759. CPCHHelpCenterExternal::TLS tlsNew; SetTLS( &tlsNew );
  1760. tlsNew.m_fSystem = true;
  1761. tlsNew.m_fTrusted = true;
  1762. hr = m_UserSettings->Select( CComBSTR( ths.GetSKU() ), ths.GetLanguage() );
  1763. SetTLS( tlsOld );
  1764. if(FAILED(hr)) __MPC_FUNC_LEAVE;
  1765. }
  1766. iVal = HSCCONTEXT_FULLWINDOW;
  1767. __MPC_EXIT_IF_METHOD_FAILS(hr, m_UserSettings->put_Scope( at.m_bstrApplication ));
  1768. if(STRINGISPRESENT(m_bstrStartURL))
  1769. {
  1770. bstrUrl.Attach( m_bstrStartURL.Detach() );
  1771. }
  1772. else
  1773. {
  1774. bstrUrl = at.m_bstrTopicToDisplay;
  1775. }
  1776. if(at.m_WindowSettings)
  1777. {
  1778. if(at.m_WindowSettings->m_fPresence_Left ||
  1779. at.m_WindowSettings->m_fPresence_Top ||
  1780. at.m_WindowSettings->m_fPresence_Width ||
  1781. at.m_WindowSettings->m_fPresence_Height )
  1782. {
  1783. RECT rcWin;
  1784. RECT rcMax;
  1785. __MPC_EXIT_IF_CALL_RETURNS_FALSE(hr, ::GetWindowRect ( m_hwnd , &rcWin ));
  1786. __MPC_EXIT_IF_CALL_RETURNS_FALSE(hr, ::SystemParametersInfo( SPI_GETWORKAREA, 0, &rcMax, 0 ));
  1787. {
  1788. LONG lLeft = rcWin.left;
  1789. LONG lTop = rcWin.top;
  1790. LONG lWidth = rcWin.right - rcWin.left;
  1791. LONG lHeight = rcWin.bottom - rcWin.top;
  1792. LONG lWidthMax = rcMax.right - rcMax.left;
  1793. LONG lHeightMax = rcMax.bottom - rcMax.top;
  1794. bool fCenter;
  1795. if(at.m_WindowSettings->m_fPresence_Width)
  1796. {
  1797. local_GetNumber( at.m_WindowSettings->m_bstrWidth, lWidthMax, lWidth, fCenter ); if(lWidth <= 0) lWidth = 100;
  1798. }
  1799. if(at.m_WindowSettings->m_fPresence_Height)
  1800. {
  1801. local_GetNumber( at.m_WindowSettings->m_bstrHeight, lHeightMax, lHeight, fCenter ); if(lHeight <= 0) lHeight = 50;
  1802. }
  1803. if(at.m_WindowSettings->m_fPresence_Left)
  1804. {
  1805. local_GetNumber( at.m_WindowSettings->m_bstrLeft, lWidthMax, lLeft, fCenter );
  1806. if(fCenter)
  1807. {
  1808. lLeft = rcMax.left + (lWidthMax - lWidth) / 2;
  1809. }
  1810. else
  1811. {
  1812. lLeft += rcMax.left;
  1813. }
  1814. }
  1815. if(at.m_WindowSettings->m_fPresence_Top)
  1816. {
  1817. local_GetNumber( at.m_WindowSettings->m_bstrTop, lHeightMax, lTop, fCenter );
  1818. if(fCenter)
  1819. {
  1820. lTop = rcMax.top + (lHeightMax - lHeight) / 2;
  1821. }
  1822. else
  1823. {
  1824. lTop += rcMax.top;
  1825. }
  1826. }
  1827. __MPC_EXIT_IF_CALL_RETURNS_FALSE(hr, ::SetWindowPos( m_hwnd, NULL, lLeft, lTop, lWidth, lHeight, SWP_NOACTIVATE | SWP_NOZORDER ));
  1828. }
  1829. }
  1830. if(at.m_WindowSettings->m_fPresence_Title && STRINGISPRESENT(at.m_WindowSettings->m_bstrTitle))
  1831. {
  1832. __MPC_EXIT_IF_CALL_RETURNS_FALSE(hr, ::SetWindowTextW( m_hwnd, at.m_WindowSettings->m_bstrTitle ));
  1833. }
  1834. if(at.m_WindowSettings->m_fPresence_Maximized)
  1835. {
  1836. __MPC_EXIT_IF_METHOD_FAILS(hr, m_shell->put_maximized( at.m_WindowSettings->m_fMaximized ? VARIANT_TRUE : VARIANT_FALSE ));
  1837. }
  1838. if(at.m_WindowSettings->m_bstrLayout)
  1839. {
  1840. if(!MPC::StrICmp( at.m_WindowSettings->m_bstrLayout, L"Normal" )) iVal = HSCCONTEXT_FULLWINDOW;
  1841. if(!MPC::StrICmp( at.m_WindowSettings->m_bstrLayout, L"ContentOnly" )) iVal = HSCCONTEXT_CONTENTONLY;
  1842. if(!MPC::StrICmp( at.m_WindowSettings->m_bstrLayout, L"Kiosk" )) iVal = HSCCONTEXT_KIOSKMODE;
  1843. }
  1844. if(at.m_WindowSettings->m_fPresence_NoResize)
  1845. {
  1846. DWORD dwStyle = ::GetWindowLong( m_hwnd, GWL_STYLE );
  1847. DWORD dwNewStyle;
  1848. if(at.m_WindowSettings->m_fNoResize)
  1849. {
  1850. dwNewStyle = dwStyle & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX);
  1851. }
  1852. else
  1853. {
  1854. dwNewStyle = dwStyle | (WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX);
  1855. }
  1856. if(dwStyle != dwNewStyle)
  1857. {
  1858. ::SetWindowLong( m_hwnd, GWL_STYLE, dwNewStyle );
  1859. }
  1860. }
  1861. }
  1862. if(at.m_Context)
  1863. {
  1864. switch( CPCHHelpSessionItem::LookupContext( at.m_Context->m_bstrID ) )
  1865. {
  1866. case HSCCONTEXT_SUBSITE :
  1867. if(at.m_Context->m_bstrTaxonomyPath)
  1868. {
  1869. iVal = HSCCONTEXT_SUBSITE;
  1870. bstrInfo = at.m_Context->m_bstrTaxonomyPath;
  1871. if(at.m_Context->m_bstrNodeToHighlight)
  1872. {
  1873. bstrInfo += L" ";
  1874. bstrInfo += at.m_Context->m_bstrNodeToHighlight;
  1875. }
  1876. }
  1877. break;
  1878. case HSCCONTEXT_SEARCH :
  1879. if(at.m_Context->m_bstrQuery)
  1880. {
  1881. iVal = HSCCONTEXT_SEARCH;
  1882. bstrInfo = at.m_Context->m_bstrQuery;
  1883. }
  1884. break;
  1885. case HSCCONTEXT_INDEX :
  1886. iVal = HSCCONTEXT_INDEX;
  1887. break;
  1888. case HSCCONTEXT_CHANNELS :
  1889. iVal = HSCCONTEXT_CHANNELS;
  1890. break;
  1891. case HSCCONTEXT_FAVORITES:
  1892. iVal = HSCCONTEXT_FAVORITES;
  1893. break;
  1894. case HSCCONTEXT_HISTORY :
  1895. iVal = HSCCONTEXT_HISTORY;
  1896. break;
  1897. case HSCCONTEXT_OPTIONS :
  1898. iVal = HSCCONTEXT_OPTIONS;
  1899. break;
  1900. }
  1901. }
  1902. break;
  1903. }
  1904. }
  1905. }
  1906. m_pMTP->dwFlags &= ~MTF_DONT_SHOW_WINDOW;
  1907. {
  1908. bool fProceed;
  1909. if(iVal == HSCCONTEXT_STARTUP && m_bstrStartURL.Length())
  1910. {
  1911. VARIANT_BOOL Cancel;
  1912. fProceed = ProcessNavigation( HSCPANEL_CONTENTS ,
  1913. m_bstrStartURL ,
  1914. NULL ,
  1915. false ,
  1916. Cancel );
  1917. }
  1918. else
  1919. {
  1920. fProceed = true;
  1921. }
  1922. if(fProceed)
  1923. {
  1924. __MPC_EXIT_IF_METHOD_FAILS(hr, ChangeContext( iVal, bstrInfo, bstrUrl, fAlsoContent ));
  1925. }
  1926. }
  1927. if(CPCHOptions::s_GLOBAL) (void)CPCHOptions::s_GLOBAL->Apply();
  1928. __MPC_SET_ERROR_AND_EXIT(hr, S_FALSE); // This will tell Mars we have taken care of startup.
  1929. }
  1930. }
  1931. if(event == MARSHOST_ON_WIN_PASSIVATE)
  1932. {
  1933. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - MARSHOST_ON_WIN_PASSIVATE" );
  1934. m_hwnd = NULL;
  1935. m_shell.Release();
  1936. }
  1937. //
  1938. // Handle panel-related things.
  1939. //
  1940. if(event == MARSHOST_ON_PANEL_CONTROL_CREATE ||
  1941. event == MARSHOST_ON_PANEL_PASSIVATE )
  1942. {
  1943. bool fShutdown = (event == MARSHOST_ON_PANEL_PASSIVATE);
  1944. CComQIPtr<IMarsPanel> panel = punk;
  1945. if(panel)
  1946. {
  1947. CComBSTR name;
  1948. __MPC_EXIT_IF_METHOD_FAILS(hr, panel->get_name( &name ));
  1949. if(name)
  1950. {
  1951. HscPanel id = local_LookupPanelName( name );
  1952. MPC::CComPtrThreadNeutral<IWebBrowser2>* browser = NULL;
  1953. CPCHWebBrowserEvents* events = NULL;
  1954. IMarsPanel* pPanel;
  1955. CComPtr<IDispatch> disp;
  1956. #ifdef DEBUG
  1957. {
  1958. USES_CONVERSION;
  1959. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - %s : %s", fShutdown ? "MARSHOST_ON_PANEL_PASSIVATE" : "MARSHOST_ON_PANEL_CONTROL_CREATE", W2A( SAFEWSTR( name ) ) );
  1960. }
  1961. #endif
  1962. if(fShutdown)
  1963. {
  1964. pPanel = NULL;
  1965. }
  1966. else
  1967. {
  1968. pPanel = panel; (void)pPanel->get_content( &disp );
  1969. if(CPCHOptions::s_GLOBAL) (void)CPCHOptions::s_GLOBAL->ApplySettings( this, disp );
  1970. }
  1971. switch(id)
  1972. {
  1973. case HSCPANEL_NAVBAR : m_panel_NAVBAR = pPanel; break;
  1974. case HSCPANEL_MININAVBAR: m_panel_MININAVBAR = pPanel; break;
  1975. case HSCPANEL_CONTEXT : m_panel_CONTEXT = pPanel; browser = &m_panel_CONTEXT_WebBrowser ; events = &m_panel_CONTEXT_Events ; break;
  1976. case HSCPANEL_CONTENTS : m_panel_CONTENTS = pPanel; browser = &m_panel_CONTENTS_WebBrowser; events = &m_panel_CONTENTS_Events; break;
  1977. case HSCPANEL_HHWINDOW : m_panel_HHWINDOW = pPanel; browser = &m_panel_HHWINDOW_WebBrowser; events = &m_panel_HHWINDOW_Events; break;
  1978. default : __MPC_EXIT_IF_METHOD_FAILS(hr, E_INVALIDARG);
  1979. }
  1980. if(!m_timer && disp)
  1981. {
  1982. CComPtr<IHTMLDocument2> pDoc;
  1983. if(SUCCEEDED(MPC::HTML::IDispatch_To_IHTMLDocument2( pDoc, disp )))
  1984. {
  1985. CComPtr<IServiceProvider> sp;
  1986. CComPtr<ITimerService> ts;
  1987. if(SUCCEEDED(pDoc->QueryInterface( IID_IServiceProvider, (LPVOID*)&sp )))
  1988. {
  1989. if(SUCCEEDED(sp->QueryService( SID_STimerService, IID_ITimerService, (void **)&ts )))
  1990. {
  1991. ts->CreateTimer( NULL, &m_timer );
  1992. m_DisplayTimer.Initialize( m_timer );
  1993. m_ActionsTimer.Initialize( m_timer );
  1994. }
  1995. }
  1996. }
  1997. }
  1998. if(browser && events)
  1999. {
  2000. CComQIPtr<IWebBrowser2> wb2 = disp;
  2001. if(wb2)
  2002. {
  2003. MPC_SCRIPTHELPER_PUT__DIRECT(wb2, RegisterAsDropTarget, VARIANT_FALSE); // wb2.RegisterAsDropTarget = false;
  2004. events->Attach( wb2 );
  2005. }
  2006. else
  2007. {
  2008. events->Detach();
  2009. }
  2010. *browser = wb2;
  2011. }
  2012. }
  2013. }
  2014. }
  2015. if(event == MARSHOST_ON_PANEL_INIT)
  2016. {
  2017. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - MARSHOST_ON_PANEL_INIT" );
  2018. }
  2019. if(event == MARSHOST_ON_PLACE_TRANSITION_DONE)
  2020. {
  2021. CComQIPtr<IMarsPlace> place = punk;
  2022. if(place)
  2023. {
  2024. m_bstrCurrentPlace.Empty();
  2025. MPC_SCRIPTHELPER_GET__DIRECT(m_bstrCurrentPlace, place, name);
  2026. (void)m_Events.FireEvent_Transition( m_bstrCurrentPlace );
  2027. }
  2028. }
  2029. if(event == MARSHOST_ON_SCRIPT_ERROR)
  2030. {
  2031. CComQIPtr<IHTMLDocument2> doc = punk;
  2032. if(doc)
  2033. {
  2034. CComPtr<IHTMLWindow2> win;
  2035. if(SUCCEEDED(doc->get_parentWindow( &win )) && win)
  2036. {
  2037. CComPtr<IHTMLEventObj> ev;
  2038. if(SUCCEEDED(win->get_event( &ev )) && ev)
  2039. {
  2040. CComDispatchDriver driver( ev );
  2041. MPC::wstring strMessage;
  2042. MPC::wstring strUrl;
  2043. long lLine;
  2044. long lCharacter;
  2045. long lCode;
  2046. local_GetProperty( driver, L"errorMessage" , strMessage );
  2047. local_GetProperty( driver, L"errorUrl" , strUrl );
  2048. local_GetProperty( driver, L"errorLine" , lLine );
  2049. local_GetProperty( driver, L"errorCharacter", lCharacter );
  2050. local_GetProperty( driver, L"errorCode" , lCode );
  2051. g_ApplicationLog.LogRecord( L"############################################################\n\n"
  2052. L"Script error:\n\n"
  2053. L"Message : %s" , strMessage.c_str() );
  2054. g_ApplicationLog.LogRecord( L"Url : %s" , strUrl .c_str() );
  2055. g_ApplicationLog.LogRecord( L"Line : %d" , lLine );
  2056. g_ApplicationLog.LogRecord( L"Character: %d" , lCharacter );
  2057. g_ApplicationLog.LogRecord( L"Code : %d\n\n", lCode );
  2058. if(g_Debug_BLOCKERRORS)
  2059. {
  2060. __MPC_SET_ERROR_AND_EXIT(hr, S_OK);
  2061. }
  2062. }
  2063. }
  2064. }
  2065. __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  2066. }
  2067. hr = S_OK;
  2068. __HCP_FUNC_CLEANUP;
  2069. __HCP_FUNC_EXIT(hr);
  2070. }
  2071. HRESULT CPCHHelpCenterExternal::PreTranslateMessage( /*[in]*/ MSG* msg )
  2072. {
  2073. switch(msg->message)
  2074. {
  2075. ////////////////////////////////////////////////////////////////////////////////
  2076. case WM_CLOSE:
  2077. {
  2078. CComPtr<IWebBrowser2> wb2;
  2079. VARIANT_BOOL Cancel;
  2080. if(SUCCEEDED(m_Events.FireEvent_Shutdown( &Cancel )))
  2081. {
  2082. if(Cancel == VARIANT_TRUE)
  2083. {
  2084. return S_OK;
  2085. }
  2086. }
  2087. m_fShuttingDown = true;
  2088. m_DisplayTimer.Stop();
  2089. m_ActionsTimer.Stop();
  2090. wb2.Attach( Context () ); if(wb2) (void)wb2->ExecWB( OLECMDID_STOP, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
  2091. wb2.Attach( Contents() ); if(wb2) (void)wb2->ExecWB( OLECMDID_STOP, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
  2092. wb2.Attach( HHWindow() ); if(wb2) (void)wb2->ExecWB( OLECMDID_STOP, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
  2093. if(m_hs) (void)m_hs->ForceHistoryPopulate();
  2094. }
  2095. break;
  2096. ////////////////////////////////////////////////////////////////////////////////
  2097. case WM_MOUSEWHEEL:
  2098. //
  2099. // Handle Mouse Wheel navigation...
  2100. //
  2101. if(msg->wParam & MK_SHIFT)
  2102. {
  2103. if(m_hs->IsTravelling() == false)
  2104. {
  2105. if(GET_WHEEL_DELTA_WPARAM(msg->wParam) < 0)
  2106. {
  2107. (void)HelpSession()->Back( 1 );
  2108. }
  2109. else
  2110. {
  2111. (void)HelpSession()->Forward( 1 );
  2112. }
  2113. }
  2114. return S_OK;
  2115. }
  2116. //
  2117. // Disable Mouse Wheel zoom...
  2118. //
  2119. if(msg->wParam & MK_CONTROL)
  2120. {
  2121. return S_OK;
  2122. }
  2123. break;
  2124. ////////////////////////////////////////////////////////////////////////////////
  2125. //
  2126. // Sense changes in the colors or resolution and reload style sheets.
  2127. //
  2128. case WM_THEMECHANGED:
  2129. case WM_DISPLAYCHANGE:
  2130. case WM_PALETTECHANGED:
  2131. case WM_SYSCOLORCHANGE:
  2132. if(CHCPProtocolEnvironment::s_GLOBAL->UpdateState())
  2133. {
  2134. for(int i = HSCPANEL_NAVBAR; i<= HSCPANEL_HHWINDOW; i++)
  2135. {
  2136. IMarsPanel* pPanel = Panel( (HscPanel)i );
  2137. if(pPanel)
  2138. {
  2139. CComPtr<IDispatch> disp;
  2140. if(i == HSCPANEL_HHWINDOW)
  2141. {
  2142. CComPtr<IWebBrowser2> wb2; wb2.Attach( HHWindow() );
  2143. disp = wb2;
  2144. }
  2145. else
  2146. {
  2147. (void)pPanel->get_content( &disp );
  2148. }
  2149. (void)local_ApplySettings( disp );
  2150. }
  2151. }
  2152. (void)m_Events.FireEvent_CssChanged();
  2153. }
  2154. break;
  2155. ////////////////////////////////////////////////////////////////////////////////
  2156. //
  2157. // (weizhao) Sense changes in the system settings (e.g. accessibility settings such as high-contrast mode).
  2158. //
  2159. case WM_SETTINGCHANGE:
  2160. ProcessMessage( msg );
  2161. break;
  2162. // default:
  2163. // DebugLog( "MSG: %d %04x %08x\n", msg->message, msg->wParam, msg->lParam );
  2164. }
  2165. return m_DOCUI ? m_DOCUI->TranslateAccelerator( msg, NULL, 0 ) : E_NOTIMPL;
  2166. }
  2167. ////////////////////////////////////////
  2168. HRESULT CPCHHelpCenterExternal::SetHelpViewer( /*[in]*/ IPCHHelpViewerWrapper* pWrapper )
  2169. {
  2170. m_panel_HHWINDOW_Wrapper = pWrapper;
  2171. if(pWrapper)
  2172. {
  2173. CComPtr<IUnknown> unk; (void)pWrapper->get_WebBrowser( &unk );
  2174. CComQIPtr<IWebBrowser2> wb = unk;
  2175. if(wb)
  2176. {
  2177. m_panel_HHWINDOW_WebBrowser = wb;
  2178. m_panel_HHWINDOW_Events.Attach( wb );
  2179. }
  2180. }
  2181. else
  2182. {
  2183. m_panel_HHWINDOW_WebBrowser.Release();
  2184. m_panel_HHWINDOW_Events.Detach();
  2185. }
  2186. return S_OK;
  2187. }
  2188. ////////////////////////////////////////////////////////////////////////////////
  2189. HRESULT CPCHHelpCenterExternal::CreateScriptWrapper( /*[in]*/ REFCLSID rclsid, /*[in]*/ BSTR bstrCode, /*[in]*/ BSTR bstrURL, /*[out]*/ IUnknown* *ppObj )
  2190. {
  2191. return m_Service ? m_Service->CreateScriptWrapper( rclsid, bstrCode, bstrURL, ppObj ) : E_ACCESSDENIED;
  2192. }
  2193. ////////////////////////////////////////////////////////////////////////////////
  2194. HRESULT CPCHHelpCenterExternal::CallFunctionOnPanel( /*[in] */ HscPanel id ,
  2195. /*[in] */ LPCWSTR szFrame ,
  2196. /*[in] */ BSTR bstrName ,
  2197. /*[in] */ VARIANT* pvarParams ,
  2198. /*[in] */ int nParams ,
  2199. /*[out]*/ VARIANT* pvarRet )
  2200. {
  2201. HRESULT hr;
  2202. CComPtr<IHTMLWindow2> win;
  2203. if(SUCCEEDED(hr = GetPanelWindowObject( id, &win, szFrame )))
  2204. {
  2205. CComDispatchDriver driver( win );
  2206. hr = driver.InvokeN( bstrName, pvarParams, nParams, pvarRet );
  2207. }
  2208. return hr;
  2209. }
  2210. HRESULT CPCHHelpCenterExternal::ReadVariableFromPanel( /*[in] */ HscPanel id ,
  2211. /*[in] */ LPCWSTR szFrame ,
  2212. /*[in] */ BSTR bstrVariable ,
  2213. /*[out]*/ CComVariant& varRet )
  2214. {
  2215. HRESULT hr;
  2216. CComPtr<IHTMLWindow2> win;
  2217. varRet.Clear();
  2218. if(SUCCEEDED(hr = GetPanelWindowObject( id, &win, szFrame )))
  2219. {
  2220. CComDispatchDriver driver( win );
  2221. hr = driver.GetPropertyByName( bstrVariable, &varRet );
  2222. }
  2223. return hr;
  2224. }