70 lines
2.4 KiB
VB.net
70 lines
2.4 KiB
VB.net
Imports System.Threading
|
|
Public Class ACT
|
|
|
|
Public C As Client
|
|
Private Sub ACT_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Refresh()
|
|
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
|
|
|
|
Public Sub Refresh()
|
|
|
|
ListView1.Items.Clear()
|
|
|
|
ToolStripStatusLabel2.Text = "Wait.."
|
|
|
|
Dim B As Byte() = SB("GetWindows")
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
|
|
End Sub
|
|
|
|
Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListView1.SelectedIndexChanged
|
|
Try
|
|
ToolStripStatusLabel1.Text = "Selected [" & ListView1.SelectedItems.Count.ToString & "]"
|
|
Catch ex As Exception
|
|
Debug.WriteLine(ex.Message)
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub ACT_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
|
Dim B As Byte() = SB("CloseActiveWindows")
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
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
|
|
|
|
Private Sub ToolStripMenuItem4_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem4.Click
|
|
Refresh()
|
|
End Sub
|
|
|
|
Private Sub ToolStripMenuItem6_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem6.Click
|
|
Dim HL As String
|
|
HL = Nothing
|
|
For Each item As ListViewItem In ListView1.SelectedItems
|
|
HL &= item.SubItems(1).Text & "-=>"
|
|
Next
|
|
Dim B As Byte() = SB("KillWindows" & SettingsHelper.SPL & HL)
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
End Sub
|
|
End Class |