home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / resocd / res_2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  7.5 KB  |  216 lines

  1. VERSION 2.00
  2. Begin Form Form2 
  3.    BackColor       =   &H0000FFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Resource Bar"
  6.    ClientHeight    =   3360
  7.    ClientLeft      =   3045
  8.    ClientTop       =   1245
  9.    ClientWidth     =   2655
  10.    Height          =   3765
  11.    Left            =   2985
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3360
  17.    ScaleWidth      =   2655
  18.    Top             =   900
  19.    Width           =   2775
  20.    Begin SSPanel Panel3D1 
  21.       BackColor       =   &H00C0C0C0&
  22.       BevelInner      =   1  'Inset
  23.       BevelOuter      =   1  'Inset
  24.       BevelWidth      =   3
  25.       BorderWidth     =   4
  26.       Font3D          =   0  'None
  27.       ForeColor       =   &H00000000&
  28.       Height          =   3375
  29.       Left            =   0
  30.       TabIndex        =   0
  31.       Top             =   0
  32.       Width           =   2655
  33.       Begin SSCommand OkButton 
  34.          BevelWidth      =   5
  35.          Caption         =   "Ok"
  36.          Font3D          =   2  'Raised w/heavy shading
  37.          ForeColor       =   &H00000000&
  38.          Height          =   495
  39.          Left            =   1560
  40.          TabIndex        =   9
  41.          Top             =   2640
  42.          Width           =   735
  43.       End
  44.       Begin SSCommand HelpButton 
  45.          BevelWidth      =   5
  46.          Caption         =   "Help"
  47.          Font3D          =   2  'Raised w/heavy shading
  48.          ForeColor       =   &H00000000&
  49.          Height          =   495
  50.          Left            =   360
  51.          TabIndex        =   1
  52.          Top             =   2640
  53.          Width           =   735
  54.       End
  55.       Begin SSFrame Frame3D2 
  56.          Caption         =   "Bottom Of The Hour"
  57.          Font3D          =   2  'Raised w/heavy shading
  58.          ForeColor       =   &H00C00000&
  59.          Height          =   855
  60.          Left            =   240
  61.          TabIndex        =   6
  62.          Top             =   1680
  63.          Width           =   2175
  64.          Begin SSOption Ding 
  65.             Caption         =   "None"
  66.             Font3D          =   4  'Inset w/heavy shading
  67.             ForeColor       =   &H00000000&
  68.             Height          =   255
  69.             Index           =   1
  70.             Left            =   120
  71.             TabIndex        =   8
  72.             TabStop         =   0   'False
  73.             Top             =   480
  74.             Width           =   1695
  75.          End
  76.          Begin SSOption Ding 
  77.             Caption         =   "Ding"
  78.             Font3D          =   4  'Inset w/heavy shading
  79.             ForeColor       =   &H00000000&
  80.             Height          =   255
  81.             Index           =   0
  82.             Left            =   120
  83.             TabIndex        =   7
  84.             Top             =   240
  85.             Value           =   -1  'True
  86.             Width           =   1695
  87.          End
  88.       End
  89.       Begin SSFrame Frame3D1 
  90.          Caption         =   "Top Of The Hour"
  91.          Font3D          =   2  'Raised w/heavy shading
  92.          ForeColor       =   &H00C00000&
  93.          Height          =   1335
  94.          Left            =   240
  95.          TabIndex        =   2
  96.          Top             =   240
  97.          Width           =   2175
  98.          Begin SSOption BigBen 
  99.             Caption         =   "None"
  100.             Font3D          =   4  'Inset w/heavy shading
  101.             ForeColor       =   &H00000000&
  102.             Height          =   255
  103.             Index           =   2
  104.             Left            =   120
  105.             TabIndex        =   5
  106.             TabStop         =   0   'False
  107.             Top             =   960
  108.             Width           =   1455
  109.          End
  110.          Begin SSOption BigBen 
  111.             Caption         =   "Ding"
  112.             Font3D          =   4  'Inset w/heavy shading
  113.             ForeColor       =   &H00000000&
  114.             Height          =   255
  115.             Index           =   1
  116.             Left            =   120
  117.             TabIndex        =   4
  118.             TabStop         =   0   'False
  119.             Top             =   600
  120.             Width           =   1455
  121.          End
  122.          Begin SSOption BigBen 
  123.             Caption         =   "Big Ben"
  124.             Font3D          =   4  'Inset w/heavy shading
  125.             ForeColor       =   &H00000000&
  126.             Height          =   255
  127.             Index           =   0
  128.             Left            =   120
  129.             TabIndex        =   3
  130.             Top             =   240
  131.             Value           =   -1  'True
  132.             Width           =   1455
  133.          End
  134.       End
  135.    End
  136. Sub BigBen_Click (Index As Integer, Value As Integer)
  137. If BigBen(0).Value = True Then NewTopOfHour$ = "BIGBEN"
  138. If BigBen(1).Value = True Then NewTopOfHour$ = "DING"
  139. If BigBen(2).Value = True Then NewTopOfHour$ = "NONE"
  140. End Sub
  141. Sub Command3D1_Click ()
  142. Unload Form2
  143. Call Help_Me
  144. End Sub
  145. Sub DING_Click (Index As Integer, Value As Integer)
  146. If DING(0).Value = True Then NewBottOfHour$ = "DING"
  147. If DING(1).Value = True Then NewBottOfHour$ = "NONE"
  148. End Sub
  149. Sub Form_Load ()
  150. 'Take away the ON TOP feature in case user has
  151. ' positioned "bar" in front of where the form will appear
  152. ' Then reinstate the ON TOP feature in the Form_Unload
  153. ' proceedure.
  154.     NotOnTop% = SetWindowPos(Form1.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
  155. 'read .ini file in case user changed
  156. ' it manually
  157.  'Does user want BigBen,DING, or nothing at top of hour
  158. AppName$ = "RESOURCE BAR"
  159. KeyName$ = "TOPOFHOUR"
  160. DefltStr$ = "BIGBEN"
  161. Dim RetStr As String * 255
  162. RetStr$ = String$(255, 0)
  163. nSize% = 255
  164. FileName$ = "RESOURCE.INI"
  165. LngthOfRetStr% = GetPrivateProfileString(AppName$, KeyName$, DefltStr$, RetStr$, nSize%, FileName$)
  166. TopOfHour$ = UCase$(Left$(RetStr$, LngthOfRetStr%))
  167.  'Does user want DING or nothing at bottom of hour
  168. AppName$ = "RESOURCE BAR"
  169. KeyName$ = "BOTTOFHOUR"
  170. DefltStr$ = "DING"
  171. RetStr$ = String$(255, 0)
  172. nSize% = 255
  173. FileName$ = "RESOURCE.INI"
  174. LngthOfRetStr% = GetPrivateProfileString(AppName$, KeyName$, DefltStr$, RetStr$, nSize%, FileName$)
  175. BottOfHour$ = UCase$(Left$(RetStr$, LngthOfRetStr%))
  176. If TopOfHour$ = "BIGBEN" Then BigBen(0).Value = True
  177. If TopOfHour$ = "DING" Then BigBen(1).Value = True
  178. If TopOfHour$ = "NONE" Then BigBen(2).Value = True
  179. If BottOfHour$ = "DING" Then DING(0).Value = True
  180. If BottOfHour$ = "NONE" Then DING(1).Value = True
  181. End Sub
  182. Sub Form_Unload (Cancel As Integer)
  183. AppName$ = "RESOURCE BAR"
  184. KeyName$ = "BOTTOFHOUR"
  185. FileName$ = "RESOURCE.INI"
  186. If NewBottOfHour$ <> BottOfHour$ Then 'if Option changed, rewrite INI file
  187.         BottOfHour$ = NewBottOfHour$
  188.         NewVal$ = BottOfHour$
  189. ResultCode% = WritePrivateProfileString(AppName$, KeyName$, NewVal$, FileName$)
  190.     If ResultCode% = 0 Then
  191.             MsgBox "Error updating INI file!", 16, "ERROR!"
  192.     End If
  193. End If
  194. 'now check top of the hour setting
  195. AppName$ = "RESOURCE BAR"
  196. KeyName$ = "TOPOFHOUR"
  197. FileName$ = "RESOURCE.INI"
  198. If NewTopOfHour$ <> TopOfHour$ Then 'if Option changed, rewrite INI file
  199.         TopOfHour$ = NewTopOfHour$
  200.         NewVal$ = TopOfHour$
  201. ResultCode% = WritePrivateProfileString(AppName$, KeyName$, NewVal$, FileName$)
  202.     If ResultCode% = 0 Then
  203.             MsgBox "Error updating INI file!", 16, "ERROR!"
  204.     End If
  205. End If
  206. Unload Form2
  207. OnTop% = SetWindowPos(Form1.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  208. End Sub
  209. Sub HelpButton_Click ()
  210. Unload Form2
  211. Call Help_Me
  212. End Sub
  213. Sub OkButton_Click ()
  214. Call Form_Unload(0)
  215. End Sub
  216.