Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

216 lines
8.6 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  4. <TITLE></TITLE>
  5. </HEAD>
  6. <BODY topMargin=0>
  7. <TABLE>
  8. <TR>
  9. <TD><BUTTON id=connectButton name=connectButton onclick=ConnectButtonHandler()>Connect</BUTTON></TD>
  10. <TD><INPUT id=parmsInput name=parmsInput
  11. style="WIDTH: 400px" width="400"></INPUT></TD>
  12. <TD><BUTTON id=disconnectButton name=disconnectButton onclick=DisconnectButtonHandler()>Disconnect</BUTTON></TD></TR>
  13. </TABLE>
  14. <TABLE border=0 cellPadding=0 cellSpacing=0>
  15. <TBODY>
  16. <TR>
  17. <TD>
  18. <P>
  19. <OBJECT classid=clsid:299BE050-E83E-4DB7-A7DA-D86FDEBFE6D0
  20. data=data:application/x-oleobject;base64,UOCbKT7ot02n2thv3r/m0AADAAAlQgAAnDEAAA==
  21. height=480 id=ClientHost name=ClientHost
  22. style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; HEIGHT: 480px; WIDTH: 640px"
  23. width=640></OBJECT>
  24. </P>
  25. </TD>
  26. </TR>
  27. </TBODY>
  28. </TABLE>
  29. <P></P>
  30. <BUTTON id=remoteControlButton name=RemoteControlButton onclick=RemoteControlButtonHandler()>Remote Control</BUTTON>
  31. <BUTTON id=stopRemoteControlButton name=stopRemoteControlButton onclick=RemoteControlEndButtonHandler()>Stop Remote Control</BUTTON>
  32. <TABLE>
  33. <TR>
  34. <TD>
  35. <TABLE>
  36. <TR>
  37. <TD><INPUT id=incomingChatText name=incomingChatText height="150" style="HEIGHT: 150px; WIDTH: 275px" width="275"
  38. ></INPUT></TD>
  39. </TR>
  40. <TR>
  41. <TD><INPUT id=chatText name=chatText style="WIDTH: 275px" width="275" ></INPUT></TD>
  42. <TD><BUTTON id=sendChatButton name=sendChatButton onclick=SendChatButtonHandler()>Send</BUTTON></TD>
  43. </TR>
  44. </TABLE>
  45. </TD>
  46. </TR>
  47. </TABLE>
  48. <SCRIPT Language="JScript">
  49. var RemoteDesktopClientObj = null;
  50. var QryMgr = null;
  51. var FolderNodeId = 0;
  52. var RootDataCol = null;
  53. var ChannelManager = null;
  54. var ChatChannel = null;
  55. var Server = null;
  56. var Port = null;
  57. function ConnectedHandler() {
  58. Server = RemoteDesktopClientObj.ConnectedServer;
  59. Port = RemoteDesktopClientObj.ConnectedPort;
  60. alert("ClientHost_Connected " + Server + " " + Port);
  61. }
  62. function SendChatButtonHandler() {
  63. if (ChatChannel != null) {
  64. ChatChannel.SendChannelData(chatText.value);
  65. }
  66. }
  67. function DisconnectButtonHandler() {
  68. if (RemoteDesktopClientObj != null) {
  69. RemoteDesktopClientObj.DisconnectFromServer();
  70. }
  71. }
  72. function RemoteControlButtonHandler() {
  73. if (RemoteDesktopClientObj != null) {
  74. RemoteDesktopClientObj.ConnectRemoteDesktop();
  75. }
  76. }
  77. function RemoteControlEndButtonHandler() {
  78. if (RemoteDesktopClientObj != null) {
  79. RemoteDesktopClientObj.DisconnectRemoteDesktop();
  80. }
  81. }
  82. function DisconnectedHandler(reason) {
  83. var str = "Unknown Error!!!!";
  84. switch(reason) {
  85. case 0 : str = "SAFERROR_NOERROR";
  86. break;
  87. case 1 : str = "SAFERROR_NOINFO";
  88. break;
  89. case 3 : str = "SAFERROR_LOCALNOTERROR";
  90. break;
  91. case 4 : str = "SAFERROR_REMOTEBYUSER";
  92. break;
  93. case 5 : str = "SAFERROR_BYSERVER";
  94. break;
  95. case 6 : str = "SAFERROR_DNSLOOKUPFAILED";
  96. break;
  97. case 7 : str = "SAFERROR_OUTOFMEMORY";
  98. break;
  99. case 8 : str = "SAFERROR_CONNECTIONTIMEDOUT";
  100. break;
  101. case 9 : str = "SAFERROR_SOCKETCONNECTFAILED";
  102. break;
  103. case 11 : str = "SAFERROR_HOSTNOTFOUND";
  104. break;
  105. case 12 : str = "SAFERROR_WINSOCKSENDFAILED";
  106. break;
  107. case 14 : str = "SAFERROR_INVALIDIPADDR";
  108. break;
  109. case 15 : str = "SAFERROR_SOCKETRECVFAILED";
  110. break;
  111. case 18 : str = "SAFERROR_INVALIDENCRYPTION";
  112. break;
  113. case 20 : str = "SAFERROR_GETHOSTBYNAMEFAILED";
  114. break;
  115. case 21 : str = "SAFERROR_LICENSINGFAILED";
  116. break;
  117. case 22 : str = "SAFERROR_ENCRYPTIONERROR";
  118. break;
  119. case 23 : str = "SAFERROR_DECRYPTIONERROR";
  120. break;
  121. case 24 : str = "SAFERROR_INVALIDPARAMETERSTRING";
  122. break;
  123. case 25 : str = "SAFERROR_HELPSESSIONNOTFOUND";
  124. break;
  125. case 26 : str = "SAFERROR_INVALIDPASSWORD";
  126. break;
  127. case 27 : str = "SAFERROR_HELPSESSIONEXPIRED";
  128. break;
  129. case 28 : str = "SAFERROR_CANTOPENRESOLVER";
  130. break;
  131. case 29 : str = "SAFERROR_UNKNOWNSESSMGRERROR";
  132. break;
  133. case 30 : str = "SAFERROR_CANTFORMLINKTOUSERSESSION";
  134. break;
  135. case 31 : str = "SAFERROR_SHADOWFAILED";
  136. break;
  137. case 32 : str = "SAFERROR_RCPROTOCOLERROR";
  138. break;
  139. case 33 : str = "SAFERROR_RCUNKNOWNERROR";
  140. break;
  141. case 34 : str = "SAFERROR_INTERNALERROR";
  142. break;
  143. }
  144. var msg = "ClientHost_Disconnected: " + str;
  145. alert(msg);
  146. }
  147. function RemoteControlRequestCompleteHandler(status) {
  148. var str = "!!!!Unknown Error ... you Better not Check In!!!!";
  149. if (status != 0) {
  150. switch(status) {
  151. case 301 : str = "SAFERROR_SHADOWEND_CONFIGCHANGE";
  152. break;
  153. case 302 : str = "SAFERROR_SHADOWEND_UNKNOWN";
  154. break;
  155. }
  156. var msg = "RemoteControlRequestCompleteHandler: " + str;
  157. alert(msg);
  158. }
  159. }
  160. function ChannelDataReadyHandler(channelID) {
  161. var str;
  162. str = ChatChannel.ReceiveChannelData();
  163. incomingChatText.value = incomingChatText.value + "\n" + str;
  164. }
  165. function ConnectButtonHandler() {
  166. RemoteDesktopClientObj = ClientHost.GetRemoteDesktopClient();
  167. // RemoteDesktopClientObj.EnableSmartSizing = true;
  168. // Bind the event handlers for this object.
  169. RemoteDesktopClientObj.OnConnected = function()
  170. { ConnectedHandler(); }
  171. RemoteDesktopClientObj.OnDisconnected = function(reason)
  172. { DisconnectedHandler(reason); }
  173. RemoteDesktopClientObj.OnConnectRemoteDesktopComplete = function(status)
  174. { RemoteControlRequestCompleteHandler(status); }
  175. // Add the 'chat' channel.
  176. ChannelManager = RemoteDesktopClientObj.ChannelManager;
  177. if (ChatChannel == null) {
  178. ChatChannel = ChannelManager.OpenDataChannel("70");
  179. ChatChannel.OnChannelDataReady = function()
  180. { ChannelDataReadyHandler(); }
  181. }
  182. RemoteDesktopClientObj.ConnectParms = parmsInput.value;
  183. RemoteDesktopClientObj.ConnectToServer("12345");
  184. }
  185. </SCRIPT>
  186. </BODY>
  187. </HTML>