'Modified 01/04/13 
'COPYRIGHT GPM 2013-2014
'-----------------------------------------------------------------------------
'
' Product:     GPM Clam Antivirus
'
' Author:      Gian20 [Gian20 at users dot sourceforge dot net]
'
' Created:     n/a
' Copyright:   Copyright GPM (c) 2013-2014
' Licence:
'   This program is free software; you can redistribute it and/or modify
'   it under the terms of the GNU General Public License as published by
'   the Free Software Foundation; either version 2 of the License, or
'   (at your option) any later version.
'
'   This program is distributed in the hope that it will be useful,
'   but WITHOUT ANY WARRANTY; without even the implied warranty of
'   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'   GNU General Public License for more details.
'
'  You should have received a copy of the GNU General Public License
'   along with this program; if not, write to the Free Software
'   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Imports Microsoft.Win32
Imports System.IO
Public Class frmtray
    Dim AppPath = New System.IO.FileInfo(Application.ExecutablePath).DirectoryName
    Private Sub frmtray_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Me.Opacity = 0
            Me.ShowInTaskbar = False



            Dim regKey As RegistryKey
            Dim ver As String
            regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
            ' regKey.SetValue("AppName", "MyRegApp")
            ver = regKey.GetValue("Install_Dir")
            '    If ver < 1.1 Then
            'regKey.SetValue("Version", 1.1)
            'End If
            ' Process.Start(ver & "\GPM-Antivirus-GUI.exe")

            regKey.Close()

        Catch exxxxx As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "GPM Clam Antivirus is not installed!", vbOKOnly + vbCritical, "ERROR!")
            MsgBox("Critical Error Detected!" & vbCrLf & "GPM Clam Antivirus Tray Exiting!", vbOKOnly + vbCritical, "ERROR!")
            Application.Exit()

        End Try
    End Sub

    Private Sub OpenGPMAntivirusGUIToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenGPMAntivirusGUIToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPM-Antivirus-GUI.exe") Then

                Shell(AppPath & "\GPM-Antivirus-GUI.exe", AppWinStyle.NormalFocus)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\GPM-Antivirus-GUI.exe")
                regKey.Close()


            End If
        Catch ex1 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub VisitWebsiteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VisitWebsiteToolStripMenuItem.Click
        Try


        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! ", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub


    Private Sub FollowUsOnTwitterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FollowUsOnTwitterToolStripMenuItem.Click
        Try

        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! ", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub LikeUsOnFacebookToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LikeUsOnFacebookToolStripMenuItem.Click
        Try

        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! ", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
        Try
            MsgBox("GPM Antivirus Tray 2014" & vbCrLf & "Version 14.0" & vbCrLf & "Created by GPM" & vbCrLf & "Please support this program by donating or sharing it to your friends and families and also to the press! Thank You!", MsgBoxStyle.Information, "About: GPM Clam Antivirus")
        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! ", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub HelpToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripMenuItem.Click
        Try
            ' If My.Computer.FileSystem.FileExists(AppPath & "\GPMAV-UPDATE-GUI.exe") Then

            '    Shell(AppPath & "\GPMAV-UPDATE-GUI.exe", AppWinStyle.NormalFocus)
            ' Else

            Dim regKey As RegistryKey
            Dim ver As String
            regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
            ' regKey.SetValue("AppName", "MyRegApp")
            ver = regKey.GetValue("Install_Dir")
            '    If ver < 1.1 Then
            'regKey.SetValue("Version", 1.1)
            'End If
            Process.Start(ver & "\Help.chm")
            regKey.Close()


            '   End If
        Catch ex5 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found! (Help.chm)", vbOKOnly + vbCritical, "ERROR!")
        End Try

    End Sub

    Private Sub UpdateGUIVisibleToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateGUIVisibleToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPMAV-UPDATE-GUI.exe") Then
                systray1.BalloonTipIcon = ToolTipIcon.Info
                systray1.BalloonTipTitle = "Manual Update"
                systray1.BalloonTipText = "Updating GPM Clam Antivirus Virus Database..."
                systray1.ShowBalloonTip(2000)
                Shell(AppPath & "\GPMAV-UPDATE-GUI.exe")
            Else
                systray1.BalloonTipIcon = ToolTipIcon.Info
                systray1.BalloonTipTitle = "Manual Update"
                systray1.BalloonTipText = "Updating GPM Clam Antivirus Virus Database..."
                systray1.ShowBalloonTip(2000)
                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\GPMAV-UPDATE-GUI.exe")
                regKey.Close()


            End If
        Catch ex2 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub UpdateGUIInvisibleToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateGUIInvisibleToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\gpmavupdate.exe") Then

                systray1.BalloonTipIcon = ToolTipIcon.Info
                systray1.BalloonTipTitle = "Manual Update"
                systray1.BalloonTipText = "Updating GPM Clam Antivirus Virus Database..."
                systray1.ShowBalloonTip(2000)

                Shell(AppPath & "\gpmavupdate.exe --stdout --log=""" & AppPath & "\logs\Autoupdatelog.log", AppWinStyle.Hide)
            Else
                systray1.BalloonTipIcon = ToolTipIcon.Info
                systray1.BalloonTipTitle = "Manual Update"
                systray1.BalloonTipText = "Updating GPM Clam Antivirus Virus Database..."
                systray1.ShowBalloonTip(2000)

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Shell(ver & "\gpmavupdate.exe --stdout --log=""" & ver & "\logs\Autoupdatelog.log", AppWinStyle.Hide)
                regKey.Close()


            End If
        Catch ex3 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub OnToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OnToolStripMenuItem.Click

        Try
            systray1.BalloonTipIcon = ToolTipIcon.Info
            systray1.BalloonTipTitle = "Auto-Update"
            systray1.BalloonTipText = "Auto-Update Activated!"
            systray1.ShowBalloonTip(2000)
            Dim regKey As RegistryKey
            Dim ver As String
            regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
            ' regKey.SetValue("AppName", "MyRegApp")
            ver = regKey.GetValue("Install_Dir")

            If My.Computer.FileSystem.FileExists(AppPath & "\GPMClamAV-AutoUpdate.exe") Then

                Dim regKey1 As RegistryKey
                regKey1 = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
                regKey1.SetValue("GPMClamAV-AutoUpdate", AppPath & "\GPMClamAV-AutoUpdate.exe")
                My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "GPMClamAV-AutoUpdate", AppPath & "\GPMClamAV-AutoUpdate.exe")
                Shell(AppPath & "\GPMClamAV-AutoUpdate.exe")
            Else

                Dim regKey1 As RegistryKey
                regKey1 = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
                regKey1.SetValue("GPMClamAV-AutoUpdate", ver & "\GPMClamAV-AutoUpdate.exe")

                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\GPMClamAV-AutoUpdate.exe")
                My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "GPMClamAV-AutoUpdate", ver & "\GPMClamAV-AutoUpdate.exe")
                regKey.Close()


            End If
        Catch ex4 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub OffToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OffToolStripMenuItem.Click
        Try
            systray1.BalloonTipIcon = ToolTipIcon.Info
            systray1.BalloonTipTitle = "Auto-Update"
            systray1.BalloonTipText = "Auto-Update Activated!"
            systray1.ShowBalloonTip(2000)
            ' Kill all notepad process
            My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "GPMClamAV-AutoUpdate", "0")
            Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("GPMClamAV-AutoUpdate")

            For Each p As Process In pProcess
                p.Kill()
            Next
        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! ", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub OpenGPMAntivirusQuarantineExplorerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\QuarantineExplorer.exe") Then

                Shell(AppPath & "\QuarantineExplorer.exe", AppWinStyle.NormalFocus)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\QuarantineExplorer.exe")
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub DeleteAutorunVirusToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteAutorunVirusToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPMAV-AR.exe") Then

                Shell(AppPath & "\GPMAV-AR.exe", AppWinStyle.NormalFocus)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\GPMAV-AR.exe")
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found(GPMAV-AR)!", vbOKOnly + vbCritical, "ERROR!")
        End Try


    End Sub



    Private Sub DeleteRegisryVirusToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteRegisryVirusToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPMAV-REGFIX.exe") Then

                Shell(AppPath & "\GPMAV-REGFIX.exe", AppWinStyle.NormalFocus)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\GPMAV-REGFIX.exe")
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found(GPMAV-REGFIX)!", vbOKOnly + vbCritical, "ERROR!")
        End Try

    End Sub

    Private Sub OpenGPMAntivirusQuarantineExplorerToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenGPMAntivirusQuarantineExplorerToolStripMenuItem1.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\QuarantineExplorer.exe") Then

                Shell(AppPath & "\QuarantineExplorer.exe", AppWinStyle.NormalFocus)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\QuarantineBrowser.exe")
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    

    Private Sub systray1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        Try
            sysstrp.Show()
        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! ", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub UninstallToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UninstallToolStripMenuItem.Click

        Try
            Beep()
            If MsgBox("Are you sure that you want to uninstall this antivirus program? ", vbYesNo + vbCritical, "???????") = MsgBoxResult.No Then
                'Msgboc("Program will now exit
                '     Application.Exit()
                '   Me.Close()
            Else

                If My.Computer.FileSystem.FileExists(AppPath & "\uninstall.exe") Then

                    Shell(AppPath & "\uninstall.exe", AppWinStyle.NormalFocus)
                    Application.Exit()
                Else

                    Dim regKey As RegistryKey
                    Dim ver As String
                    regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                    ' regKey.SetValue("AppName", "MyRegApp")
                    ver = regKey.GetValue("Install_Dir")
                    '    If ver < 1.1 Then
                    'regKey.SetValue("Version", 1.1)
                    'End If
                    Process.Start(ver & "\uninstall.exe")
                    regKey.Close()

                    Application.Exit()
                End If
            End If



        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
            MsgBox("An Error has occurred! " & vbCrLf & "Uninstall failed!", vbOKOnly + vbCritical, "ERROR!")
        End Try

    End Sub


    Private Sub OpenPCBoosterXpOnlyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenPCBoosterXpOnlyToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPM-Cleaner.exe") Then

                Shell(AppPath & "\GPM-Cleaner.exe", AppWinStyle.NormalFocus)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\GPM-Cleaner.exe")
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub OpenGPMAntivirusProcessExplorerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenGPMAntivirusProcessExplorerToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPM-TaskMgr.exe") Then

                Shell(AppPath & "\GPM-TaskMgr.exe", AppWinStyle.NormalFocus)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Process.Start(ver & "\GPM-TaskMgr.exe")
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found(GPMAV-ProcExplr)!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub BitcoinToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles BitcoinToolStripMenuItem.Click
        Try

        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! ", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub StopRealTimeToolstripmnuitem_Click(sender As Object, e As EventArgs) Handles StopRealTimeToolstripmnuitem.Click
        Try
            ' Kill process
            Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("GPMRT")

            For Each p As Process In pProcess
                p.Kill()
            Next
        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! ", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub RunRealTimeToolstripmnuitem_Click(sender As Object, e As EventArgs) Handles RunRealTimeToolstripmnuitem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPMRT.exe") Then

                Shell(AppPath & "\GPMRT.exe", AppWinStyle.Hide)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Shell(ver & "\GPMRT.exe", AppWinStyle.Hide)
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub OpenGPMToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenGPMToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPM-HEALER.exe") Then

                Shell(AppPath & "\GPM-HEALER.exe", AppWinStyle.Hide)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Shell(ver & "\GPM-HEALER.exe", AppWinStyle.Hide)
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub OpenGPMProcessCleanerToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenGPMProcessCleanerToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPM-ProcClnr.exe") Then

                Shell(AppPath & "\GPM-ProcClnr.exe", AppWinStyle.Hide)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Shell(ver & "\GPM-ProcClnr.exe", AppWinStyle.Hide)
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub OpenGPMUSBStatusToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenGPMUSBStatusToolStripMenuItem.Click
        Try
            If My.Computer.FileSystem.FileExists(AppPath & "\GPM-USBSTATUS.exe") Then

                Shell(AppPath & "\GPM-USBSTATUS.exe", AppWinStyle.Hide)
            Else

                Dim regKey As RegistryKey
                Dim ver As String
                regKey = Registry.LocalMachine.OpenSubKey("Software\GPMClamAV", True)
                ' regKey.SetValue("AppName", "MyRegApp")
                ver = regKey.GetValue("Install_Dir")
                '    If ver < 1.1 Then
                'regKey.SetValue("Version", 1.1)
                'End If
                Shell(ver & "\GPM-USBSTATUS.exe", AppWinStyle.Hide)
                regKey.Close()


            End If
        Catch ex6 As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub VisitProjectPageOnSourceforgenetToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles VisitProjectPageOnSourceforgenetToolStripMenuItem.Click
        Try
            Process.Start("https://sourceforge.net/projects/gpm-clamantivirus/")
        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub OpenChatBoxToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenChatBoxToolStripMenuItem.Click
        Try
            frmChat.ShowDialog()

        Catch ex As Exception
            Beep()
            MsgBox("An Error has occurred! " & vbCrLf & "File not found!", vbOKOnly + vbCritical, "ERROR!")
        End Try
    End Sub

    Private Sub PaypalToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PaypalToolStripMenuItem.Click
        Try
 
        Catch ex As Exception

        End Try
    End Sub

    Private Sub RealTimeProtectionReportsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RealTimeProtectionReportsToolStripMenuItem.Click
        Try
            dlgRTPLog.ShowDialog()
        Catch ex As Exception

        End Try
    End Sub

    Private Sub ScanReportsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ScanReportsToolStripMenuItem.Click
        Try
            dlgScanLogs.ShowDialog()
        Catch ex As Exception

        End Try
    End Sub

    Private Sub UpdateReportsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UpdateReportsToolStripMenuItem.Click
        Try
            dlgautoupdatelog.ShowDialog()
        Catch ex As Exception

        End Try
    End Sub
End Class
