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.

146 lines
4.0 KiB

  1. VERSION 5.00
  2. Begin VB.Form Form1
  3. Caption = "Form1"
  4. ClientHeight = 5400
  5. ClientLeft = 135
  6. ClientTop = 375
  7. ClientWidth = 9825
  8. LinkTopic = "Form1"
  9. ScaleHeight = 5400
  10. ScaleWidth = 9825
  11. StartUpPosition = 3 'Windows Default
  12. Begin VB.CommandButton Command6
  13. Caption = "Chat"
  14. Height = 375
  15. Left = 360
  16. TabIndex = 8
  17. Top = 3960
  18. Width = 2175
  19. End
  20. Begin VB.CommandButton Command5
  21. Caption = "Disable Remote Control"
  22. Height = 375
  23. Left = 360
  24. TabIndex = 5
  25. Top = 2880
  26. Width = 2175
  27. End
  28. Begin VB.CommandButton Command4
  29. Caption = "Enable Remote Control"
  30. Height = 375
  31. Left = 360
  32. TabIndex = 4
  33. Top = 2280
  34. Width = 2175
  35. End
  36. Begin VB.CommandButton Command3
  37. Caption = "Update Connect Parms"
  38. Height = 375
  39. Left = 360
  40. TabIndex = 3
  41. Top = 1560
  42. Width = 2175
  43. End
  44. Begin VB.TextBox ConnectParmsEdit
  45. Height = 375
  46. Left = 3000
  47. TabIndex = 2
  48. Top = 1560
  49. Width = 6495
  50. End
  51. Begin VB.CommandButton Command2
  52. Caption = "Stop Listening"
  53. Height = 375
  54. Left = 360
  55. TabIndex = 1
  56. Top = 840
  57. Width = 2175
  58. End
  59. Begin VB.CommandButton Command1
  60. Caption = "Start Listening"
  61. Height = 375
  62. Left = 360
  63. TabIndex = 0
  64. Top = 360
  65. Width = 2175
  66. End
  67. Begin VB.Frame Frame1
  68. Height = 1335
  69. Left = 120
  70. TabIndex = 6
  71. Top = 120
  72. Width = 2655
  73. End
  74. Begin VB.Frame Frame2
  75. Height = 1455
  76. Left = 120
  77. TabIndex = 7
  78. Top = 2040
  79. Width = 2655
  80. End
  81. Begin VB.Shape Shape1
  82. BackColor = &H0000FF00&
  83. BorderStyle = 0 'Transparent
  84. Height = 180
  85. Left = 8760
  86. Top = 240
  87. Width = 180
  88. End
  89. End
  90. Attribute VB_Name = "Form1"
  91. Attribute VB_GlobalNameSpace = False
  92. Attribute VB_Creatable = False
  93. Attribute VB_PredeclaredId = True
  94. Attribute VB_Exposed = False
  95. Public RDPServerHost As New SAFRemoteDesktopServerHost
  96. Public WithEvents RDPSession As SAFRemoteDesktopSession
  97. Attribute RDPSession.VB_VarHelpID = -1
  98. Public ChannelMgr As ISAFRemoteDesktopChannelMgr
  99. Attribute ChannelMgr.VB_VarHelpID = -1
  100. Public ChatChannel As ISAFRemoteDesktopDataChannel
  101. Attribute ChatChannel.VB_VarHelpID = -1
  102. Private Sub Command1_Click()
  103. Set RDPSession = RDPServerHost.CreateRDSSession(0, "", 0)
  104. 'On Error Resume Next
  105. Set ChannelMgr = RDPSession.ChannelManager
  106. Set ChatChannel = ChannelMgr.OpenDataChannel("70")
  107. End Sub
  108. Private Sub Command2_Click()
  109. RDPServerHost.CloseRDSSession (RDPSession)
  110. End Sub
  111. Private Sub Command3_Click()
  112. Dim Parms As String
  113. Parms = RDPSession.ConnectParms
  114. ConnectParmsEdit.Text = Parms
  115. End Sub
  116. Private Sub Command6_Click()
  117. ChatDialog.Show
  118. End Sub
  119. Private Sub ChatChannel_ChannelDataReady(ByVal channelName As String)
  120. Dim Buffer
  121. Dim Length
  122. Dim TempString As String
  123. ChatDialog.Show
  124. ChatDialog.SetFocus
  125. Buffer = ChatChannel.ReceiveChannelData()
  126. TempString = ChatDialog.OutputChatText.Text & vbCrLf & Buffer
  127. ChatDialog.OutputChatText.Text = TempString
  128. 'ChatDialog.OutputChatText.Text = Buffer
  129. End Sub
  130. Private Sub RDPSession_ClientConnected()
  131. Shape1.BackStyle = 1
  132. End Sub
  133. Private Sub RDPSession_ClientDisconnected()
  134. Shape1.BackStyle = 0
  135. End Sub