Guest User

Untitled

a guest
Dec 11th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Public Class frmMain
  3.     Inherits System.Windows.Forms.Form
  4.  
  5.     Public sDisplay As String()
  6.     Dim gTolerance As Integer
  7.  
  8. #Region " Windows Form Designer generated code "
  9.  
  10.     Public Sub New()
  11.         MyBase.New()
  12.  
  13.         'This call is required by the Windows Form Designer.
  14.        InitializeComponent()
  15.  
  16.         'Add any initialization after the InitializeComponent() call
  17.  
  18.     End Sub
  19.  
  20.     'Form overrides dispose to clean up the component list.
  21.    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  22.         If disposing Then
  23.             If Not (components Is Nothing) Then
  24.                 components.Dispose()
  25.             End If
  26.         End If
  27.         MyBase.Dispose(disposing)
  28.     End Sub
  29.  
  30.     'Required by the Windows Form Designer
  31.    Private components As System.ComponentModel.IContainer
  32.  
  33.     'NOTE: The following procedure is required by the Windows Form Designer
  34.    'It can be modified using the Windows Form Designer.  
  35.    'Do not modify it using the code editor.
  36.    Friend WithEvents Timer1 As System.Windows.Forms.Timer
  37.     Friend WithEvents lblDisplay As System.Windows.Forms.Label
  38.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  39.         Me.components = New System.ComponentModel.Container()
  40.         Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
  41.         Me.lblDisplay = New System.Windows.Forms.Label()
  42.         Me.SuspendLayout()
  43.         '
  44.        'Timer1
  45.        '
  46.        Me.Timer1.Enabled = True
  47.         Me.Timer1.Interval = 1000
  48.         '
  49.        'lblDisplay
  50.        '
  51.        Me.lblDisplay.AutoSize = True
  52.         Me.lblDisplay.BackColor = System.Drawing.Color.Transparent
  53.         Me.lblDisplay.ForeColor = System.Drawing.Color.Yellow
  54.         Me.lblDisplay.Location = New System.Drawing.Point(80, 120)
  55.         Me.lblDisplay.Name = "lblDisplay"
  56.         Me.lblDisplay.Size = New System.Drawing.Size(0, 13)
  57.         Me.lblDisplay.TabIndex = 0
  58.         '
  59.        'frmMain
  60.        '
  61.        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  62.         Me.BackColor = System.Drawing.Color.White
  63.         Me.ClientSize = New System.Drawing.Size(292, 273)
  64.         Me.Controls.Add(Me.lblDisplay)
  65.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
  66.         Me.Name = "frmMain"
  67.         Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
  68.         Me.ResumeLayout(False)
  69.         Me.PerformLayout()
  70.         Dim ProcID As Integer
  71.         ProcID = Shell("C:\Program Files\Infomonitor\Firefox.exe", AppWinStyle.MaximizedFocus)
  72.     End Sub
  73.  
  74. #End Region
  75.  
  76. #Region " Form Events "
  77.  
  78.     Private Sub frmMain_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
  79.  
  80.         'If the mouse moves any more then 10 points. Close the application
  81.        gTolerance += 1
  82.  
  83.         If gTolerance > 10 Then
  84.             Me.Close()
  85.         End If
  86.  
  87.     End Sub
  88.  
  89.     Private Sub frmMain_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
  90.         'If any key is pressed, Close the application
  91.        Me.Close()
  92.     End Sub
  93.  
  94.     Private Sub frmMain_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
  95.  
  96.         If sDisplay Is Nothing Then Exit Sub
  97.  
  98.         'Draw Command Line Args to screen. Good for Debugging
  99.        Dim I As Int16
  100.         Dim sText As String
  101.         Dim F As New Font("Arial", 24, FontStyle.Bold)
  102.         Dim B As New SolidBrush(Color.Yellow)
  103.  
  104.         For I = 0 To sDisplay.Length - 1
  105.             sText = sDisplay(I)
  106.             e.Graphics.DrawString(sText, F, B, I * F.Size, 50)
  107.         Next
  108.  
  109.     End Sub
  110.  
  111. #End Region
  112.  
  113. #Region " Controls "
  114.  
  115.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  116.         gTolerance = 0
  117.     End Sub
  118.  
  119. #End Region
  120.  
  121. End Class
Add Comment
Please, Sign In to add comment