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.

242 lines
6.2 KiB

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "Comctl32.OCX"
  3. Begin VB.MDIForm MDIForm1
  4. BackColor = &H00FFC0C0&
  5. Caption = "Microsoft Fax Server Test Application"
  6. ClientHeight = 6084
  7. ClientLeft = 4488
  8. ClientTop = 4992
  9. ClientWidth = 9600
  10. Icon = "mdiwin.frx":0000
  11. LinkTopic = "MDIForm1"
  12. Begin ComctlLib.Toolbar Toolbar
  13. Align = 1 'Align Top
  14. Height = 396
  15. Left = 0
  16. TabIndex = 0
  17. Top = 0
  18. Width = 9600
  19. _ExtentX = 16933
  20. _ExtentY = 699
  21. ButtonWidth = 635
  22. ButtonHeight = 582
  23. Appearance = 1
  24. _Version = 327680
  25. MouseIcon = "mdiwin.frx":0442
  26. End
  27. Begin VB.PictureBox Picture1
  28. Align = 1 'Align Top
  29. Height = 495
  30. Left = 0
  31. Picture = "mdiwin.frx":045E
  32. ScaleHeight = 444
  33. ScaleWidth = 9552
  34. TabIndex = 1
  35. Top = 396
  36. Visible = 0 'False
  37. Width = 9600
  38. End
  39. Begin ComctlLib.ImageList ImageList1
  40. Left = 0
  41. Top = 480
  42. _ExtentX = 995
  43. _ExtentY = 995
  44. BackColor = -2147483643
  45. MaskColor = 12632256
  46. _Version = 327680
  47. End
  48. Begin VB.Menu File
  49. Caption = "&File"
  50. Begin VB.Menu Exit
  51. Caption = "E&xit"
  52. End
  53. End
  54. Begin VB.Menu FaxServer
  55. Caption = "Fax &Server"
  56. Begin VB.Menu Connect
  57. Caption = "&Connect..."
  58. End
  59. Begin VB.Menu Disconnect
  60. Caption = "&Disconnect"
  61. Enabled = 0 'False
  62. End
  63. Begin VB.Menu server_properties
  64. Caption = "&Properties"
  65. Enabled = 0 'False
  66. End
  67. End
  68. Begin VB.Menu Document
  69. Caption = "Document"
  70. Visible = 0 'False
  71. Begin VB.Menu NewDocument
  72. Caption = "&New Fax Document"
  73. End
  74. Begin VB.Menu Send
  75. Caption = "&Send"
  76. Enabled = 0 'False
  77. End
  78. Begin VB.Menu BroadCast
  79. Caption = "&BroadCast"
  80. Enabled = 0 'False
  81. End
  82. Begin VB.Menu DocProp
  83. Caption = "&Properties"
  84. Enabled = 0 'False
  85. End
  86. End
  87. End
  88. Attribute VB_Name = "MDIForm1"
  89. Attribute VB_GlobalNameSpace = False
  90. Attribute VB_Creatable = False
  91. Attribute VB_PredeclaredId = True
  92. Attribute VB_Exposed = False
  93. Private Sub Connect_Click()
  94. Connect_Server
  95. End Sub
  96. Private Sub Disconnect_Click()
  97. DisConnect_Server
  98. End Sub
  99. Private Sub DocProp_Click()
  100. Document_Properties
  101. End Sub
  102. Private Sub Exit_Click()
  103. End
  104. End Sub
  105. Private Sub MDIForm_Load()
  106. Set FAX = CreateObject("FaxServer.FaxServer")
  107. Connected = False
  108. Dim imgX As ListImage
  109. Dim btnX As Button
  110. Set imgX = ImageList1.ListImages.Add(, "Connect", Picture1.Picture)
  111. Toolbar.ImageList = ImageList1
  112. Toolbar.Buttons.Add , , , tbrSeparator
  113. Set btnX = Toolbar.Buttons.Add(, "Connect", , tbrDefault, "Connect")
  114. btnX.ToolTipText = "Connect to a Fax Server"
  115. btnX.Description = btnX.ToolTipText
  116. End Sub
  117. Private Sub NewDocument_Click()
  118. New_FaxDocument
  119. End Sub
  120. Private Sub Send_Click()
  121. Send_Document
  122. End Sub
  123. Private Sub server_properties_Click()
  124. server_property
  125. End Sub
  126. Private Sub Toolbar_ButtonClick(ByVal Button As ComctlLib.Button)
  127. If Button.Key = "Connect" Then
  128. If Connected Then
  129. DisConnect_Server
  130. Else
  131. Connect_Server
  132. End If
  133. End If
  134. End Sub
  135. Private Sub Connect_Server()
  136. ConnectDialog.Show 1
  137. If Connected Then
  138. Connect.Enabled = False
  139. Disconnect.Enabled = True
  140. Document.Visible = True
  141. NewDocument.Enabled = True
  142. server_properties.Enabled = True
  143. DeviceListWindow.Show
  144. End If
  145. End Sub
  146. Private Sub DisConnect_Server()
  147. On Error Resume Next
  148. Err.Clear
  149. FAX.Disconnect
  150. If Err.Number <> 0 Then
  151. msg = "Could not disconnect from the fax server"
  152. MsgBox msg, , "Error"
  153. Exit Sub
  154. End If
  155. Unload DeviceListWindow
  156. Unload DeviceWindow
  157. Unload FaxDocument
  158. Connect.Enabled = True
  159. Disconnect.Enabled = False
  160. Connected = False
  161. NewDocument.Enabled = False
  162. Document.Visible = False
  163. server_properties.Enabled = False
  164. End Sub
  165. Private Sub New_FaxDocument()
  166. On Error Resume Next
  167. NewFaxDialog.Show 1
  168. If Err.Number <> 0 Then
  169. msg = "Could not create a fax document"
  170. MsgBox msg, , "Error"
  171. Unload NewFaxDialog
  172. Exit Sub
  173. Else
  174. Send.Enabled = True
  175. BroadCast.Enabled = True
  176. DocProp.Enabled = True
  177. NewDocument.Enabled = False
  178. End If
  179. End Sub
  180. Private Sub Send_Document()
  181. On Error Resume Next
  182. FaxDocument.Send
  183. If Err.Number <> 0 Then
  184. msg = "Could not send document [" + Hex(Err.Number) + "]"
  185. MsgBox msg, , "Error"
  186. Send.Enabled = False
  187. BroadCast.Enabled = False
  188. End If
  189. End Sub
  190. Private Sub Document_Properties()
  191. On Error Resume Next
  192. DocProperty.Show 1
  193. If Err.Number <> 0 Then
  194. msg = "Could not get document properties"
  195. MsgBox msg, , "Error"
  196. Unload DocProperty
  197. Exit Sub
  198. Else
  199. Send.Enabled = True
  200. BroadCast.Enabled = True
  201. DocProp.Enabled = True
  202. NewDocument.Enabled = False
  203. End If
  204. If Doc = True Then
  205. NewDocument.Enabled = False
  206. End If
  207. End Sub
  208. Private Sub server_property()
  209. On Error Resume Next
  210. ServerProperty.Show 1
  211. If Err.Number <> 0 Then
  212. msg = "could not get server properties"
  213. MsgBox msg, , "Error"
  214. Unload ServerProperties
  215. Exit Sub
  216. End If
  217. End Sub