Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2792 lines
130 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_Services&topic=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. // Bug 535303 SVR: Security: Help And Support Service Resets to Automatic after Set to Disabled
  797. // Modified 4/24 gschua
  798. //
  799. // Then, let's make sure it's not DISABLED.
  800. //
  801. /*
  802. if((hSCM = ::OpenSCManager( NULL, NULL, GENERIC_READ )))
  803. {
  804. SC_HANDLE hService;
  805. if((hService = ::OpenServiceW( hSCM, HC_HELPSVC_NAME, SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG )))
  806. {
  807. BYTE rgBuf[2048];
  808. DWORD dwLen;
  809. LPQUERY_SERVICE_CONFIGW cfg = (LPQUERY_SERVICE_CONFIG)rgBuf;
  810. if(::QueryServiceConfigW( hService, cfg, sizeof(rgBuf), &dwLen ) && cfg->dwStartType == SERVICE_DISABLED)
  811. {
  812. if(::ChangeServiceConfigW( hService , // handle to service
  813. cfg->dwServiceType , // type of service
  814. SERVICE_AUTO_START , // when to start service
  815. cfg->dwErrorControl , // severity of start failure
  816. NULL , // service binary file name
  817. NULL , // load ordering group name
  818. NULL , // tag identifier
  819. NULL , // array of dependency names
  820. NULL , // account name
  821. NULL , // account password
  822. cfg->lpDisplayName )) // display name
  823. {
  824. }
  825. }
  826. ::CloseServiceHandle( hService );
  827. }
  828. ::CloseServiceHandle( hSCM );
  829. }
  830. */
  831. //
  832. // In case it's not running, let's try to start it.
  833. //
  834. if(fResult == false)
  835. {
  836. if((hSCM = ::OpenSCManager( NULL, NULL, GENERIC_READ )))
  837. {
  838. SC_HANDLE hService;
  839. if((hService = ::OpenServiceW( hSCM, HC_HELPSVC_NAME, SERVICE_START )))
  840. {
  841. if(::StartService( hService, 0, NULL ))
  842. {
  843. fResult = true;
  844. }
  845. ::CloseServiceHandle( hService );
  846. }
  847. ::CloseServiceHandle( hSCM );
  848. }
  849. }
  850. //
  851. // Last resort, try to connect to HelpSvc.
  852. //
  853. if(fResult == false)
  854. {
  855. CComPtr<IPCHService> svc;
  856. if(m_Service && SUCCEEDED(m_Service->EnsureDirectConnection( svc, false )))
  857. {
  858. fResult = true;
  859. }
  860. }
  861. return fResult;
  862. }
  863. HRESULT CPCHHelpCenterExternal::Initialize()
  864. {
  865. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::Initialize" );
  866. HRESULT hr;
  867. CLSID clsid = CLSID_PCHHelpCenter;
  868. //
  869. // Register for shutdown.
  870. //
  871. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::_MPC_Module.RegisterCallback( this, (void (CPCHHelpCenterExternal::*)())Passivate ));
  872. m_SecurityHandle.Initialize( this, (IPCHHelpCenterExternal*)this );
  873. //
  874. // Thread Local Storage.
  875. //
  876. m_tlsID = ::TlsAlloc();
  877. if(m_tlsID == -1)
  878. {
  879. __MPC_SET_WIN32_ERROR_AND_EXIT(hr, ERROR_NO_SYSTEM_RESOURCES);
  880. }
  881. SetTLS( NULL );
  882. //
  883. // Create Browser Events handlers.
  884. //
  885. m_panel_CONTEXT_Events .Initialize( this, HSCPANEL_CONTEXT );
  886. m_panel_CONTENTS_Events.Initialize( this, HSCPANEL_CONTENTS );
  887. m_panel_HHWINDOW_Events.Initialize( this, HSCPANEL_HHWINDOW );
  888. m_Events .Initialize( this );
  889. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_hs )); m_hs ->Initialize( this );
  890. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_SECMGR )); m_SECMGR->Initialize( this );
  891. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_BEHAV )); m_BEHAV ->Initialize( this );
  892. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_DOCUI )); m_DOCUI ->Initialize( this );
  893. //
  894. // Create the HelpHost objects.
  895. //
  896. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_HelpHost )); __MPC_EXIT_IF_METHOD_FAILS(hr, m_HelpHost->Initialize( this ));
  897. //
  898. // Create all the proxies.
  899. //
  900. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &m_Service ));
  901. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Service->ConnectToParent ( this ));
  902. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Service->GetUtility ( &m_Utility ));
  903. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Utility->GetUserSettings2( &m_UserSettings ));
  904. if(m_UserSettings)
  905. {
  906. __MPC_EXIT_IF_METHOD_FAILS(hr, m_UserSettings->Initialize());
  907. }
  908. hr = S_OK;
  909. __HCP_FUNC_CLEANUP;
  910. __HCP_FUNC_EXIT(hr);
  911. }
  912. void CPCHHelpCenterExternal::Passivate()
  913. {
  914. MPC::ReleaseAll( m_lstMessageCrackers );
  915. if(m_fPassivated == false)
  916. {
  917. if(DoesPersistSettings())
  918. {
  919. if(m_hs) (void)m_hs->Persist();
  920. }
  921. else
  922. {
  923. //
  924. // Signal the option object to ignore SKU info during save.
  925. //
  926. if(CPCHOptions::s_GLOBAL) CPCHOptions::s_GLOBAL->DontPersistSKU();
  927. }
  928. if(m_UserSettings) (void)m_UserSettings->SaveUserSettings();
  929. if(CPCHOptions::s_GLOBAL) CPCHOptions::s_GLOBAL->Save();
  930. }
  931. ////////////////////////////////////////////////////////////////////////////////
  932. m_fPassivated = true;
  933. delete m_HelpHostCfg; m_HelpHostCfg = NULL;
  934. if(m_HelpHost) m_HelpHost->Passivate();
  935. if(m_Service ) m_Service ->Passivate();
  936. m_panel_CONTEXT_Events .Passivate();
  937. m_panel_CONTENTS_Events.Passivate();
  938. m_panel_HHWINDOW_Events.Passivate();
  939. m_Events .Passivate();
  940. m_DisplayTimer.Stop();
  941. m_ActionsTimer.Stop();
  942. ////////////////////////////////////////////////////////////////////////////////
  943. // bool m_fFromStartHelp;
  944. // bool m_fLayout;
  945. // bool m_fWindowVisible;
  946. // bool m_fControlled;
  947. // bool m_fPersistSettings;
  948. // bool m_fHidden;
  949. //
  950. // CComBSTR m_bstrExtraArgument
  951. // HelpHost::XMLConfig* m_HelpHostCfg;
  952. // CComBSTR m_bstrStartURL;
  953. // CComBSTR m_bstrCurrentPlace;
  954. // MARSTHREADPARAM* m_pMTP;
  955. //
  956. // MPC::CComConstantHolder m_constHELPCTR;
  957. // MPC::CComConstantHolder m_constHELPSVC;
  958. //
  959. // ////////////////////////////////////////
  960. //
  961. // CPCHSecurityHandle m_SecurityHandle;
  962. // DWORD m_tlsID;
  963. // bool m_fPassivated;
  964. //
  965. m_HelpHost .Release(); // CComPtr<HelpHost::Main> m_HelpHost;
  966. //
  967. m_hs .Release(); // CComPtr<CPCHHelpSession> m_hs;
  968. // CComPtr<CPCHSecurityManager> m_SECMGR;
  969. // CComPtr<CPCHElementBehaviorFactory> m_BEHAV;
  970. // CComPtr<CPCHHelper_IDocHostUIHandler> m_DOCUI;
  971. //
  972. MPC::Release2<IPCHService >( m_Service ); // CPCHProxy_IPCHService* m_Service;
  973. MPC::Release2<IPCHUtility >( m_Utility ); // CPCHProxy_IPCHUtility* m_Utility;
  974. MPC::Release2<IPCHUserSettings2>( m_UserSettings ); // CPCHProxy_IPCHUserSettings2* m_UserSettings;
  975. //
  976. m_panel_ThreadID = -1; // DWORD m_panel_ThreadID;
  977. //
  978. m_panel_NAVBAR .Release(); // CComPtr<IMarsPanel> m_panel_NAVBAR;
  979. m_panel_MININAVBAR .Release(); // CComPtr<IMarsPanel> m_panel_MININAVBAR;
  980. //
  981. m_panel_CONTEXT .Release(); // CComPtr<IMarsPanel> m_panel_CONTEXT;
  982. m_panel_CONTEXT_WebBrowser .Release(); // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_CONTEXT_WebBrowser;
  983. // CPCHWebBrowserEvents m_panel_CONTEXT_Events;
  984. //
  985. m_panel_CONTENTS .Release(); // CComPtr<IMarsPanel> m_panel_CONTENTS;
  986. m_panel_CONTENTS_WebBrowser .Release(); // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_CONTENTS_WebBrowser;
  987. // CPCHWebBrowserEvents m_panel_CONTENTS_Events;
  988. //
  989. m_panel_HHWINDOW .Release(); // CComPtr<IMarsPanel> m_panel_HHWINDOW;
  990. m_panel_HHWINDOW_Wrapper .Release(); // CComPtr<IPCHHelpViewerWrapper> m_panel_HHWINDOW_Wrapper;
  991. m_panel_HHWINDOW_WebBrowser .Release(); // MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_HHWINDOW_WebBrowser;
  992. // CPCHWebBrowserEvents m_panel_HHWINDOW_Events;
  993. //
  994. m_shell .Release(); // CComPtr<IMarsWindowOM> m_shell;
  995. m_timer .Release(); // CComPtr<ITimer> m_timer;
  996. // CPCHTimerHandle m_DisplayTimer;
  997. //
  998. // DWORD m_dwInBeforeNavigate;
  999. // DelayedExecList m_DelayedActions;
  1000. // CPCHTimerHandle m_ActionsTimer;
  1001. //
  1002. m_hwnd = NULL; // HWND m_hwnd;
  1003. // CPCHEvents m_Events;
  1004. m_SecurityHandle.Passivate();
  1005. }
  1006. ////////////////////////////////////////////////////////////////////////////////
  1007. HRESULT CPCHHelpCenterExternal::ProcessLayoutXML( /*[in]*/ LPCWSTR szURL )
  1008. {
  1009. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::ProcessLayoutXML" );
  1010. HRESULT hr;
  1011. delete m_HelpHostCfg; __MPC_EXIT_IF_ALLOC_FAILS(hr, m_HelpHostCfg, new HelpHost::XMLConfig);
  1012. if(FAILED(MPC::Config::LoadFile( m_HelpHostCfg, szURL )))
  1013. {
  1014. delete m_HelpHostCfg; m_HelpHostCfg = NULL;
  1015. m_fLayout = false;
  1016. }
  1017. else
  1018. {
  1019. m_fLayout = true;
  1020. m_fPersistSettings = false;
  1021. }
  1022. hr = S_OK;
  1023. __HCP_FUNC_CLEANUP;
  1024. __HCP_FUNC_EXIT(hr);
  1025. }
  1026. HRESULT CPCHHelpCenterExternal::ProcessArgument( /*[in]*/ int& pos, /*[in]*/ LPCWSTR szArg, /*[in]*/ const int argc, /*[in]*/ LPCWSTR* const argv )
  1027. {
  1028. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::ProcessArgument" );
  1029. static bool fFromHCP = false;
  1030. HRESULT hr;
  1031. // From HCP, no parameters other than Url are allowed
  1032. if (fFromHCP && _wcsicmp( szArg, L"Url" ) != 0)
  1033. __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1034. if(_wcsicmp( szArg, L"Url" ) == 0)
  1035. {
  1036. HyperLinks::ParsedUrl pu;
  1037. bool fValid = true;
  1038. if(pos >= argc - 1) __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1039. m_bstrStartURL = argv[++pos];
  1040. if (fFromHCP) fValid = local_IsValidEntryURL(m_bstrStartURL);
  1041. if (fValid)
  1042. {
  1043. if(SUCCEEDED(pu.Initialize( m_bstrStartURL )) && pu.m_state == HyperLinks::STATE_NOTPROCESSED)
  1044. {
  1045. if(pu.m_fmt == HyperLinks::FMT_LAYOUT_XML)
  1046. {
  1047. CComBSTR bstrMode;
  1048. (void)pu.GetQueryField( L"topic" , m_bstrStartURL );
  1049. (void)pu.GetQueryField( L"definition", bstrMode );
  1050. (void)ProcessLayoutXML( bstrMode );
  1051. }
  1052. }
  1053. else
  1054. {
  1055. m_bstrStartURL.Empty();
  1056. }
  1057. }
  1058. else
  1059. {
  1060. CComBSTR bstrURL = m_bstrStartURL;
  1061. m_bstrStartURL = c_szURL_Err_BadUrl;
  1062. m_bstrStartURL.Append(L"?");
  1063. if (bstrURL) m_bstrStartURL.Append(bstrURL);
  1064. }
  1065. }
  1066. else if(_wcsicmp( szArg, L"ExtraArgument" ) == 0)
  1067. {
  1068. if(pos >= argc - 1) __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1069. m_bstrExtraArgument = argv[++pos];
  1070. }
  1071. else if(_wcsicmp( szArg, L"Hidden" ) == 0)
  1072. {
  1073. m_fHidden = true;
  1074. m_fWindowVisible = false;
  1075. m_fPersistSettings = false;
  1076. }
  1077. else if(_wcsicmp( szArg, L"FromStartHelp" ) == 0)
  1078. {
  1079. m_fFromStartHelp = true;
  1080. m_fPersistSettings = true;
  1081. }
  1082. else if(_wcsicmp( szArg, L"Controlled" ) == 0)
  1083. {
  1084. if(pos >= argc - 1) __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1085. {
  1086. CLSID clsid;
  1087. __MPC_EXIT_IF_METHOD_FAILS(hr, ::CLSIDFromString( CComBSTR( argv[++pos] ), &clsid ));
  1088. __MPC_EXIT_IF_METHOD_FAILS(hr, m_HelpHost->Register( clsid ));
  1089. }
  1090. m_fWindowVisible = false;
  1091. m_fControlled = true;
  1092. m_fPersistSettings = false;
  1093. }
  1094. else if(_wcsicmp( szArg, L"Mode" ) == 0)
  1095. {
  1096. if(pos >= argc - 1) __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1097. (void)ProcessLayoutXML( argv[++pos] );
  1098. }
  1099. else if(_wcsicmp( szArg, L"FromHCP" ) == 0)
  1100. {
  1101. fFromHCP = true;
  1102. }
  1103. if(m_UserSettings)
  1104. {
  1105. __MPC_EXIT_IF_METHOD_FAILS(hr, m_UserSettings->Initialize());
  1106. }
  1107. hr = S_OK;
  1108. __HCP_FUNC_CLEANUP;
  1109. __HCP_FUNC_EXIT(hr);
  1110. }
  1111. bool CPCHHelpCenterExternal::DoWeNeedUI()
  1112. {
  1113. if(IsFromStartHelp ()) return true;
  1114. if(IsControlled ()) return true;
  1115. if(HasLayoutDefinition()) return true;
  1116. //
  1117. // In case we are called through the HCP: shell association, try to forward to an existing instance.
  1118. //
  1119. {
  1120. CComPtr<IPCHHelpHost> hhEXISTING;
  1121. CLSID clsid = CLSID_PCHHelpCenter;
  1122. if(SUCCEEDED(m_HelpHost->Locate( clsid, hhEXISTING )))
  1123. {
  1124. CComVariant v;
  1125. if(SUCCEEDED(hhEXISTING->DisplayTopicFromURL( m_bstrStartURL, v )))
  1126. {
  1127. return false;
  1128. }
  1129. }
  1130. (void)m_HelpHost->Register( clsid );
  1131. }
  1132. return true;
  1133. }
  1134. HRESULT CPCHHelpCenterExternal::RunUI( /*[in]*/ const MPC::wstring& szTitle, /*[in]*/ PFNMARSTHREADPROC pMarsThreadProc )
  1135. {
  1136. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::RunUI" );
  1137. HRESULT hr;
  1138. CComPtr<CPCHMarsHost> pchmh;
  1139. {
  1140. static LPCWSTR rgCriticalFiles[] =
  1141. {
  1142. L"blurbs/about_support.htm" ,
  1143. L"blurbs/Favorites.htm" ,
  1144. L"blurbs/ftshelp.htm" ,
  1145. L"blurbs/History.htm" ,
  1146. L"blurbs/Index.htm" ,
  1147. L"blurbs/isupport.htm" ,
  1148. L"blurbs/keywordhelp.htm" ,
  1149. L"blurbs/options.htm" ,
  1150. L"blurbs/searchblurb.htm" ,
  1151. L"blurbs/searchtips.htm" ,
  1152. L"blurbs/tools.htm" ,
  1153. L"blurbs/windows_newsgroups.htm" ,
  1154. L"css/Behaviors.css" ,
  1155. L"css/Layout.css" ,
  1156. L"dialogs/DlgLib.js" ,
  1157. L"dialogs/Print.dlg" ,
  1158. L"errors/badurl.htm" ,
  1159. L"errors/connection.htm" ,
  1160. L"errors/indexfirstlevel.htm" ,
  1161. L"errors/notfound.htm" ,
  1162. L"errors/offline.htm" ,
  1163. L"errors/redirect.htm" ,
  1164. L"errors/unreachable.htm" ,
  1165. L"Headlines.htm" ,
  1166. L"HelpCtr.mmf" ,
  1167. L"HomePage__DESKTOP.htm" ,
  1168. L"HomePage__SERVER.htm" ,
  1169. L"panels/AdvSearch.htm" ,
  1170. L"panels/blank.htm" ,
  1171. L"panels/Context.htm" ,
  1172. L"panels/firstpage.htm" ,
  1173. L"panels/HHWrapper.htm" ,
  1174. L"panels/MiniNavBar.htm" ,
  1175. L"panels/MiniNavBar.xml" ,
  1176. L"panels/NavBar.htm" ,
  1177. L"panels/NavBar.xml" ,
  1178. L"panels/Options.htm" ,
  1179. L"panels/RemoteHelp.htm" ,
  1180. L"panels/ShareHelp.htm" ,
  1181. L"panels/subpanels/Channels.htm" ,
  1182. L"panels/subpanels/Favorites.htm",
  1183. L"panels/subpanels/History.htm" ,
  1184. L"panels/subpanels/Index.htm" ,
  1185. L"panels/subpanels/Options.htm" ,
  1186. L"panels/subpanels/Search.htm" ,
  1187. L"panels/subpanels/Subsite.htm" ,
  1188. L"panels/Topics.htm" ,
  1189. L"scripts/Common.js" ,
  1190. L"scripts/HomePage__DESKTOP.js" ,
  1191. L"scripts/HomePage__SERVER.js" ,
  1192. L"scripts/HomePage__SHARED.js" ,
  1193. L"scripts/wrapperparam.js" ,
  1194. };
  1195. HyperLinks::ParsedUrl pu;
  1196. bool fOk = true;
  1197. bool fFirstWinInetUse = true;
  1198. MPC::wstring strTmp;
  1199. for(int i=0; i<ARRAYSIZE(rgCriticalFiles); i++)
  1200. {
  1201. strTmp = L"hcp://system/";
  1202. strTmp += rgCriticalFiles[i];
  1203. if(SUCCEEDED(pu.Initialize( strTmp.c_str() )) && pu.CheckState( fFirstWinInetUse ) != HyperLinks::STATE_ALIVE)
  1204. {
  1205. fOk = false; break;
  1206. }
  1207. }
  1208. if(fOk == false)
  1209. {
  1210. CComPtr<IPCHService> svc;
  1211. if(m_Service == NULL) __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1212. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Service->EnsureDirectConnection( svc, false ));
  1213. __MPC_EXIT_IF_METHOD_FAILS(hr, svc->ForceSystemRestore());
  1214. }
  1215. }
  1216. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CreateInstance( &pchmh ));
  1217. __MPC_EXIT_IF_METHOD_FAILS(hr, pchmh->Init( this, szTitle, m_pMTP ));
  1218. __MPC_EXIT_IF_METHOD_FAILS(hr, pMarsThreadProc( pchmh, m_pMTP ));
  1219. hr = S_OK;
  1220. __HCP_FUNC_CLEANUP;
  1221. Passivate();
  1222. __HCP_FUNC_EXIT(hr);
  1223. }
  1224. ////////////////////////////////////////////////////////////////////////////////
  1225. CPCHHelpCenterExternal::TLS* CPCHHelpCenterExternal::GetTLS()
  1226. {
  1227. if(m_tlsID != -1)
  1228. {
  1229. return (TLS*)::TlsGetValue( m_tlsID );
  1230. }
  1231. return NULL;
  1232. }
  1233. void CPCHHelpCenterExternal::SetTLS( TLS* tls )
  1234. {
  1235. if(m_tlsID != -1)
  1236. {
  1237. ::TlsSetValue( m_tlsID, (LPVOID)tls );
  1238. }
  1239. }
  1240. HRESULT CPCHHelpCenterExternal::IsTrusted()
  1241. {
  1242. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::IsTrusted" );
  1243. HRESULT hr = E_ACCESSDENIED;
  1244. TLS* tls = GetTLS();
  1245. if(tls)
  1246. {
  1247. if(tls->m_fTrusted ||
  1248. tls->m_fSystem )
  1249. {
  1250. hr = S_OK;
  1251. }
  1252. }
  1253. __HCP_FUNC_EXIT(hr);
  1254. }
  1255. HRESULT CPCHHelpCenterExternal::IsSystem()
  1256. {
  1257. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::IsSystem" );
  1258. HRESULT hr = E_ACCESSDENIED;
  1259. TLS* tls = GetTLS();
  1260. if(tls)
  1261. {
  1262. if(tls->m_fSystem)
  1263. {
  1264. hr = S_OK;
  1265. }
  1266. }
  1267. __HCP_FUNC_EXIT(hr);
  1268. }
  1269. ////////////////////////////////////////////////////////////////////////////////
  1270. STDMETHODIMP CPCHHelpCenterExternal::RegisterForMessages( /*[in]*/ IOleInPlaceObjectWindowless* ptr, /*[in]*/ bool fRemove )
  1271. {
  1272. MsgProcIter it;
  1273. if(!ptr) return E_POINTER;
  1274. for(it = m_lstMessageCrackers.begin(); it != m_lstMessageCrackers.end(); it++)
  1275. {
  1276. if(*it == ptr)
  1277. {
  1278. ptr->Release();
  1279. m_lstMessageCrackers.erase( it );
  1280. break;
  1281. }
  1282. }
  1283. if(fRemove == false)
  1284. {
  1285. ptr->AddRef();
  1286. m_lstMessageCrackers.push_back( ptr );
  1287. }
  1288. return S_OK;
  1289. }
  1290. STDMETHODIMP CPCHHelpCenterExternal::ProcessMessage( /*[in]*/ MSG* msg )
  1291. {
  1292. if(msg->message == WM_SYSCHAR ||
  1293. msg->message == WM_SYSCOMMAND ||
  1294. msg->message == WM_SETTINGCHANGE ) // (weizhao) Relay WM_SETTINGCHANGE messages
  1295. // to registered windows (i.e. HTMLToolBar
  1296. // activeX controls) for appropriate handling.
  1297. {
  1298. MsgProcIter it;
  1299. for(it = m_lstMessageCrackers.begin(); it != m_lstMessageCrackers.end(); it++)
  1300. {
  1301. LRESULT lres;
  1302. if((*it)->OnWindowMessage( msg->message, msg->wParam, msg->lParam, &lres ) == S_OK)
  1303. {
  1304. return S_OK;
  1305. }
  1306. }
  1307. }
  1308. return E_NOTIMPL;
  1309. }
  1310. /////////////////////////////////////////////////////////////////////////////
  1311. HRESULT CPCHHelpCenterExternal::SetTLSAndInvoke( /*[in] */ IDispatch* obj ,
  1312. /*[in] */ DISPID id ,
  1313. /*[in] */ LCID lcid ,
  1314. /*[in] */ WORD wFlags ,
  1315. /*[in] */ DISPPARAMS* pdp ,
  1316. /*[out]*/ VARIANT* pvarRes ,
  1317. /*[out]*/ EXCEPINFO* pei ,
  1318. /*[in] */ IServiceProvider* pspCaller )
  1319. {
  1320. HRESULT hr;
  1321. TLS* tlsOld = GetTLS();
  1322. TLS tlsNew; SetTLS( &tlsNew );
  1323. //
  1324. // Let's see if the caller support the IHTMLDocument2 interface...
  1325. //
  1326. if(pspCaller && m_fPassivated == false)
  1327. {
  1328. (void)pspCaller->QueryService( SID_SContainerDispatch, IID_IHTMLDocument2, (void**)&tlsNew.m_Doc );
  1329. (void)pspCaller->QueryService( IID_IWebBrowserApp , IID_IWebBrowser2 , (void**)&tlsNew.m_WB );
  1330. if(tlsNew.m_Doc)
  1331. {
  1332. CComBSTR bstrURL;
  1333. //
  1334. // Yes! So get the URL and set the TRUSTED flag.
  1335. //
  1336. if(SUCCEEDED(tlsNew.m_Doc->get_URL( &bstrURL )))
  1337. {
  1338. tlsNew.m_fTrusted = m_SECMGR->IsUrlTrusted( SAFEBSTR( bstrURL ), &tlsNew.m_fSystem );
  1339. }
  1340. }
  1341. }
  1342. hr = obj->Invoke( id, IID_NULL, lcid, wFlags, pdp, pvarRes, pei, NULL );
  1343. SetTLS( tlsOld );
  1344. return hr;
  1345. }
  1346. /////////////////////////////////////////////////////////////////////////////
  1347. STDMETHODIMP CPCHHelpCenterExternal::GetIDsOfNames( REFIID riid ,
  1348. LPOLESTR* rgszNames ,
  1349. UINT cNames ,
  1350. LCID lcid ,
  1351. DISPID* rgdispid )
  1352. {
  1353. HRESULT hr = self::GetIDsOfNames( riid ,
  1354. rgszNames ,
  1355. cNames ,
  1356. lcid ,
  1357. rgdispid );
  1358. if(FAILED(hr))
  1359. {
  1360. hr = m_constHELPCTR.GetIDsOfNames( rgszNames, cNames, lcid, rgdispid );
  1361. if(FAILED(hr))
  1362. {
  1363. hr = m_constHELPSVC.GetIDsOfNames( rgszNames, cNames, lcid, rgdispid );
  1364. }
  1365. }
  1366. return hr;
  1367. }
  1368. STDMETHODIMP CPCHHelpCenterExternal::Invoke( DISPID dispidMember ,
  1369. REFIID riid ,
  1370. LCID lcid ,
  1371. WORD wFlags ,
  1372. DISPPARAMS* pdispparams ,
  1373. VARIANT* pvarResult ,
  1374. EXCEPINFO* pexcepinfo ,
  1375. UINT* puArgErr )
  1376. {
  1377. HRESULT hr = self::Invoke( dispidMember ,
  1378. riid ,
  1379. lcid ,
  1380. wFlags ,
  1381. pdispparams ,
  1382. pvarResult ,
  1383. pexcepinfo ,
  1384. puArgErr );
  1385. if(FAILED(hr) && wFlags == DISPATCH_PROPERTYGET)
  1386. {
  1387. hr = m_constHELPCTR.GetValue( dispidMember, lcid, pvarResult );
  1388. if(FAILED(hr))
  1389. {
  1390. hr = m_constHELPSVC.GetValue( dispidMember, lcid, pvarResult );
  1391. }
  1392. }
  1393. return hr;
  1394. }
  1395. /////////////////////////////////////////////////////////////////////////////
  1396. HWND CPCHHelpCenterExternal::Window() const
  1397. {
  1398. return m_hwnd;
  1399. }
  1400. ITimer* CPCHHelpCenterExternal::Timer() const
  1401. {
  1402. return m_timer;
  1403. }
  1404. IMarsWindowOM* CPCHHelpCenterExternal::Shell() const
  1405. {
  1406. return m_shell;
  1407. }
  1408. IMarsPanel* CPCHHelpCenterExternal::Panel( /*[in]*/ HscPanel id ) const
  1409. {
  1410. switch(id)
  1411. {
  1412. case HSCPANEL_NAVBAR : return m_panel_NAVBAR ;
  1413. case HSCPANEL_MININAVBAR: return m_panel_MININAVBAR;
  1414. case HSCPANEL_CONTEXT : return m_panel_CONTEXT ;
  1415. case HSCPANEL_CONTENTS : return m_panel_CONTENTS ;
  1416. case HSCPANEL_HHWINDOW : return m_panel_HHWINDOW ;
  1417. }
  1418. return NULL;
  1419. }
  1420. LPCWSTR CPCHHelpCenterExternal::PanelName( /*[in]*/ HscPanel id ) const
  1421. {
  1422. return local_ReverseLookupPanelName( id );
  1423. }
  1424. //////////////////////////////
  1425. IWebBrowser2* CPCHHelpCenterExternal::Context()
  1426. {
  1427. IWebBrowser2* pRes = NULL;
  1428. (void)m_panel_CONTEXT_WebBrowser.Access( &pRes );
  1429. return pRes;
  1430. }
  1431. IWebBrowser2* CPCHHelpCenterExternal::Contents()
  1432. {
  1433. IWebBrowser2* pRes = NULL;
  1434. (void)m_panel_CONTENTS_WebBrowser.Access( &pRes );
  1435. return pRes;
  1436. }
  1437. IWebBrowser2* CPCHHelpCenterExternal::HHWindow()
  1438. {
  1439. IWebBrowser2* pRes = NULL;
  1440. (void)m_panel_HHWINDOW_WebBrowser.Access( &pRes );
  1441. return pRes;
  1442. }
  1443. bool CPCHHelpCenterExternal::IsHHWindowVisible()
  1444. {
  1445. CComPtr<IMarsPanel> panel;
  1446. VARIANT_BOOL fContentsVisible;
  1447. GetPanelDirect( HSCPANEL_HHWINDOW, panel );
  1448. if(panel && SUCCEEDED(panel->get_visible( &fContentsVisible )) && fContentsVisible == VARIANT_TRUE) return true;
  1449. return false;
  1450. }
  1451. ////////////////////////////////////////////////////////////////////////////////
  1452. HRESULT CPCHHelpCenterExternal::NavigateHH( /*[in]*/ LPCWSTR szURL )
  1453. {
  1454. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::NavigateHH" );
  1455. HRESULT hr;
  1456. MPC::wstring strUrlModified;
  1457. CPCHWrapProtocolInfo::NormalizeUrl( szURL, strUrlModified, /*fReverse*/false );
  1458. //
  1459. // Delayed execution if inside OnBeforeNavigate.
  1460. //
  1461. if(m_dwInBeforeNavigate)
  1462. {
  1463. DelayedExecution& de = DelayedExecutionAlloc();
  1464. de.mode = DELAYMODE_NAVIGATEHH;
  1465. de.bstrURL = strUrlModified.c_str();
  1466. __MPC_SET_ERROR_AND_EXIT(hr, DelayedExecutionStart());
  1467. }
  1468. if(!m_panel_HHWINDOW_Wrapper)
  1469. {
  1470. __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1471. }
  1472. __MPC_EXIT_IF_METHOD_FAILS(hr, m_panel_HHWINDOW_Wrapper->Navigate( CComBSTR( strUrlModified.c_str() ) ));
  1473. hr = S_OK;
  1474. __HCP_FUNC_CLEANUP;
  1475. __HCP_FUNC_EXIT(hr);
  1476. }
  1477. HRESULT CPCHHelpCenterExternal::SetPanelUrl( /*[in]*/ HscPanel id, /*[in]*/ LPCWSTR szURL )
  1478. {
  1479. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::SetPanelUrl" );
  1480. HRESULT hr;
  1481. //
  1482. // Delayed execution if inside OnBeforeNavigate.
  1483. //
  1484. if(m_dwInBeforeNavigate)
  1485. {
  1486. DelayedExecution& de = DelayedExecutionAlloc();
  1487. de.mode = DELAYMODE_NAVIGATEWEB;
  1488. de.bstrURL = szURL;
  1489. __MPC_SET_ERROR_AND_EXIT(hr, DelayedExecutionStart());
  1490. }
  1491. if(m_shell && szURL)
  1492. {
  1493. IMarsPanel* panel = Panel( id );
  1494. if(panel)
  1495. {
  1496. __MPC_EXIT_IF_METHOD_FAILS(hr, panel->navigate( CComVariant( szURL ), CComVariant() ));
  1497. }
  1498. else
  1499. {
  1500. CComPtr<IMarsPanel> panel2; GetPanelDirect( id, panel2 );
  1501. if(panel2)
  1502. {
  1503. (void)panel2->put_startUrl( CComBSTR( szURL ) );
  1504. }
  1505. }
  1506. }
  1507. hr = S_OK;
  1508. __HCP_FUNC_CLEANUP;
  1509. __HCP_FUNC_EXIT(hr);
  1510. }
  1511. HRESULT CPCHHelpCenterExternal::GetPanel( /*[in]*/ HscPanel id, /*[out]*/ IMarsPanel* *pVal, /*[in]*/ bool fEnsurePresence )
  1512. {
  1513. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::GetPanel" );
  1514. HRESULT hr;
  1515. IMarsPanel* *pPanel;
  1516. HelpHost::CompId idComp;
  1517. __MPC_PARAMCHECK_BEGIN(hr)
  1518. __MPC_PARAMCHECK_POINTER_AND_SET(pVal,NULL);
  1519. __MPC_PARAMCHECK_END();
  1520. //
  1521. // Only return the interface pointer if called from the same thread...
  1522. //
  1523. if(m_panel_ThreadID != ::GetCurrentThreadId())
  1524. {
  1525. __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1526. }
  1527. switch(id)
  1528. {
  1529. case HSCPANEL_NAVBAR : pPanel = &m_panel_NAVBAR ; idComp = HelpHost::COMPID_NAVBAR ; break;
  1530. case HSCPANEL_MININAVBAR: pPanel = &m_panel_MININAVBAR; idComp = HelpHost::COMPID_MININAVBAR; break;
  1531. case HSCPANEL_CONTEXT : pPanel = &m_panel_CONTEXT ; idComp = HelpHost::COMPID_CONTEXT ; break;
  1532. case HSCPANEL_CONTENTS : pPanel = &m_panel_CONTENTS ; idComp = HelpHost::COMPID_MAX ; break; // Not gated!!
  1533. case HSCPANEL_HHWINDOW : pPanel = &m_panel_HHWINDOW ; idComp = HelpHost::COMPID_HHWINDOW ; break;
  1534. default: __MPC_SET_ERROR_AND_EXIT(hr, E_INVALIDARG);
  1535. }
  1536. if(*pPanel == NULL && fEnsurePresence)
  1537. {
  1538. CComPtr<IMarsPanel> tmp; GetPanelDirect( id, tmp );
  1539. if(tmp)
  1540. {
  1541. USES_CONVERSION;
  1542. CComPtr<IDispatch> disp;
  1543. //
  1544. // Requesting the content actually triggers the creation of the control.
  1545. //
  1546. (void)tmp->get_content( &disp );
  1547. DEBUG_AppendPerf( DEBUG_PERF_MARS, "Wait Panel: %s start", W2A( local_ReverseLookupPanelName( id ) ) );
  1548. if(idComp != HelpHost::COMPID_MAX)
  1549. {
  1550. if(m_HelpHost->WaitUntilLoaded( idComp ) == false)
  1551. {
  1552. __MPC_EXIT_IF_METHOD_FAILS(hr, E_INVALIDARG);
  1553. }
  1554. }
  1555. DEBUG_AppendPerf( DEBUG_PERF_MARS, "Wait Panel: %s done", W2A( local_ReverseLookupPanelName( id ) ) );
  1556. }
  1557. if(*pPanel == NULL)
  1558. {
  1559. __MPC_EXIT_IF_METHOD_FAILS(hr, E_INVALIDARG);
  1560. }
  1561. }
  1562. __MPC_EXIT_IF_METHOD_FAILS(hr, MPC::CopyTo( *pPanel, pVal ));
  1563. hr = S_OK;
  1564. __HCP_FUNC_CLEANUP;
  1565. __HCP_FUNC_EXIT(hr);
  1566. }
  1567. HRESULT CPCHHelpCenterExternal::GetPanelWindowObject( /*[in] */ HscPanel id ,
  1568. /*[out]*/ IHTMLWindow2* *pVal ,
  1569. /*[in] */ LPCWSTR szFrame )
  1570. {
  1571. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::GetPanelWindowObject" );
  1572. HRESULT hr;
  1573. CComPtr<IMarsPanel> panel;
  1574. CComPtr<IDispatch> disp;
  1575. CComPtr<IHTMLWindow2> window;
  1576. __MPC_PARAMCHECK_BEGIN(hr)
  1577. __MPC_PARAMCHECK_POINTER_AND_SET(pVal,NULL);
  1578. __MPC_PARAMCHECK_END();
  1579. __MPC_EXIT_IF_METHOD_FAILS(hr, GetPanel( id, &panel, true ));
  1580. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(disp, panel, content);
  1581. //
  1582. // If the panel is a web browser, we have to go through it to get to the document.
  1583. //
  1584. {
  1585. CComQIPtr<IWebBrowser2> wb( disp );
  1586. if(wb)
  1587. {
  1588. disp.Release();
  1589. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(disp, wb, Document);
  1590. }
  1591. }
  1592. //
  1593. // From the document, get to the window.
  1594. //
  1595. {
  1596. CComQIPtr<IHTMLDocument2> doc( disp );
  1597. if(doc == NULL)
  1598. {
  1599. __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1600. }
  1601. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(window, doc, parentWindow);
  1602. }
  1603. if(szFrame)
  1604. {
  1605. CComPtr<IHTMLFramesCollection2> frames;
  1606. CComVariant vName( szFrame );
  1607. CComVariant vRes;
  1608. MPC_SCRIPTHELPER_GET__DIRECT__NOTNULL(frames, window, frames);
  1609. __MPC_EXIT_IF_METHOD_FAILS(hr, frames->item( &vName, &vRes ));
  1610. if(vRes.vt != VT_DISPATCH || vRes.pdispVal == NULL)
  1611. {
  1612. __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1613. }
  1614. window.Release();
  1615. __MPC_EXIT_IF_METHOD_FAILS(hr, vRes.pdispVal->QueryInterface( IID_IHTMLWindow2, (void**)&window ));
  1616. }
  1617. *pVal = window.Detach();
  1618. hr = S_OK;
  1619. __HCP_FUNC_CLEANUP;
  1620. __HCP_FUNC_EXIT(hr);
  1621. }
  1622. void CPCHHelpCenterExternal::GetPanelDirect( /*[in ]*/ HscPanel id ,
  1623. /*[out]*/ CComPtr<IMarsPanel>& pVal )
  1624. {
  1625. pVal.Release();
  1626. if(m_shell)
  1627. {
  1628. LPCWSTR szPanelName = local_ReverseLookupPanelName( id );
  1629. if(szPanelName)
  1630. {
  1631. CComPtr<IMarsPanelCollection> coll;
  1632. if(SUCCEEDED(m_shell->get_panels( &coll )) && coll)
  1633. {
  1634. (void)coll->get_item( CComVariant( szPanelName ), &pVal );
  1635. }
  1636. }
  1637. }
  1638. }
  1639. ////////////////////////////////////////////////////////////////////////////////
  1640. static void local_GetNumber( /*[in]*/ BSTR bstrData ,
  1641. /*[in]*/ LONG lMax ,
  1642. /*[out]*/ LONG& lValue ,
  1643. /*[out]*/ bool& fCenter )
  1644. {
  1645. if(bstrData)
  1646. {
  1647. if(!_wcsicmp( bstrData, L"CENTER" ))
  1648. {
  1649. lValue = 0;
  1650. fCenter = true;
  1651. }
  1652. else
  1653. {
  1654. lValue = _wtoi( bstrData );
  1655. if(wcschr( bstrData, '%' ))
  1656. {
  1657. if(lValue < 0) lValue = 0;
  1658. if(lValue > 100) lValue = 100;
  1659. lValue = lMax * lValue / 100;
  1660. }
  1661. fCenter = false;
  1662. }
  1663. }
  1664. if(lValue < 0) lValue = 0;
  1665. if(lValue > lMax) lValue = lMax;
  1666. }
  1667. HRESULT CPCHHelpCenterExternal::OnHostNotify( /*[in]*/ MARSHOSTEVENT event ,
  1668. /*[in]*/ IUnknown *punk ,
  1669. /*[in]*/ LPARAM lParam )
  1670. {
  1671. __HCP_FUNC_ENTRY( "CPCHHelpCenterExternal::OnHostNotify" );
  1672. HRESULT hr;
  1673. if(m_panel_ThreadID == -1)
  1674. {
  1675. m_panel_ThreadID = ::GetCurrentThreadId();
  1676. }
  1677. if(event == MARSHOST_ON_WIN_INIT)
  1678. {
  1679. CComQIPtr<IProfferService> ps = punk;
  1680. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - MARSHOST_ON_WIN_INIT" );
  1681. m_hwnd = (HWND)lParam;
  1682. m_shell.Release(); __MPC_EXIT_IF_METHOD_FAILS(hr, punk->QueryInterface( __uuidof(IMarsWindowOM), (void**)&m_shell ));
  1683. if(ps)
  1684. {
  1685. CComQIPtr<IServiceProvider> sp;
  1686. //
  1687. // Handle security-related things.
  1688. //
  1689. if((sp = m_SECMGR))
  1690. {
  1691. DWORD dwCookie;
  1692. __MPC_EXIT_IF_METHOD_FAILS(hr, ps->ProfferService( SID_SInternetSecurityManager, sp, &dwCookie ));
  1693. }
  1694. //
  1695. // Handle behavior-related things.
  1696. //
  1697. if((sp = m_BEHAV))
  1698. {
  1699. DWORD dwCookie;
  1700. __MPC_EXIT_IF_METHOD_FAILS(hr, ps->ProfferService( SID_SElementBehaviorFactory, sp, &dwCookie ));
  1701. }
  1702. //
  1703. // Handle DocUI requires.
  1704. //
  1705. if((sp = m_DOCUI))
  1706. {
  1707. DWORD dwCookie;
  1708. __MPC_EXIT_IF_METHOD_FAILS(hr, ps->ProfferService( IID_IDocHostUIHandler, sp, &dwCookie ));
  1709. }
  1710. }
  1711. }
  1712. if(event == MARSHOST_ON_WIN_READY)
  1713. {
  1714. CComVariant v;
  1715. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - MARSHOST_ON_WIN_READY" );
  1716. ////////////////////////////////////////
  1717. //
  1718. // Force loading of the NavBar.
  1719. //
  1720. {
  1721. CComPtr<IMarsPanel> panel;
  1722. __MPC_EXIT_IF_METHOD_FAILS(hr, GetPanel( HSCPANEL_NAVBAR, &panel, true ));
  1723. }
  1724. //
  1725. // Force loading of the Context.
  1726. //
  1727. {
  1728. CComPtr<IMarsPanel> panel;
  1729. __MPC_EXIT_IF_METHOD_FAILS(hr, GetPanel( HSCPANEL_CONTEXT, &panel, true ));
  1730. }
  1731. //
  1732. // Force loading of the Contents.
  1733. //
  1734. {
  1735. CComPtr<IMarsPanel> panel;
  1736. __MPC_EXIT_IF_METHOD_FAILS(hr, GetPanel( HSCPANEL_CONTENTS, &panel, true ));
  1737. if(m_HelpHost->WaitUntilLoaded( HelpHost::COMPID_FIRSTPAGE ) == false)
  1738. {
  1739. __MPC_EXIT_IF_METHOD_FAILS(hr, E_INVALIDARG);
  1740. }
  1741. }
  1742. ////////////////////////////////////////
  1743. //
  1744. // If the registry cache says the system is ready, we can skip the startup phase!!
  1745. //
  1746. if(OfflineCache::Root::s_GLOBAL->IsReady() == false)
  1747. {
  1748. CComPtr<IPCHService> svc;
  1749. if(!m_Service) __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  1750. __MPC_EXIT_IF_METHOD_FAILS(hr, m_Service->EnsureDirectConnection( svc, false ));
  1751. }
  1752. ////////////////////////////////////////
  1753. {
  1754. HscContext iVal = HSCCONTEXT_STARTUP;
  1755. CComBSTR bstrInfo;
  1756. CComBSTR bstrUrl;
  1757. bool fAlsoContent = true;
  1758. if(m_HelpHostCfg)
  1759. {
  1760. for(HelpHost::XMLConfig::ApplyToIter it = m_HelpHostCfg->m_lstSessions.begin(); it != m_HelpHostCfg->m_lstSessions.end(); it++)
  1761. {
  1762. HelpHost::XMLConfig::ApplyTo& at = *it;
  1763. Taxonomy::HelpSet ths;
  1764. if(at.MatchSystem( this, ths ))
  1765. {
  1766. if(!(ths == m_UserSettings->THS()))
  1767. {
  1768. CPCHHelpCenterExternal::TLS* tlsOld = GetTLS();
  1769. CPCHHelpCenterExternal::TLS tlsNew; SetTLS( &tlsNew );
  1770. tlsNew.m_fSystem = true;
  1771. tlsNew.m_fTrusted = true;
  1772. hr = m_UserSettings->Select( CComBSTR( ths.GetSKU() ), ths.GetLanguage() );
  1773. SetTLS( tlsOld );
  1774. if(FAILED(hr)) __MPC_FUNC_LEAVE;
  1775. }
  1776. iVal = HSCCONTEXT_FULLWINDOW;
  1777. __MPC_EXIT_IF_METHOD_FAILS(hr, m_UserSettings->put_Scope( at.m_bstrApplication ));
  1778. if(STRINGISPRESENT(m_bstrStartURL))
  1779. {
  1780. bstrUrl.Attach( m_bstrStartURL.Detach() );
  1781. }
  1782. else
  1783. {
  1784. bstrUrl = at.m_bstrTopicToDisplay;
  1785. }
  1786. if(at.m_WindowSettings)
  1787. {
  1788. if(at.m_WindowSettings->m_fPresence_Left ||
  1789. at.m_WindowSettings->m_fPresence_Top ||
  1790. at.m_WindowSettings->m_fPresence_Width ||
  1791. at.m_WindowSettings->m_fPresence_Height )
  1792. {
  1793. RECT rcWin;
  1794. RECT rcMax;
  1795. __MPC_EXIT_IF_CALL_RETURNS_FALSE(hr, ::GetWindowRect ( m_hwnd , &rcWin ));
  1796. __MPC_EXIT_IF_CALL_RETURNS_FALSE(hr, ::SystemParametersInfo( SPI_GETWORKAREA, 0, &rcMax, 0 ));
  1797. {
  1798. LONG lLeft = rcWin.left;
  1799. LONG lTop = rcWin.top;
  1800. LONG lWidth = rcWin.right - rcWin.left;
  1801. LONG lHeight = rcWin.bottom - rcWin.top;
  1802. LONG lWidthMax = rcMax.right - rcMax.left;
  1803. LONG lHeightMax = rcMax.bottom - rcMax.top;
  1804. bool fCenter;
  1805. if(at.m_WindowSettings->m_fPresence_Width)
  1806. {
  1807. local_GetNumber( at.m_WindowSettings->m_bstrWidth, lWidthMax, lWidth, fCenter ); if(lWidth <= 0) lWidth = 100;
  1808. }
  1809. if(at.m_WindowSettings->m_fPresence_Height)
  1810. {
  1811. local_GetNumber( at.m_WindowSettings->m_bstrHeight, lHeightMax, lHeight, fCenter ); if(lHeight <= 0) lHeight = 50;
  1812. }
  1813. if(at.m_WindowSettings->m_fPresence_Left)
  1814. {
  1815. local_GetNumber( at.m_WindowSettings->m_bstrLeft, lWidthMax, lLeft, fCenter );
  1816. if(fCenter)
  1817. {
  1818. lLeft = rcMax.left + (lWidthMax - lWidth) / 2;
  1819. }
  1820. else
  1821. {
  1822. lLeft += rcMax.left;
  1823. }
  1824. }
  1825. if(at.m_WindowSettings->m_fPresence_Top)
  1826. {
  1827. local_GetNumber( at.m_WindowSettings->m_bstrTop, lHeightMax, lTop, fCenter );
  1828. if(fCenter)
  1829. {
  1830. lTop = rcMax.top + (lHeightMax - lHeight) / 2;
  1831. }
  1832. else
  1833. {
  1834. lTop += rcMax.top;
  1835. }
  1836. }
  1837. __MPC_EXIT_IF_CALL_RETURNS_FALSE(hr, ::SetWindowPos( m_hwnd, NULL, lLeft, lTop, lWidth, lHeight, SWP_NOACTIVATE | SWP_NOZORDER ));
  1838. }
  1839. }
  1840. if(at.m_WindowSettings->m_fPresence_Title && STRINGISPRESENT(at.m_WindowSettings->m_bstrTitle))
  1841. {
  1842. __MPC_EXIT_IF_CALL_RETURNS_FALSE(hr, ::SetWindowTextW( m_hwnd, at.m_WindowSettings->m_bstrTitle ));
  1843. }
  1844. if(at.m_WindowSettings->m_fPresence_Maximized)
  1845. {
  1846. __MPC_EXIT_IF_METHOD_FAILS(hr, m_shell->put_maximized( at.m_WindowSettings->m_fMaximized ? VARIANT_TRUE : VARIANT_FALSE ));
  1847. }
  1848. if(at.m_WindowSettings->m_bstrLayout)
  1849. {
  1850. if(!MPC::StrICmp( at.m_WindowSettings->m_bstrLayout, L"Normal" )) iVal = HSCCONTEXT_FULLWINDOW;
  1851. if(!MPC::StrICmp( at.m_WindowSettings->m_bstrLayout, L"ContentOnly" )) iVal = HSCCONTEXT_CONTENTONLY;
  1852. if(!MPC::StrICmp( at.m_WindowSettings->m_bstrLayout, L"Kiosk" )) iVal = HSCCONTEXT_KIOSKMODE;
  1853. }
  1854. if(at.m_WindowSettings->m_fPresence_NoResize)
  1855. {
  1856. DWORD dwStyle = ::GetWindowLong( m_hwnd, GWL_STYLE );
  1857. DWORD dwNewStyle;
  1858. if(at.m_WindowSettings->m_fNoResize)
  1859. {
  1860. dwNewStyle = dwStyle & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX);
  1861. }
  1862. else
  1863. {
  1864. dwNewStyle = dwStyle | (WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX);
  1865. }
  1866. if(dwStyle != dwNewStyle)
  1867. {
  1868. ::SetWindowLong( m_hwnd, GWL_STYLE, dwNewStyle );
  1869. }
  1870. }
  1871. }
  1872. if(at.m_Context)
  1873. {
  1874. switch( CPCHHelpSessionItem::LookupContext( at.m_Context->m_bstrID ) )
  1875. {
  1876. case HSCCONTEXT_SUBSITE :
  1877. if(at.m_Context->m_bstrTaxonomyPath)
  1878. {
  1879. iVal = HSCCONTEXT_SUBSITE;
  1880. bstrInfo = at.m_Context->m_bstrTaxonomyPath;
  1881. if(at.m_Context->m_bstrNodeToHighlight)
  1882. {
  1883. bstrInfo += L" ";
  1884. bstrInfo += at.m_Context->m_bstrNodeToHighlight;
  1885. }
  1886. }
  1887. break;
  1888. case HSCCONTEXT_SEARCH :
  1889. if(at.m_Context->m_bstrQuery)
  1890. {
  1891. iVal = HSCCONTEXT_SEARCH;
  1892. bstrInfo = at.m_Context->m_bstrQuery;
  1893. }
  1894. break;
  1895. case HSCCONTEXT_INDEX :
  1896. iVal = HSCCONTEXT_INDEX;
  1897. break;
  1898. case HSCCONTEXT_CHANNELS :
  1899. iVal = HSCCONTEXT_CHANNELS;
  1900. break;
  1901. case HSCCONTEXT_FAVORITES:
  1902. iVal = HSCCONTEXT_FAVORITES;
  1903. break;
  1904. case HSCCONTEXT_HISTORY :
  1905. iVal = HSCCONTEXT_HISTORY;
  1906. break;
  1907. case HSCCONTEXT_OPTIONS :
  1908. iVal = HSCCONTEXT_OPTIONS;
  1909. break;
  1910. }
  1911. }
  1912. break;
  1913. }
  1914. }
  1915. }
  1916. m_pMTP->dwFlags &= ~MTF_DONT_SHOW_WINDOW;
  1917. {
  1918. bool fProceed;
  1919. if(iVal == HSCCONTEXT_STARTUP && m_bstrStartURL.Length())
  1920. {
  1921. VARIANT_BOOL Cancel;
  1922. fProceed = ProcessNavigation( HSCPANEL_CONTENTS ,
  1923. m_bstrStartURL ,
  1924. NULL ,
  1925. false ,
  1926. Cancel );
  1927. }
  1928. else
  1929. {
  1930. fProceed = true;
  1931. }
  1932. if(fProceed)
  1933. {
  1934. __MPC_EXIT_IF_METHOD_FAILS(hr, ChangeContext( iVal, bstrInfo, bstrUrl, fAlsoContent ));
  1935. }
  1936. }
  1937. if(CPCHOptions::s_GLOBAL) (void)CPCHOptions::s_GLOBAL->Apply();
  1938. __MPC_SET_ERROR_AND_EXIT(hr, S_FALSE); // This will tell Mars we have taken care of startup.
  1939. }
  1940. }
  1941. if(event == MARSHOST_ON_WIN_PASSIVATE)
  1942. {
  1943. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - MARSHOST_ON_WIN_PASSIVATE" );
  1944. m_hwnd = NULL;
  1945. m_shell.Release();
  1946. }
  1947. //
  1948. // Handle panel-related things.
  1949. //
  1950. if(event == MARSHOST_ON_PANEL_CONTROL_CREATE ||
  1951. event == MARSHOST_ON_PANEL_PASSIVATE )
  1952. {
  1953. bool fShutdown = (event == MARSHOST_ON_PANEL_PASSIVATE);
  1954. CComQIPtr<IMarsPanel> panel = punk;
  1955. if(panel)
  1956. {
  1957. CComBSTR name;
  1958. __MPC_EXIT_IF_METHOD_FAILS(hr, panel->get_name( &name ));
  1959. if(name)
  1960. {
  1961. HscPanel id = local_LookupPanelName( name );
  1962. MPC::CComPtrThreadNeutral<IWebBrowser2>* browser = NULL;
  1963. CPCHWebBrowserEvents* events = NULL;
  1964. IMarsPanel* pPanel;
  1965. CComPtr<IDispatch> disp;
  1966. #ifdef DEBUG
  1967. {
  1968. USES_CONVERSION;
  1969. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - %s : %s", fShutdown ? "MARSHOST_ON_PANEL_PASSIVATE" : "MARSHOST_ON_PANEL_CONTROL_CREATE", W2A( SAFEWSTR( name ) ) );
  1970. }
  1971. #endif
  1972. if(fShutdown)
  1973. {
  1974. pPanel = NULL;
  1975. }
  1976. else
  1977. {
  1978. pPanel = panel; (void)pPanel->get_content( &disp );
  1979. if(CPCHOptions::s_GLOBAL) (void)CPCHOptions::s_GLOBAL->ApplySettings( this, disp );
  1980. }
  1981. switch(id)
  1982. {
  1983. case HSCPANEL_NAVBAR : m_panel_NAVBAR = pPanel; break;
  1984. case HSCPANEL_MININAVBAR: m_panel_MININAVBAR = pPanel; break;
  1985. case HSCPANEL_CONTEXT : m_panel_CONTEXT = pPanel; browser = &m_panel_CONTEXT_WebBrowser ; events = &m_panel_CONTEXT_Events ; break;
  1986. case HSCPANEL_CONTENTS : m_panel_CONTENTS = pPanel; browser = &m_panel_CONTENTS_WebBrowser; events = &m_panel_CONTENTS_Events; break;
  1987. case HSCPANEL_HHWINDOW : m_panel_HHWINDOW = pPanel; browser = &m_panel_HHWINDOW_WebBrowser; events = &m_panel_HHWINDOW_Events; break;
  1988. default : __MPC_EXIT_IF_METHOD_FAILS(hr, E_INVALIDARG);
  1989. }
  1990. if(!m_timer && disp)
  1991. {
  1992. CComPtr<IHTMLDocument2> pDoc;
  1993. if(SUCCEEDED(MPC::HTML::IDispatch_To_IHTMLDocument2( pDoc, disp )))
  1994. {
  1995. CComPtr<IServiceProvider> sp;
  1996. CComPtr<ITimerService> ts;
  1997. if(SUCCEEDED(pDoc->QueryInterface( IID_IServiceProvider, (LPVOID*)&sp )))
  1998. {
  1999. if(SUCCEEDED(sp->QueryService( SID_STimerService, IID_ITimerService, (void **)&ts )))
  2000. {
  2001. ts->CreateTimer( NULL, &m_timer );
  2002. m_DisplayTimer.Initialize( m_timer );
  2003. m_ActionsTimer.Initialize( m_timer );
  2004. }
  2005. }
  2006. }
  2007. }
  2008. if(browser && events)
  2009. {
  2010. CComQIPtr<IWebBrowser2> wb2 = disp;
  2011. if(wb2)
  2012. {
  2013. MPC_SCRIPTHELPER_PUT__DIRECT(wb2, RegisterAsDropTarget, VARIANT_FALSE); // wb2.RegisterAsDropTarget = false;
  2014. events->Attach( wb2 );
  2015. }
  2016. else
  2017. {
  2018. events->Detach();
  2019. }
  2020. *browser = wb2;
  2021. }
  2022. }
  2023. }
  2024. }
  2025. if(event == MARSHOST_ON_PANEL_INIT)
  2026. {
  2027. DEBUG_AppendPerf( DEBUG_PERF_MARS, "OnHostNotify - MARSHOST_ON_PANEL_INIT" );
  2028. }
  2029. if(event == MARSHOST_ON_PLACE_TRANSITION_DONE)
  2030. {
  2031. CComQIPtr<IMarsPlace> place = punk;
  2032. if(place)
  2033. {
  2034. m_bstrCurrentPlace.Empty();
  2035. MPC_SCRIPTHELPER_GET__DIRECT(m_bstrCurrentPlace, place, name);
  2036. (void)m_Events.FireEvent_Transition( m_bstrCurrentPlace );
  2037. }
  2038. }
  2039. if(event == MARSHOST_ON_SCRIPT_ERROR)
  2040. {
  2041. CComQIPtr<IHTMLDocument2> doc = punk;
  2042. if(doc)
  2043. {
  2044. CComPtr<IHTMLWindow2> win;
  2045. if(SUCCEEDED(doc->get_parentWindow( &win )) && win)
  2046. {
  2047. CComPtr<IHTMLEventObj> ev;
  2048. if(SUCCEEDED(win->get_event( &ev )) && ev)
  2049. {
  2050. CComDispatchDriver driver( ev );
  2051. MPC::wstring strMessage;
  2052. MPC::wstring strUrl;
  2053. long lLine;
  2054. long lCharacter;
  2055. long lCode;
  2056. local_GetProperty( driver, L"errorMessage" , strMessage );
  2057. local_GetProperty( driver, L"errorUrl" , strUrl );
  2058. local_GetProperty( driver, L"errorLine" , lLine );
  2059. local_GetProperty( driver, L"errorCharacter", lCharacter );
  2060. local_GetProperty( driver, L"errorCode" , lCode );
  2061. g_ApplicationLog.LogRecord( L"############################################################\n\n"
  2062. L"Script error:\n\n"
  2063. L"Message : %s" , strMessage.c_str() );
  2064. g_ApplicationLog.LogRecord( L"Url : %s" , strUrl .c_str() );
  2065. g_ApplicationLog.LogRecord( L"Line : %d" , lLine );
  2066. g_ApplicationLog.LogRecord( L"Character: %d" , lCharacter );
  2067. g_ApplicationLog.LogRecord( L"Code : %d\n\n", lCode );
  2068. if(g_Debug_BLOCKERRORS)
  2069. {
  2070. __MPC_SET_ERROR_AND_EXIT(hr, S_OK);
  2071. }
  2072. }
  2073. }
  2074. }
  2075. __MPC_SET_ERROR_AND_EXIT(hr, E_FAIL);
  2076. }
  2077. hr = S_OK;
  2078. __HCP_FUNC_CLEANUP;
  2079. __HCP_FUNC_EXIT(hr);
  2080. }
  2081. HRESULT CPCHHelpCenterExternal::PreTranslateMessage( /*[in]*/ MSG* msg )
  2082. {
  2083. switch(msg->message)
  2084. {
  2085. ////////////////////////////////////////////////////////////////////////////////
  2086. case WM_CLOSE:
  2087. {
  2088. CComPtr<IWebBrowser2> wb2;
  2089. VARIANT_BOOL Cancel;
  2090. if(SUCCEEDED(m_Events.FireEvent_Shutdown( &Cancel )))
  2091. {
  2092. if(Cancel == VARIANT_TRUE)
  2093. {
  2094. return S_OK;
  2095. }
  2096. }
  2097. m_fShuttingDown = true;
  2098. m_DisplayTimer.Stop();
  2099. m_ActionsTimer.Stop();
  2100. wb2.Attach( Context () ); if(wb2) (void)wb2->ExecWB( OLECMDID_STOP, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
  2101. wb2.Attach( Contents() ); if(wb2) (void)wb2->ExecWB( OLECMDID_STOP, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
  2102. wb2.Attach( HHWindow() ); if(wb2) (void)wb2->ExecWB( OLECMDID_STOP, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
  2103. if(m_hs) (void)m_hs->ForceHistoryPopulate();
  2104. }
  2105. break;
  2106. ////////////////////////////////////////////////////////////////////////////////
  2107. case WM_MOUSEWHEEL:
  2108. //
  2109. // Handle Mouse Wheel navigation...
  2110. //
  2111. if(msg->wParam & MK_SHIFT)
  2112. {
  2113. if(m_hs->IsTravelling() == false)
  2114. {
  2115. if(GET_WHEEL_DELTA_WPARAM(msg->wParam) < 0)
  2116. {
  2117. (void)HelpSession()->Back( 1 );
  2118. }
  2119. else
  2120. {
  2121. (void)HelpSession()->Forward( 1 );
  2122. }
  2123. }
  2124. return S_OK;
  2125. }
  2126. //
  2127. // Disable Mouse Wheel zoom...
  2128. //
  2129. if(msg->wParam & MK_CONTROL)
  2130. {
  2131. return S_OK;
  2132. }
  2133. break;
  2134. ////////////////////////////////////////////////////////////////////////////////
  2135. //
  2136. // Sense changes in the colors or resolution and reload style sheets.
  2137. //
  2138. case WM_THEMECHANGED:
  2139. case WM_DISPLAYCHANGE:
  2140. case WM_PALETTECHANGED:
  2141. case WM_SYSCOLORCHANGE:
  2142. if(CHCPProtocolEnvironment::s_GLOBAL->UpdateState())
  2143. {
  2144. for(int i = HSCPANEL_NAVBAR; i<= HSCPANEL_HHWINDOW; i++)
  2145. {
  2146. IMarsPanel* pPanel = Panel( (HscPanel)i );
  2147. if(pPanel)
  2148. {
  2149. CComPtr<IDispatch> disp;
  2150. if(i == HSCPANEL_HHWINDOW)
  2151. {
  2152. CComPtr<IWebBrowser2> wb2; wb2.Attach( HHWindow() );
  2153. disp = wb2;
  2154. }
  2155. else
  2156. {
  2157. (void)pPanel->get_content( &disp );
  2158. }
  2159. (void)local_ApplySettings( disp );
  2160. }
  2161. }
  2162. (void)m_Events.FireEvent_CssChanged();
  2163. }
  2164. break;
  2165. ////////////////////////////////////////////////////////////////////////////////
  2166. //
  2167. // (weizhao) Sense changes in the system settings (e.g. accessibility settings
  2168. // such as high-contrast mode).
  2169. //
  2170. case WM_SETTINGCHANGE:
  2171. ProcessMessage( msg );
  2172. break;
  2173. // default:
  2174. // DebugLog( "MSG: %d %04x %08x\n", msg->message, msg->wParam, msg->lParam );
  2175. }
  2176. return m_DOCUI ? m_DOCUI->TranslateAccelerator( msg, NULL, 0 ) : E_NOTIMPL;
  2177. }
  2178. ////////////////////////////////////////
  2179. HRESULT CPCHHelpCenterExternal::SetHelpViewer( /*[in]*/ IPCHHelpViewerWrapper* pWrapper )
  2180. {
  2181. m_panel_HHWINDOW_Wrapper = pWrapper;
  2182. if(pWrapper)
  2183. {
  2184. CComPtr<IUnknown> unk; (void)pWrapper->get_WebBrowser( &unk );
  2185. CComQIPtr<IWebBrowser2> wb = unk;
  2186. if(wb)
  2187. {
  2188. m_panel_HHWINDOW_WebBrowser = wb;
  2189. m_panel_HHWINDOW_Events.Attach( wb );
  2190. }
  2191. }
  2192. else
  2193. {
  2194. m_panel_HHWINDOW_WebBrowser.Release();
  2195. m_panel_HHWINDOW_Events.Detach();
  2196. }
  2197. return S_OK;
  2198. }
  2199. ////////////////////////////////////////////////////////////////////////////////
  2200. HRESULT CPCHHelpCenterExternal::CreateScriptWrapper( /*[in]*/ REFCLSID rclsid, /*[in]*/ BSTR bstrCode, /*[in]*/ BSTR bstrURL, /*[out]*/ IUnknown* *ppObj )
  2201. {
  2202. return m_Service ? m_Service->CreateScriptWrapper( rclsid, bstrCode, bstrURL, ppObj ) : E_ACCESSDENIED;
  2203. }
  2204. ////////////////////////////////////////////////////////////////////////////////
  2205. HRESULT CPCHHelpCenterExternal::CallFunctionOnPanel( /*[in] */ HscPanel id ,
  2206. /*[in] */ LPCWSTR szFrame ,
  2207. /*[in] */ BSTR bstrName ,
  2208. /*[in] */ VARIANT* pvarParams ,
  2209. /*[in] */ int nParams ,
  2210. /*[out]*/ VARIANT* pvarRet )
  2211. {
  2212. HRESULT hr;
  2213. CComPtr<IHTMLWindow2> win;
  2214. if(SUCCEEDED(hr = GetPanelWindowObject( id, &win, szFrame )))
  2215. {
  2216. CComDispatchDriver driver( win );
  2217. hr = driver.InvokeN( bstrName, pvarParams, nParams, pvarRet );
  2218. }
  2219. return hr;
  2220. }
  2221. HRESULT CPCHHelpCenterExternal::ReadVariableFromPanel( /*[in] */ HscPanel id ,
  2222. /*[in] */ LPCWSTR szFrame ,
  2223. /*[in] */ BSTR bstrVariable ,
  2224. /*[out]*/ CComVariant& varRet )
  2225. {
  2226. HRESULT hr;
  2227. CComPtr<IHTMLWindow2> win;
  2228. varRet.Clear();
  2229. if(SUCCEEDED(hr = GetPanelWindowObject( id, &win, szFrame )))
  2230. {
  2231. CComDispatchDriver driver( win );
  2232. hr = driver.GetPropertyByName( bstrVariable, &varRet );
  2233. }
  2234. return hr;
  2235. }