many bvuttons

This commit is contained in:
Jonathan Jenne
2019-07-25 16:18:41 +02:00
parent 4438c6e9a7
commit 257ed65246
14 changed files with 2394 additions and 280 deletions

View File

@@ -1,6 +1,8 @@
Imports DD_LIB_Standards
Public Class frmAdministration
Private SelectedProcessName As String
Class ProfileType
Public Name As String
Public Id As Int16
@@ -216,18 +218,6 @@ Public Class frmAdministration
End Try
End Sub
Private Sub TimerTest_Tick(sender As Object, e As EventArgs) Handles TimerTest.Tick
clsWINDOWSApi.Get_ForegroundWindow_Info()
If PID <> CurrPROC_PID And CurrPROC_Name <> "DD_Clipboard_Watcher" Then
lblprocessCheckActive.Visible = True
PID = CurrPROC_PID
txtPID.Text = CurrPROC_PID
txtProcessName.Text = CurrPROC_Name
Else
lblprocessCheckActive.Visible = False
End If
End Sub
Private Sub Load_Profile_Process()
Try
If IsNothing(GUIDTextBox.Text) Or GUIDTextBox.Text = "" Then
@@ -241,54 +231,6 @@ Public Class frmAdministration
End Sub
Private Sub btnLinkProcessPRofile_Click(sender As Object, e As EventArgs) Handles btnLinkProcessPRofile.Click
Try
If txtProcessName.Text <> "" Then
Dim insert = String.Format("INSERT INTO TBCW_PROFILE_PROCESS (PROFILE_ID,PROC_NAME,ADDED_WHO) VALUES ({0},'{1}','{2}')", GUIDTextBox.Text, txtProcessName.Text, Environment.UserName)
If clsDatabase.Execute_non_Query(insert) = False Then
MsgBox("Could not insert the Process-Profile-Link....Check the logfile!", MsgBoxStyle.Exclamation)
End If
End If
Load_Profile_Process()
clsHotkey.Refresh_Profile_Links()
Catch ex As Exception
MsgBox("Unexpected Error while adding Process-Profile-link: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub btndeleteProcessProfileLink_Click(sender As Object, e As EventArgs) Handles btndeleteProcessProfileLink.Click
Try
Dim ID = GridViewProcessProfile.GetFocusedRowCellValue(GridViewProcessProfile.Columns("GUID"))
Try
Dim I As Integer = CInt(ID)
Catch ex As Exception
Exit Sub
End Try
Dim del = String.Format("DELETE FROM TBCW_PROFILE_PROCESS WHERE GUID = {0}", ID)
If clsDatabase.Execute_non_Query(del) = True Then
Load_Profile_Process()
End If
Catch ex As Exception
MsgBox("Unexpected Error in deleting ProfileProcess-Relation: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub btnStartStopProcess_Click(sender As Object, e As EventArgs) Handles btnStartStopProcess.Click
If btnStartStopProcess.Text = "Starte Aktive Fenster-Auswahl" Then
Me.Cursor = Cursors.WaitCursor
txtPID.Text = ""
txtProcessName.Text = ""
TimerTest.Start()
btnStartStopProcess.Text = "Stoppe Auswertung Fenster"
Status_Changed("Auswertung von aktivem Fenster läuft! Wechseln Sie durch die aktiven Anwendungen!", Color.Orange)
Else
Me.Cursor = Cursors.Default
TimerTest.Stop()
btnStartStopProcess.Text = "Starte Aktive Fenster-Auswahl"
Status_Changed("", Color.Transparent)
End If
End Sub
Private Sub WD_SEARCHTextBox_MouseHover(sender As Object, e As EventArgs) Handles WD_SEARCHTextBox.MouseHover
ToolTip1.SetToolTip(WD_SEARCHTextBox, "Replace patterns for string fields: " & vbNewLine & "@Clipboard" & vbNewLine & "@CLIPBOARD" & vbNewLine & "@Zwischenablage" &
vbNewLine & "Replace patterns for integer fields: " & vbNewLine & "123456789" & vbNewLine & "4711")
@@ -407,4 +349,72 @@ Public Class frmAdministration
MsgBox("Unexpected Error in deleting Group-Rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub ToolStripButton6_Click(sender As Object, e As EventArgs) Handles ToolStripButton6.Click
Dim oForm As New frmProcessCapture()
Dim oResult = oForm.ShowDialog()
If oResult = DialogResult.OK Then
Try
Dim oProcessName As String = oForm.ProcessName
If oProcessName <> "" Then
Dim insert = String.Format("INSERT INTO TBCW_PROFILE_PROCESS (PROFILE_ID,PROC_NAME,ADDED_WHO) VALUES ({0},'{1}','{2}')", GUIDTextBox.Text, oProcessName, Environment.UserName)
If clsDatabase.Execute_non_Query(insert) = False Then
MsgBox("Could not insert the Process-Profile-Link....Check the logfile!", MsgBoxStyle.Exclamation)
End If
End If
Load_Profile_Process()
clsHotkey.Refresh_Profile_Links()
Catch ex As Exception
MsgBox("Unexpected Error while adding Process-Profile-link: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End If
End Sub
Private Sub ToolStripButton5_Click(sender As Object, e As EventArgs) Handles ToolStripButton5.Click
Try
Dim oGuid = GridViewProcessProfile.GetFocusedRowCellValue(GridViewProcessProfile.Columns("GUID"))
Dim oSQL = String.Format("DELETE FROM TBCW_PROFILE_PROCESS WHERE GUID = {0}", oGuid)
If clsDatabase.Execute_non_Query(oSQL) Then
Load_Profile_Process()
End If
Catch ex As Exception
MsgBox("Unexpected Error in deleting ProfileProcess-Relation: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub GridViewProcessProfile_FocusedRowChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs) Handles GridViewProcessProfile.FocusedRowChanged
If e.FocusedRowHandle < 0 Then
Exit Sub
End If
Dim oSelectedRow As DataRow = GridViewProcessProfile.GetDataRow(e.FocusedRowHandle)
Dim oProcessName As String = oSelectedRow.Item("PROC_NAME")
SelectedProcessName = oProcessName
TBCW_PROF_REL_WINDOWTableAdapter.Connection.ConnectionString = MyConnectionString
TBCW_PROF_REL_WINDOWTableAdapter.Fill(MyDataset.TBCW_PROF_REL_WINDOW, SelectedProcessName, GUIDTextBox.Text)
End Sub
Private Sub ToolStripButton7_Click(sender As Object, e As EventArgs) Handles ToolStripButton7.Click
Try
TBCW_PROF_REL_WINDOWBindingSource.EndEdit()
If Not IsNothing(MyDataset.TBCW_PROF_REL_WINDOW.GetChanges) Then
CHANGED_WHOTextBox3.Text = Environment.UserName
TBCW_PROF_REL_WINDOWBindingSource.EndEdit()
TBCW_PROF_REL_WINDOWTableAdapter.Update(MyDataset.TBCW_PROF_REL_WINDOW)
End If
TBCW_PROF_REL_WINDOWTableAdapter.Fill(MyDataset.TBCW_PROF_REL_WINDOW, SelectedProcessName, GUIDTextBox.Text)
Catch ex As Exception
MsgBox("Unexpected Error in Save Profile: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub TBCW_PROF_REL_WINDOWBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBCW_PROF_REL_WINDOWBindingSource.AddingNew
MyDataset.TBCW_PROF_REL_WINDOW.ADDED_WHOColumn.DefaultValue = Environment.UserName
MyDataset.TBCW_PROF_REL_WINDOW.PROFILE_IDColumn.DefaultValue = GUIDTextBox.Text
MyDataset.TBCW_PROF_REL_WINDOW.PROCESS_NAMEColumn.DefaultValue = SelectedProcessName
End Sub
End Class