Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Declare Sub CheckBoxRWClick(Sender as QCheckBox)
Declare Sub CheckBoxSTClick(Sender as QCheckBox)
Declare Sub RateBoxChange(Sender as QComboBox)
Create Settings as QForm
      Caption = "Settings"
      Top     = 309
      Left    = 391
      Width   = 241
      Height  = 150
      BorderStyle = bsToolWindow
      Center
End Create
Create GroupBoxSet as QGroupBox
      Parent  = Settings
      Top     = 0
      Left    = 8
      Width   = 217
      Height  = 113
      Caption = ""
      Color   = &HD8E9EC
End Create
Create CheckBoxST as QCheckBox
      Parent  = GroupBoxSet
      Top     = 16
      Left    = 16
      Width   = 97
      Height  = 17
      Caption = "&Stay on top"
      OnClick = CheckBoxSTClick
End Create
Create CheckBoxRW as QCheckBox
      Parent  = GroupBoxSet
      Top     = 40
      Left    = 16
      Width   = 97
      Height  = 17
      Caption = "&Read/Write"
      OnClick = CheckBoxRWClick
End Create
Create RateBox as QComboBox
      Parent  = GroupBoxSet
      Top     = 80
      Left    = 16
      Width   = 97
      Height  = 21
      Text    = ""
      Color   = &HFFFFFF
      AddItems  ("50","100","300","500","1000","1500","2000")
      OnChange = RateBoxChange
      ItemIndex = 2
End Create
Create LRate as QLabel
      Parent  = GroupBoxSet
      Top     = 64
      Left    = 16
      Width   = 44
      Height  = 13
      Caption = "&Sample Rate:"
      Color   = &HD8E9EC
End Create
 
Sub CheckBoxRWClick(Sender as QCheckBox)
If Sender.Checked then
   TTime.Enabled = 1
   Else
   TTime.Enabled = 0
End If
End Sub

Sub CheckBoxSTClick(Sender as QCheckBox)
If Sender.Checked then
   SetWindowPos(LPT.Handle,-1,0,0,0,0,&H2 or &H1)
   Else
   LPT.FormStyle = fsNormal
End If
End Sub
 
Sub RateBoxChange(Sender as QComboBox)
TTime.Interval = Val(Sender.Item(Sender.ItemIndex))
End Sub
