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.

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