diff --git a/DD_Clipboard_Searcher.v12.suo b/DD_Clipboard_Searcher.v12.suo index 8e20f92..f2f60f5 100644 Binary files a/DD_Clipboard_Searcher.v12.suo and b/DD_Clipboard_Searcher.v12.suo differ diff --git a/DD_Clipboard_Searcher/Class1.vb b/DD_Clipboard_Searcher/Class1.vb index bd4ced6..d7b261d 100644 --- a/DD_Clipboard_Searcher/Class1.vb +++ b/DD_Clipboard_Searcher/Class1.vb @@ -1,5 +1,6 @@ Imports Microsoft.VisualBasic.ControlChars Imports System.Runtime.InteropServices +Imports DD_LIB_Standards Public Class ClipboardWatcher : Inherits NativeWindow : Implements IDisposable _ @@ -26,7 +27,7 @@ Public Class ClipboardWatcher : Inherits NativeWindow : Implements IDisposable 'Dim CapTxt As String = clsWINDOWSApi.GetCaption() If IsNothing(PROC_Name) Then Exit Sub If PROC_Name.StartsWith("DD_Clipboard_Searcher") Then Exit Sub - Console.WriteLine("PROCESS_NAME: " & PROC_Name) + If LogErrorsOnly = False Then clsLogger.Add(String.Format(" >>{0} - Clipboard ChangedEvent for process '{1}' fired!", Now.ToString, PROC_Name), False) ' If CapTxt.ToUpper.StartsWith("DD") Then Exit Sub RaiseEvent Changed(Me, EventArgs.Empty) End Select diff --git a/DD_Clipboard_Searcher/ClassInit.vb b/DD_Clipboard_Searcher/ClassInit.vb index 85d66be..95a14b0 100644 --- a/DD_Clipboard_Searcher/ClassInit.vb +++ b/DD_Clipboard_Searcher/ClassInit.vb @@ -1,9 +1,24 @@ Imports System.ComponentModel Imports DD_LIB_Standards +Imports System.IO + Public Class ClassInit Public _lizenzManager As clsLicenseManager Public Sub InitLogger() - ClassLogger.Init("") + Try + ' legt den Speicherort fest + Dim f As New IO.DirectoryInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Digital Data\Clipboard Searcher\Log")) + If IO.Directory.Exists(f.ToString) = False Then + IO.Directory.CreateDirectory(f.ToString) + End If + + Dim logfilename As String = f.ToString & "\" & System.DateTime.Now.ToString("yyyy_MM_dd") & ".txt" + LOGGER_FILEPATH = logfilename + clsLogger.LOGFILE_PATH = LOGGER_FILEPATH + Catch ex As Exception + MsgBox("Unexpected Error while initializing Logger: " & ex.Message, MsgBoxStyle.Critical) + End Try + End Sub Public Function InitDatabase() Dim dbResult As Boolean @@ -42,11 +57,11 @@ Public Class ClassInit USER_USERNAME = _User End If Dim sql = String.Format("SELECT * FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('{0}'))", USER_USERNAME) - ClassLogger.Add(">> Login time: " & Now.ToString, False) - ClassLogger.Add(">> Username: " & USER_USERNAME, False) + clsLogger.Add(">> Login Username: " & USER_USERNAME, False) + clsLogger.Add(">> Login time: " & Now.ToString, False) Dim USER_DT As DataTable = clsDatabase.Return_Datatable(sql, True) If USER_DT.Rows.Count = 0 Then - ClassLogger.Add(" - User '" & USER_USERNAME & "' not listed in Useradminsitration!", False) + clsLogger.Add(" - User '" & USER_USERNAME & "' not listed in Useradminsitration!", False) 'MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") 'Me.Close() Dim msg = String.Format("You are not listed in the Useradministration." & vbNewLine & "Please contact the admin.") @@ -56,10 +71,19 @@ Public Class ClassInit USER_GUID = USER_DT.Rows(0).Item("GUID") USER_LANGUAGE = USER_DT.Rows(0).Item("LANGUAGE") DT_CLIENT_USER = clsDatabase.Return_Datatable("SELECT T.*, T1.CLIENT_NAME FROM TBDD_CLIENT_USER T,TBDD_CLIENT T1 WHERE T.CLIENT_ID = T1.GUID AND T.USER_ID = " & USER_GUID, True) - - Dim Access_right As Boolean = USER_DT.Rows(0).Item("MODULE_DDCBSEARCHER") + Dim Access_right As Boolean = False + sql = String.Format("SELECT COUNT(T.GUID) FROM TBDD_USER_MODULES T, TBDD_MODULES T1 WHERE T.MODULE_ID = T1.GUID AND UPPER(T1.NAME) = UPPER('Clipboard-Searcher') AND T.USER_ID = {0}", USER_GUID) + Dim USER2MODULE = clsDatabase.Execute_Scalar(sql) + If Not IsNothing(USER2MODULE) Then + If USER2MODULE = 1 Then + Access_right = True + End If + Else + Access_right = USER_DT.Rows(0).Item("MODULE_DDCBSEARCHER") + End If + If Access_right = False Then - ClassLogger.Add(" - User: " & USER_USERNAME & " nicht für Modul freigegben!", False) + clsLogger.Add(" - User: " & USER_USERNAME & " nicht für Modul freigegben!", False) 'MsgBox("Achtung: Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") Dim msg = String.Format("Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!") @@ -102,7 +126,7 @@ Public Class ClassInit sql = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Clipboard-Searcher') AND CLIENT_ID = {0}", 0) Dim anzahl = clsDatabase.Execute_Scalar(sql) USERS_LOGGED_IN = CInt(anzahl) - If LogErrorsOnly = False Then ClassLogger.Add(" >> User# logged in: " & anzahl.ToString, False) + If LogErrorsOnly = False Then clsLogger.Add(" >> Count Users logged in: " & anzahl.ToString, False) '#### If LICENSE_COUNT < USERS_LOGGED_IN And LICENSE_EXPIRED = False Then @@ -113,12 +137,12 @@ Public Class ClassInit "Number of licenses: " & LICENSE_COUNT.ToString & vbNewLine & "Please contact Your admin!") End If MsgBox(msg, MsgBoxStyle.Exclamation) - ClassLogger.Add(" >> The number of logged Users (" & USERS_LOGGED_IN.ToString & ") exceeds the number of licenses (" & LICENSE_COUNT & ") ", False) + clsLogger.Add(" >> The number of logged Users (" & USERS_LOGGED_IN.ToString & ") exceeds the number of licenses (" & LICENSE_COUNT & ") ", False) If USER_IS_ADMIN = False Then 'Anmeldung wieder herausnehmen sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND MODULE= 'Clipboard-Searcher'" clsDatabase.Execute_non_Query(sql, True) - ClassLogger.Add(" - logged out the user", False) + clsLogger.Add(" - logged out the user", False) Return False End If End If @@ -127,7 +151,7 @@ Public Class ClassInit End If End If Catch ex As Exception - ClassLogger.Add("Unexpected Error in InitUserLogin: " & ex.Message, True) + clsLogger.Add("Unexpected Error in InitUserLogin: " & ex.Message, True) MsgBox("Unexpected Error in InitUserLogin: " & ex.Message, MsgBoxStyle.Critical) Return False End Try diff --git a/DD_Clipboard_Searcher/ClassLayout.vb b/DD_Clipboard_Searcher/ClassLayout.vb index 1768a15..88a845a 100644 --- a/DD_Clipboard_Searcher/ClassLayout.vb +++ b/DD_Clipboard_Searcher/ClassLayout.vb @@ -1,5 +1,6 @@ Imports System.Xml Imports System.IO +Imports DD_LIB_Standards Public Class ClassWindowLocation @@ -35,7 +36,7 @@ Public Class ClassWindowLocation End Select If x = 5000 Then - form.WindowState = FormWindowState.Maximized + form.WindowState = FormWindowState.Maximized Else If x > 0 Then form.Location = New Point(x, y) @@ -46,7 +47,7 @@ Public Class ClassWindowLocation Next Catch notFoundEx As System.IO.FileNotFoundException - ClassLogger.Add("Window Position & Size added for Form " & form.Name) + clsLogger.Add("Window Position & Size added for Form " & form.Name) Catch ex As Exception MsgBox("Error while loading Window Position!" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try @@ -81,7 +82,7 @@ Public Class ClassWindowLocation layout.Save(settings) Catch notFoundEx As System.IO.FileNotFoundException - ClassLogger.Add("Window Position & Size added for Form " & form.Name) + clsLogger.Add("Window Position & Size added for Form " & form.Name) Catch ex As Exception MsgBox("Error while saving Window Position!" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try diff --git a/DD_Clipboard_Searcher/ClassLogger.vb b/DD_Clipboard_Searcher/ClassLogger.vb deleted file mode 100644 index 130f468..0000000 --- a/DD_Clipboard_Searcher/ClassLogger.vb +++ /dev/null @@ -1,201 +0,0 @@ -Imports System.IO -Imports DD_LIB_Standards -Public Class ClassLogger - Public Shared DateiSpeicherort As String = Nothing - Public Shared DateiPrefix As String = "" - Public Shared Datei As IO.File = Nothing - Public Shared logDateiname As String = "" - Private Shared StreamWriter As IO.StreamWriter = Nothing - Private Shared HasInformedAboutError As Boolean = False - ' eine Art Konstruktor - Public Shared Sub Init(ByVal speicherort As String, Optional ByVal prefix As String = "", Optional ByVal appendFile As Boolean = True) - ' initialisiert den Speicherort - ClassLogger.SetSpeicherort(speicherort) - ' wenn ein Prfix gesetzt wurde - If Not prefix = "" Then - ' initialisiert das Prefix - ClassLogger.SetPrefix(prefix) - End If - Dim str As String = ClassLogger.DateiSpeicherort & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & ".txt" - Dim anz As Integer = 1 - Do While File.Exists(str) - Dim info As New FileInfo(str) - Dim length As Long = info.Length - If length > 5000000 Then - str = IO.Path.GetDirectoryName(str) - str = str & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & "(" & anz.ToString & ").txt" - anz = anz + 1 - Else - Exit Do - End If - Loop - ClassLogger.logDateiname = str - If Not appendFile Then - ' der Versuch die Datei zu löschen - My.Computer.FileSystem.WriteAllText(ClassLogger.logDateiname, String.Empty, False) - End If - ' testen ob sich die Datei öffnen und beschreiben lässt - 'ClassNILogger.CheckIsLogWritable() - End Sub - - ' legt den Speicherort fest - Public Shared Sub SetSpeicherort(ByVal speicherort As String) - Dim f As String = Application.UserAppDataPath() & "\Log" - - If speicherort = "" Then - If IO.Directory.Exists(f) = False Then - IO.Directory.CreateDirectory(f) - End If - ClassLogger.DateiSpeicherort = f - Else - ClassLogger.DateiSpeicherort = speicherort - End If - ' clsLogger.LOGFILE_PATH = ClassLogger.DateiSpeicherort - End Sub - - ' legt das Prefix für den Dateinamen fest - Public Shared Sub SetPrefix(ByVal prefix As String) - ClassLogger.DateiPrefix = prefix - End Sub - - Public Shared Sub Add(ByVal information As String, Optional ByVal ACHTUNG As Boolean = True) - If ClassLogger.OpenFile Then - Try - If ACHTUNG Then - ClassLogger.StreamWriter.WriteLine("#ATTENTION# (" & System.DateTime.Now & "): " & information) - Else - ClassLogger.StreamWriter.WriteLine(information) - End If - ClassLogger.CloseFile() - Catch e As Exception - ClassLogger.ShowErrorMessage() - End Try - Else - ClassLogger.ShowErrorMessage() - End If - End Sub - 'Public Shared Sub Add(ByVal ex As Exception) - ' If ClassLogger.OpenFile Then - ' Try - ' ClassLogger.StreamWriter.WriteLine("##### Exception (" & System.DateTime.Now & ")") - ' ClassLogger.StreamWriter.WriteLine("##### Error: " & ex.Message & " Source [" & ex.Source & "]") - ' ClassLogger.CloseFile() - ' Catch e As Exception - ' ClassLogger.ShowErrorMessage() - ' End Try - ' Else - ' ClassLogger.ShowErrorMessage() - ' End If - 'End Sub - ' öffnet eine Datei zum Schreiben - Private Shared Function OpenFile() - Try - ' wenn ein Speicherort festgelegt wurde - If Not ClassLogger.DateiSpeicherort = Nothing Then - ' den Dateienamen definieren - Dim dateiname As String = ClassLogger.logDateiname - ' Datei anlegen wenn noch nicht vorhanden - My.Computer.FileSystem.WriteAllText(dateiname, String.Empty, True) - ' die Datei zum Schreiben öffnen - ClassLogger.StreamWriter = New IO.StreamWriter(dateiname, True, System.Text.Encoding.UTF8) - End If - ' wenn die Datei erfolgreich geöffnet wurde - If ClassLogger.StreamWriter IsNot Nothing Then - Return True - Else - Return False - End If - Catch ex As Exception - Return False - End Try - - End Function - - ' öffnet eine Datei zum Schreiben - Private Shared Function OpenFile(ByVal DateiSpeicherort As String, ByVal DateiPrefix As String) - - Try - - ' wenn ein Speicherort festgelegt wurde - If Not DateiSpeicherort = Nothing And ClassLogger.CheckIsLogWritable() Then - - ' den Dateienamen definieren - Dim dateiname As String = ClassLogger.logDateiname - ' Datei anlegen wenn noch nicht vorhanden - My.Computer.FileSystem.WriteAllText(dateiname, String.Empty, True) - - ' die Datei zum Schreiben öffnen - ClassLogger.StreamWriter = New IO.StreamWriter(dateiname, True, System.Text.Encoding.UTF8) - End If - - ' wenn die Datei erfolgreich geöffnet wurde - If ClassLogger.StreamWriter IsNot Nothing Then - Return True - Else - Return False - End If - - Catch ex As Exception - Return False - End Try - - End Function - - - ' schliesst die geöffnete Datei - Private Shared Sub CloseFile() - - ' wenn eine Datei geöffnet ist - If ClassLogger.StreamWriter IsNot Nothing Then - ' die Datei schliessen - ClassLogger.StreamWriter.Close() - ClassLogger.StreamWriter = Nothing - End If - End Sub - - - Public Shared Function CheckIsLogWritable() - - If ClassLogger.OpenFile Then - Try - ClassLogger.CloseFile() - Catch e As Exception - ClassLogger.ShowErrorMessage() - Return False - End Try - Else - ClassLogger.ShowErrorMessage() - Return False - End If - - Return True - End Function - - - Public Shared Function CheckIsLogWritable(ByVal vDateiSpeicherort As String, ByVal vDateiPrefix As String) - - If ClassLogger.OpenFile(vDateiSpeicherort, vDateiPrefix) Then - Try - ClassLogger.CloseFile() - Catch e As Exception - ClassLogger.ShowErrorMessage() - Return False - End Try - Else - ClassLogger.ShowErrorMessage() - Return False - End If - - Return True - End Function - - - Private Shared Sub ShowErrorMessage() - If Not ClassLogger.HasInformedAboutError Then - MsgBox("Please make sure You can access the logpath and are able to write to the file. This may be due to security privileges or storage place in the drive." & _ - vbNewLine & vbNewLine & "A logfile won't be written from now on." & vbNewLine & vbNewLine & "You won't be informed about further logdetails from now on.", _ - MsgBoxStyle.Information, "Error opening Logfile") - ClassLogger.HasInformedAboutError = True - End If - End Sub -End Class diff --git a/DD_Clipboard_Searcher/DD_Clipboard_Searcher.vbproj b/DD_Clipboard_Searcher/DD_Clipboard_Searcher.vbproj index c6ea69a..23322d9 100644 --- a/DD_Clipboard_Searcher/DD_Clipboard_Searcher.vbproj +++ b/DD_Clipboard_Searcher/DD_Clipboard_Searcher.vbproj @@ -92,7 +92,7 @@ - + @@ -218,6 +218,7 @@ + diff --git a/DD_Clipboard_Searcher/DD_Clipboard_Searcher.vbproj.user b/DD_Clipboard_Searcher/DD_Clipboard_Searcher.vbproj.user index a4a6cdf..fe7dc22 100644 --- a/DD_Clipboard_Searcher/DD_Clipboard_Searcher.vbproj.user +++ b/DD_Clipboard_Searcher/DD_Clipboard_Searcher.vbproj.user @@ -1,6 +1,6 @@  - ProjectFiles + ShowAllFiles \ No newline at end of file diff --git a/DD_Clipboard_Searcher/My Project/AssemblyInfo.vb b/DD_Clipboard_Searcher/My Project/AssemblyInfo.vb index e56642d..37cf0b1 100644 --- a/DD_Clipboard_Searcher/My Project/AssemblyInfo.vb +++ b/DD_Clipboard_Searcher/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/DD_Clipboard_Searcher/My Project/Resources.Designer.vb b/DD_Clipboard_Searcher/My Project/Resources.Designer.vb index dcf2c50..fb704eb 100644 --- a/DD_Clipboard_Searcher/My Project/Resources.Designer.vb +++ b/DD_Clipboard_Searcher/My Project/Resources.Designer.vb @@ -120,6 +120,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + ''' + Friend ReadOnly Property ReduceSize() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("ReduceSize", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. ''' diff --git a/DD_Clipboard_Searcher/My Project/Resources.resx b/DD_Clipboard_Searcher/My Project/Resources.resx index 8afdacd..f29a047 100644 --- a/DD_Clipboard_Searcher/My Project/Resources.resx +++ b/DD_Clipboard_Searcher/My Project/Resources.resx @@ -121,22 +121,25 @@ ..\Resources\GoToDefinition_5575.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\control_start_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\KeyOutput_8167.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\StatusAnnotations_Stop_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Annotation_New.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\KeyDown_8461.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\folder_Open_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\control_start_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Annotation_New.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\KeyOutput_8167.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ReduceSize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/DD_Clipboard_Searcher/Resources/KeyOutput_8167.ico b/DD_Clipboard_Searcher/Resources/KeyOutput_8167.ico new file mode 100644 index 0000000..78cd44b Binary files /dev/null and b/DD_Clipboard_Searcher/Resources/KeyOutput_8167.ico differ diff --git a/DD_Clipboard_Searcher/Resources/ReduceSize.png b/DD_Clipboard_Searcher/Resources/ReduceSize.png new file mode 100644 index 0000000..336a343 Binary files /dev/null and b/DD_Clipboard_Searcher/Resources/ReduceSize.png differ diff --git a/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.exe b/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.exe index 3fec1e3..32e2265 100644 Binary files a/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.exe and b/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.exe differ diff --git a/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.pdb b/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.pdb index dc5eedb..b315bde 100644 Binary files a/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.pdb and b/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.pdb differ diff --git a/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.xml b/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.xml index ac93f6b..4ff7d84 100644 --- a/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.xml +++ b/DD_Clipboard_Searcher/bin/Debug/DD_Clipboard_Searcher.xml @@ -144,6 +144,22 @@ TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Build the ApiWindow object to hold information about the Window object. + + + Diesem Event wird immer die zugewiesene HotKeyID übergeben wenn eine HotKey Kombination gedrückt wurde. + + + + Diese Funktion fügt einen Hotkey hinzu und registriert ihn auch sofort + + Den KeyCode für die Taste + Die Zusatztasten wie z.B. Strg oder Alt, diese können auch mit OR kombiniert werden + Die ID die der Hotkey bekommen soll um diesen zu identifizieren + + + Diese Funktion entfernt einen Hotkey und deregistriert ihn auch sofort + + Gibt die HotkeyID an welche entfernt werden soll Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. @@ -177,6 +193,10 @@ TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + + + Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. diff --git a/DD_Clipboard_Searcher/clsHotkey.vb b/DD_Clipboard_Searcher/clsHotkey.vb new file mode 100644 index 0000000..d7da693 --- /dev/null +++ b/DD_Clipboard_Searcher/clsHotkey.vb @@ -0,0 +1,139 @@ +Imports DD_LIB_Standards + +Public Class clsHotkey + Implements IMessageFilter + + Private Declare Function RegisterHotKey Lib "user32" ( _ + ByVal Hwnd As IntPtr, _ + ByVal ID As Integer, _ + ByVal Modifiers As Integer, _ + ByVal Key As Integer) _ + As Integer + + Private Declare Function UnregisterHotKey Lib "user32" ( _ + ByVal Hwnd As IntPtr, _ + ByVal ID As Integer) _ + As Integer + + Private Declare Function GlobalAddAtom Lib "kernel32" Alias "GlobalAddAtomA" ( _ + ByVal IDString As String) _ + As Short + + Private Declare Function GlobalDeleteAtom Lib "kernel32" ( _ + ByVal Atom As Short) _ + As Short + + Public Class HotKeyObject + Private mHotKey As Keys + Private mModifier As MODKEY + Private mHotKeyID As String + Private mAtomID As Short + + Public Property HotKey() As Keys + Get + Return mHotKey + End Get + Set(ByVal value As Keys) + mHotKey = value + End Set + End Property + + Public Property Modifier() As MODKEY + Get + Return mModifier + End Get + Set(ByVal value As MODKEY) + mModifier = value + End Set + End Property + + Public Property HotKeyID() As String + Get + Return mHotKeyID + End Get + Set(ByVal value As String) + mHotKeyID = value + End Set + End Property + + Public Property AtomID() As Short + Get + Return mAtomID + End Get + Set(ByVal value As Short) + mAtomID = value + End Set + End Property + + Sub New(ByVal NewHotKey As Keys, ByVal NewModifier As MODKEY, ByVal NewHotKeyID As String) + mHotKey = NewHotKey + mModifier = NewModifier + mHotKeyID = NewHotKeyID + End Sub + End Class + Public Shared Sub Refresh_Profile_Links() + Try + Dim sql = String.Format("SELECT T.*, T2.PROC_NAME FROM TBCBS_PROFILES T, TBCBS_USER_PROFILE T1, TBCBS_PROFILE_PROCESS T2 WHERE T.GUID = T1.PROFILE_ID AND T.GUID = T2.PROFILE_ID AND T1.USER_ID = {0}", USER_GUID) + DT_USER_PROFILES = clsDatabase.Return_Datatable(sql) + If DT_USER_PROFILES.Rows.Count = 0 Then + MsgBox("No profiles configured for this user so far!", MsgBoxStyle.Exclamation) + End If + Catch ex As Exception + MsgBox("Unexpected Error in Refresh_Profile_Links: " & ex.Message, MsgBoxStyle.Critical) + End Try + End Sub + Private mForm As Form + Private Const WM_HOTKEY As Integer = &H312 + Private mHotKeyList As New System.Collections.Generic.Dictionary(Of Short, HotKeyObject) + Private mHotKeyIDList As New System.Collections.Generic.Dictionary(Of String, Short) + + ''' + ''' Diesem Event wird immer die zugewiesene HotKeyID übergeben wenn eine HotKey Kombination gedrückt wurde. + ''' + Public Event HotKeyPressed(ByVal HotKeyID As String) + + Public Enum MODKEY As Integer + MOD_ALT = 1 + MOD_CONTROL = 2 + MOD_SHIFT = 4 + MOD_WIN = 8 + End Enum + + Sub New(ByVal OwnerForm As Form) + mForm = OwnerForm + Application.AddMessageFilter(Me) + End Sub + + ''' + ''' Diese Funktion fügt einen Hotkey hinzu und registriert ihn auch sofort + ''' + ''' Den KeyCode für die Taste + ''' Die Zusatztasten wie z.B. Strg oder Alt, diese können auch mit OR kombiniert werden + ''' Die ID die der Hotkey bekommen soll um diesen zu identifizieren + Public Sub AddHotKey(ByVal KeyCode As Keys, ByVal Modifiers As MODKEY, ByVal HotKeyID As String) + If mHotKeyIDList.ContainsKey(HotKeyID) = True Then Exit Sub + Dim ID As Short = GlobalAddAtom(HotKeyID) + mHotKeyIDList.Add(HotKeyID, ID) + mHotKeyList.Add(ID, New HotKeyObject(KeyCode, Modifiers, HotKeyID)) + RegisterHotKey(mForm.Handle, ID, mHotKeyList(ID).Modifier, mHotKeyList(ID).HotKey) + End Sub + + ''' + ''' Diese Funktion entfernt einen Hotkey und deregistriert ihn auch sofort + ''' + ''' Gibt die HotkeyID an welche entfernt werden soll + Public Sub RemoveHotKey(ByVal HotKeyID As String) + If mHotKeyIDList.ContainsKey(HotKeyID) = False Then Exit Sub + Dim ID As Short = mHotKeyIDList(HotKeyID) + mHotKeyIDList.Remove(HotKeyID) + mHotKeyList.Remove(ID) + UnregisterHotKey(mForm.Handle, CInt(ID)) + GlobalDeleteAtom(ID) + End Sub + + Private Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements System.Windows.Forms.IMessageFilter.PreFilterMessage + If m.Msg = WM_HOTKEY Then + RaiseEvent HotKeyPressed(mHotKeyList(CShort(m.WParam)).HotKeyID) + End If + End Function +End Class diff --git a/DD_Clipboard_Searcher/clsSearch.vb b/DD_Clipboard_Searcher/clsSearch.vb index 1ed55b2..1130571 100644 --- a/DD_Clipboard_Searcher/clsSearch.vb +++ b/DD_Clipboard_Searcher/clsSearch.vb @@ -1,6 +1,7 @@ Imports DD_LIB_Standards Imports System.IO Imports System.Text +Imports System.Runtime.InteropServices Public Class clsSearch @@ -9,6 +10,9 @@ Public Class clsSearch 'Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer Private Declare Function GetWindowRect Lib "user32.dll" (ByVal hWnd As IntPtr, ByRef lpRect As RECT) As Int32 Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer + _ + Private Shared Function SetForegroundWindow(ByVal hWnd As IntPtr) As Boolean + End Function Private Structure RECT Dim Left As Integer @@ -23,7 +27,7 @@ Public Class clsSearch Dim extension = Path.GetExtension(BaseSearch) Dim windream_temp_search As String = "" If IO.File.Exists(BaseSearch) = False Then - ClassLogger.Add("Die Windream-Suche existiert nicht oder ist nicht zugreifbar!", True) + clsLogger.Add("Die Windream-Suche existiert nicht oder ist nicht zugreifbar!", True) MsgBox("Die Windream-Suche existiert nicht oder ist nicht zugreifbar!", MsgBoxStyle.Critical) Return Nothing End If @@ -43,15 +47,15 @@ Public Class clsSearch If WD_UNICODE = True Then EncodingFormat = Encoding.GetEncoding(1252) '1252 - If LogErrorsOnly = False Then ClassLogger.Add(" ...Unicode is used (Encoding.GetEncoding(1252))", False) + If LogErrorsOnly = False Then clsLogger.Add(" ...Unicode is used (Encoding.GetEncoding(1252))", False) Else - If LogErrorsOnly = False Then ClassLogger.Add(" ...UTF8 (Encoding.GetEncoding(65001))", False) + If LogErrorsOnly = False Then clsLogger.Add(" ...UTF8 (Encoding.GetEncoding(65001))", False) EncodingFormat = Encoding.GetEncoding(65001) End If - If LogErrorsOnly = False Then ClassLogger.Add(" ...ReadAlltext: " & BaseSearch, False) + If LogErrorsOnly = False Then clsLogger.Add(" ...ReadAlltext: " & BaseSearch, False) fileContents = My.Computer.FileSystem.ReadAllText(BaseSearch, EncodingFormat) ', System.Text.Encoding.Unicode - If LogErrorsOnly = False Then ClassLogger.Add(" ...fileContents geladen", False) + If LogErrorsOnly = False Then clsLogger.Add(" ...fileContents geladen", False) fileContents = fileContents.Replace("Í", "Ö") fileContents = fileContents.Replace("@Clipboard", CURR_MATCH_RESULT) fileContents = fileContents.Replace("@CLIPBOARD", CURR_MATCH_RESULT) @@ -63,7 +67,7 @@ Public Class clsSearch Try 'Die File schreiben My.Computer.FileSystem.WriteAllText(windream_temp_search, fileContents, False, EncodingFormat) - If LogErrorsOnly = False Then ClassLogger.Add(" ...wrote Text to windream_temp_search: " & windream_temp_search, False) + If LogErrorsOnly = False Then clsLogger.Add(" ...wrote Text to windream_temp_search: " & windream_temp_search, False) ' XML-Datei öffnen und laden Dim Stream As New IO.StreamReader(CStr(windream_temp_search), EncodingFormat) Dim Reader As New System.Xml.XmlTextReader(Stream) @@ -74,9 +78,9 @@ Public Class clsSearch xml.Load(Reader) Reader.Close() xml.Save(windream_temp_search) - If LogErrorsOnly = False Then ClassLogger.Add(" ...Xml Generiert: " & windream_temp_search, False) + If LogErrorsOnly = False Then clsLogger.Add(" ...Xml Generiert: " & windream_temp_search, False) Catch ex As Exception - ClassLogger.Add("TempFile could not be created: " & ex.Message, True) + clsLogger.Add("TempFile could not be created: " & ex.Message, True) MsgBox(ex.Message, MsgBoxStyle.Critical, "Unerwarteter Fehler in Write XmlSearch:") End Try @@ -98,14 +102,14 @@ Public Class clsSearch Dim rctMain As RECT GetWindowRect(p.MainWindowHandle, rctMain) If LogErrorsOnly = False Then - ClassLogger.Add(" ...Top-Position: " & rctMain.Top.ToString, False) - ClassLogger.Add(" ...Left-Position: " & rctMain.Left.ToString, False) - ClassLogger.Add(" ...Right-Position: " & rctMain.Right.ToString, False) - ClassLogger.Add(" ...Bottom-Position: " & rctMain.Bottom.ToString, False) + clsLogger.Add(" ...Top-Position: " & rctMain.Top.ToString, False) + clsLogger.Add(" ...Left-Position: " & rctMain.Left.ToString, False) + clsLogger.Add(" ...Right-Position: " & rctMain.Right.ToString, False) + clsLogger.Add(" ...Bottom-Position: " & rctMain.Bottom.ToString, False) End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Ausführen der windream-Suche:") - ClassLogger.Add("Unexpected error while executing search: " & ex.Message, True) + clsLogger.Add("Unexpected error while executing search: " & ex.Message, True) Return "Unexpected error while executing search" End Try Dim psList() As Process @@ -123,23 +127,23 @@ Public Class clsSearch ShowWindow(p.MainWindowHandle, 3) ' SW_MAXIMIZE End If End If - ' SetForeGroundWindow( p.MainWindowHandle) + SetForegroundWindow(p.MainWindowHandle) End If Next p Catch ex As Exception - ClassLogger.Add("Unexpected error while Setting foreground: " & ex.Message, True) + clsLogger.Add("Unexpected error while Setting foreground: " & ex.Message) End Try Return "" Catch ex As Exception - ClassLogger.Add("Unexpected error in Create Search: " & ex.Message, True) + clsLogger.Add("Unexpected error in Create Search: " & ex.Message) MsgBox("Error in Create Search:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) Return "Unexpected error in Create Search" End Try Catch ex As Exception - ClassLogger.Add("Unexpected error in RUN_WD_SEARCH: " & ex.Message, True) + clsLogger.Add("Unexpected error in RUN_WD_SEARCH: " & ex.Message) MsgBox("Error in RUN_WD_SEARCH:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) Return "Unerwarteter Unexpected error in RUN_WD_SEARCH" End Try diff --git a/DD_Clipboard_Searcher/clsWINDOWSApi.vb b/DD_Clipboard_Searcher/clsWINDOWSApi.vb index c1abcb9..6e79e11 100644 --- a/DD_Clipboard_Searcher/clsWINDOWSApi.vb +++ b/DD_Clipboard_Searcher/clsWINDOWSApi.vb @@ -1,4 +1,6 @@ -Public Class clsWINDOWSApi +Imports DD_LIB_Standards + +Public Class clsWINDOWSApi Private Declare Function GetForegroundWindow Lib "user32.dll" Alias "GetForegroundWindow" () As IntPtr Private Declare Auto Function GetWindowText Lib "user32.dll" (ByVal hWnd As System.IntPtr, ByVal lpString As System.Text.StringBuilder, ByVal cch As Integer) As Integer Private Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, ByRef lpdwProcessID As Integer) As Integer @@ -23,7 +25,7 @@ Dim enumerator1 As New clsWindowApi 'Jedes Formularwindow durchlaufen For Each top As clsWindowApi.ApiWindow In enumerator1.GetTopLevelWindows() - If LogErrorsOnly = False Then ClassLogger.Add(" ... top-window Name: " & top.MainWindowTitle, False) + If LogErrorsOnly = False Then clsLogger.Add(" ... top-window Name: " & top.MainWindowTitle, False) If top.MainWindowTitle.Contains(windowname) Or top.MainWindowTitle.ToLower = windowname.ToLower Then Console.WriteLine(top.MainWindowTitle) Return False @@ -31,7 +33,7 @@ Next top Catch ex As Exception MsgBox("Error in IsRelevantWindowt:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) - ClassLogger.Add(">> Error in IsRelevantWindow:" & ex.Message, False) + clsLogger.Add(">> Error in IsRelevantWindow:" & ex.Message, False) Return False End Try End Function @@ -66,5 +68,5 @@ msg &= vbNewLine & TitleLength.ToString ' MsgBox(msg) End Sub - + End Class diff --git a/DD_Clipboard_Searcher/frmAdministration.vb b/DD_Clipboard_Searcher/frmAdministration.vb index 5ed79bb..11e1700 100644 --- a/DD_Clipboard_Searcher/frmAdministration.vb +++ b/DD_Clipboard_Searcher/frmAdministration.vb @@ -165,7 +165,7 @@ Public Class frmAdministration Private Sub TimerTest_Tick(sender As Object, e As EventArgs) Handles TimerTest.Tick clsWINDOWSApi.Get_ForegroundWindow_Info() - If PID <> PROC_PID Then + If PID <> PROC_PID And PROC_Name <> "DD_Clipboard_Searcher" Then PictureBox1.Visible = True PID = PROC_PID txtPID.Text = PROC_PID @@ -197,7 +197,8 @@ Public Class frmAdministration MsgBox("Could not insert the Process-Profile-Link....Check the logfile!", MsgBoxStyle.Exclamation) End If End If - Load_Profile_Process + 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 diff --git a/DD_Clipboard_Searcher/frmConfig_Basic.vb b/DD_Clipboard_Searcher/frmConfig_Basic.vb index 5d1c532..6a561bc 100644 --- a/DD_Clipboard_Searcher/frmConfig_Basic.vb +++ b/DD_Clipboard_Searcher/frmConfig_Basic.vb @@ -1,199 +1,199 @@ -Imports System.Threading -Imports System.Globalization -Imports DD_LIB_Standards -Public Class frmConfig_Basic - Dim formloaded As Boolean = False - Private Sub BtnConnect_Click(sender As Object, e As EventArgs) Handles BtnConnect.Click - Try - Dim con As String - If chkbxUserAut.Checked Then - con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;" - Else - con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";" - End If - - - Dim connection As New SqlClient.SqlConnection(con) 'csb.ConnectionString) - 'während Verbindungsaufbau Sanduhr-Mauszeiger - Cursor = Cursors.WaitCursor - connection.Open() - Cursor = Cursors.Default - 'DialogResult = Windows.Forms.DialogResult.OK - Dim result As MsgBoxResult - Dim msg = "Die Verbindung wurde erfolgreich aufgebaut!" & vbNewLine & "Möchten Sie diese Verbindung nun in der Anwendung speichern?" - If USER_LANGUAGE <> "de-DE" Then - msg = "Connection was successfully opened!" & vbNewLine & "Would You like to save it?" - End If - result = MessageBox.Show(msg, "Database-Connection", MessageBoxButtons.YesNo, MessageBoxIcon.Question) - If result = MsgBoxResult.Yes Then - CONNECTION_CHANGED = True - 'Set the construction string - MyConnectionString = con 'csb.ConnectionString - clsDatabase.Init(MyConnectionString) - My.Settings.Save() - If chkbxUserAut.Checked = False Then - Dim wrapper As New clsEncryption("!35452didalog=") - Dim cipherText As String = wrapper.EncryptData(Me.txtPasswort.Text) - Dim pw As String = cipherText - con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";" - End If - SaveConfigValue("MyConnectionString", con) - Dim csb As New SqlClient.SqlConnectionStringBuilder - csb.ConnectionString = MyConnectionString - Dim constr = connection.ConnectionString - If chkbxUserAut.Checked = False Then - constr = constr.Replace(csb.Password, "XXXXX") - End If - Me.txtActualConnection.Text = constr - End If - Catch ex As Exception - Cursor = Cursors.Default - MsgBox("Error in Connectionbuild: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) - End Try - End Sub - - Private Sub cmbDatenbank_MouseClick(sender As Object, e As MouseEventArgs) Handles cmbDatenbank.MouseClick - Load_Databases() - End Sub - Sub Load_Databases() - Try - Me.Cursor = Cursors.WaitCursor - Dim csb As New SqlClient.SqlConnectionStringBuilder - csb.DataSource = Me.txtServer.Text - csb.IntegratedSecurity = False - csb.UserID = Me.txtUser.Text - csb.Password = Me.txtPasswort.Text - - Dim con As String - If chkbxUserAut.Checked Then - con = "Data Source=" & Me.txtServer.Text & ";Trusted_Connection=True;" - Else - 'con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";" - con = "Server=" & Me.txtServer.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";" - End If - Dim connection As New SqlClient.SqlConnection(con) 'csb.ConnectionString) - connection.Open() - Dim cmd As New SqlClient.SqlCommand("sp_databases", connection) - cmd.CommandType = CommandType.StoredProcedure - ' Ausführen und Ergebnis in einer ListBox anzeigen - Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader - If dr.HasRows Then - cmbDatenbank.Items.Clear() - Do While dr.Read - cmbDatenbank.Items.Add(dr("Database_Name")) - Loop - cmbDatenbank.DroppedDown = True - Else - MsgBox("The standard-databases could not be retrieved. The default database will be set!" & vbNewLine & "Check rights in sql-server for user: " & Me.txtUser.Text, MsgBoxStyle.Exclamation) - End If - connection.Close() - Catch ex As Exception - If ex.Message.ToLower.Contains("he standard-databases") Or ex.Message.ToLower.Contains("ie standard-datenbanken") Then - cmbDatenbank.Text = "DD_ECM" - End If - MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in Load Databases:") - End Try - Cursor = Cursors.Default - End Sub - - Private Sub frmConfig_Basic_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing - - End Sub - - Private Sub frmConfig_Basic_Load(sender As Object, e As EventArgs) Handles MyBase.Load - If Not MyConnectionString = String.Empty Then - CONNECTION_CHANGED = False - Try - Dim csb As New SqlClient.SqlConnectionStringBuilder - csb.ConnectionString = MyConnectionString - - Dim constr = MyConnectionString - If Not MyConnectionString.Contains("Trusted") Then - constr = constr.Replace(csb.Password, "XXXXX") - txtUser.Text = csb.UserID - chkbxUserAut.Checked = False - Else - chkbxUserAut.Checked = True - End If - - Try - txtServer.Text = csb.DataSource - cmbDatenbank.Text = csb.InitialCatalog - Catch ex As Exception - - End Try - - Me.txtActualConnection.Text = constr - chkLogErrorsOnly.Checked = LogErrorsOnly - Catch ex As Exception - MsgBox("Fehler in FormLoad: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) - End Try - - - - End If - End Sub - - Private Sub chkbxloadWDDocs_CheckedChanged(sender As Object, e As EventArgs) - - End Sub - - Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked - ' Specify that the link was visited. - Me.LinkLabel1.LinkVisited = True - ' Navigate to a URL. - System.Diagnostics.Process.Start("http://www.didalog.de/Support") - End Sub - - Private Sub btnApplicationFolder_Click(sender As Object, e As EventArgs) Handles btnApplicationFolder.Click - Process.Start(Application.UserAppDataPath()) - End Sub - - Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click - Process.Start(ClassLogger.DateiSpeicherort) - End Sub - - Private Sub chkLogErrorsOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged - LogErrorsOnly = chkLogErrorsOnly.Checked - SaveConfigValue("LogErrorsOnly", LogErrorsOnly) - End Sub - - - Private Sub frmConfig_Basic_Shown(sender As Object, e As EventArgs) Handles Me.Shown - formloaded = True - End Sub - - Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged - Select Case TabControl1.SelectedIndex - Case 1 - - - - End Select - End Sub - - Private Sub chkbxUserAut_CheckedChanged(sender As Object, e As EventArgs) Handles chkbxUserAut.CheckedChanged - If chkbxUserAut.Checked Then - Me.txtPasswort.Enabled = False - Me.txtUser.Enabled = False - Else - Me.txtPasswort.Enabled = True - Me.txtUser.Enabled = True - End If - End Sub - - Private Sub txtActualConnection_TextChanged(sender As Object, e As EventArgs) Handles txtActualConnection.TextChanged - - End Sub - - Private Sub cmbDatenbank_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbDatenbank.SelectedIndexChanged - - End Sub - - Private Sub txtPasswort_Leave(sender As Object, e As EventArgs) Handles txtPasswort.Leave - - End Sub - Private Sub txtPasswort_TextChanged(sender As Object, e As EventArgs) Handles txtPasswort.TextChanged - - End Sub +Imports System.Threading +Imports System.Globalization +Imports DD_LIB_Standards +Public Class frmConfig_Basic + Dim formloaded As Boolean = False + Private Sub BtnConnect_Click(sender As Object, e As EventArgs) Handles BtnConnect.Click + Try + Dim con As String + If chkbxUserAut.Checked Then + con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;" + Else + con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";" + End If + + + Dim connection As New SqlClient.SqlConnection(con) 'csb.ConnectionString) + 'während Verbindungsaufbau Sanduhr-Mauszeiger + Cursor = Cursors.WaitCursor + connection.Open() + Cursor = Cursors.Default + 'DialogResult = Windows.Forms.DialogResult.OK + Dim result As MsgBoxResult + Dim msg = "Die Verbindung wurde erfolgreich aufgebaut!" & vbNewLine & "Möchten Sie diese Verbindung nun in der Anwendung speichern?" + If USER_LANGUAGE <> "de-DE" Then + msg = "Connection was successfully opened!" & vbNewLine & "Would You like to save it?" + End If + result = MessageBox.Show(msg, "Database-Connection", MessageBoxButtons.YesNo, MessageBoxIcon.Question) + If result = MsgBoxResult.Yes Then + CONNECTION_CHANGED = True + 'Set the construction string + MyConnectionString = con 'csb.ConnectionString + clsDatabase.Init(MyConnectionString) + My.Settings.Save() + If chkbxUserAut.Checked = False Then + Dim wrapper As New clsEncryption("!35452didalog=") + Dim cipherText As String = wrapper.EncryptData(Me.txtPasswort.Text) + Dim pw As String = cipherText + con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";" + End If + SaveConfigValue("MyConnectionString", con) + Dim csb As New SqlClient.SqlConnectionStringBuilder + csb.ConnectionString = MyConnectionString + Dim constr = connection.ConnectionString + If chkbxUserAut.Checked = False Then + constr = constr.Replace(csb.Password, "XXXXX") + End If + Me.txtActualConnection.Text = constr + End If + Catch ex As Exception + Cursor = Cursors.Default + MsgBox("Error in Connectionbuild: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) + End Try + End Sub + + Private Sub cmbDatenbank_MouseClick(sender As Object, e As MouseEventArgs) Handles cmbDatenbank.MouseClick + Load_Databases() + End Sub + Sub Load_Databases() + Try + Me.Cursor = Cursors.WaitCursor + Dim csb As New SqlClient.SqlConnectionStringBuilder + csb.DataSource = Me.txtServer.Text + csb.IntegratedSecurity = False + csb.UserID = Me.txtUser.Text + csb.Password = Me.txtPasswort.Text + + Dim con As String + If chkbxUserAut.Checked Then + con = "Data Source=" & Me.txtServer.Text & ";Trusted_Connection=True;" + Else + 'con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";" + con = "Server=" & Me.txtServer.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";" + End If + Dim connection As New SqlClient.SqlConnection(con) 'csb.ConnectionString) + connection.Open() + Dim cmd As New SqlClient.SqlCommand("sp_databases", connection) + cmd.CommandType = CommandType.StoredProcedure + ' Ausführen und Ergebnis in einer ListBox anzeigen + Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader + If dr.HasRows Then + cmbDatenbank.Items.Clear() + Do While dr.Read + cmbDatenbank.Items.Add(dr("Database_Name")) + Loop + cmbDatenbank.DroppedDown = True + Else + MsgBox("The standard-databases could not be retrieved. The default database will be set!" & vbNewLine & "Check rights in sql-server for user: " & Me.txtUser.Text, MsgBoxStyle.Exclamation) + End If + connection.Close() + Catch ex As Exception + If ex.Message.ToLower.Contains("he standard-databases") Or ex.Message.ToLower.Contains("ie standard-datenbanken") Then + cmbDatenbank.Text = "DD_ECM" + End If + MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in Load Databases:") + End Try + Cursor = Cursors.Default + End Sub + + Private Sub frmConfig_Basic_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing + + End Sub + + Private Sub frmConfig_Basic_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If Not MyConnectionString = String.Empty Then + CONNECTION_CHANGED = False + Try + Dim csb As New SqlClient.SqlConnectionStringBuilder + csb.ConnectionString = MyConnectionString + + Dim constr = MyConnectionString + If Not MyConnectionString.Contains("Trusted") Then + constr = constr.Replace(csb.Password, "XXXXX") + txtUser.Text = csb.UserID + chkbxUserAut.Checked = False + Else + chkbxUserAut.Checked = True + End If + + Try + txtServer.Text = csb.DataSource + cmbDatenbank.Text = csb.InitialCatalog + Catch ex As Exception + + End Try + + Me.txtActualConnection.Text = constr + chkLogErrorsOnly.Checked = LogErrorsOnly + Catch ex As Exception + MsgBox("Fehler in FormLoad: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) + End Try + + + + End If + End Sub + + Private Sub chkbxloadWDDocs_CheckedChanged(sender As Object, e As EventArgs) + + End Sub + + Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked + ' Specify that the link was visited. + Me.LinkLabel1.LinkVisited = True + ' Navigate to a URL. + System.Diagnostics.Process.Start("http://www.didalog.de/Support") + End Sub + + Private Sub btnApplicationFolder_Click(sender As Object, e As EventArgs) Handles btnApplicationFolder.Click + Process.Start(Application.UserAppDataPath()) + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + Process.Start(System.IO.Path.GetDirectoryName(LOGGER_FILEPATH)) + End Sub + + Private Sub chkLogErrorsOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged + LogErrorsOnly = chkLogErrorsOnly.Checked + SaveConfigValue("LogErrorsOnly", LogErrorsOnly) + End Sub + + + Private Sub frmConfig_Basic_Shown(sender As Object, e As EventArgs) Handles Me.Shown + formloaded = True + End Sub + + Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged + Select Case TabControl1.SelectedIndex + Case 1 + + + + End Select + End Sub + + Private Sub chkbxUserAut_CheckedChanged(sender As Object, e As EventArgs) Handles chkbxUserAut.CheckedChanged + If chkbxUserAut.Checked Then + Me.txtPasswort.Enabled = False + Me.txtUser.Enabled = False + Else + Me.txtPasswort.Enabled = True + Me.txtUser.Enabled = True + End If + End Sub + + Private Sub txtActualConnection_TextChanged(sender As Object, e As EventArgs) Handles txtActualConnection.TextChanged + + End Sub + + Private Sub cmbDatenbank_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbDatenbank.SelectedIndexChanged + + End Sub + + Private Sub txtPasswort_Leave(sender As Object, e As EventArgs) Handles txtPasswort.Leave + + End Sub + Private Sub txtPasswort_TextChanged(sender As Object, e As EventArgs) Handles txtPasswort.TextChanged + + End Sub End Class \ No newline at end of file diff --git a/DD_Clipboard_Searcher/frmMain.Designer.vb b/DD_Clipboard_Searcher/frmMain.Designer.vb index 55809e3..3739a34 100644 --- a/DD_Clipboard_Searcher/frmMain.Designer.vb +++ b/DD_Clipboard_Searcher/frmMain.Designer.vb @@ -24,27 +24,31 @@ Partial Class frmMain Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain)) - Me.NotifyIcon1 = New System.Windows.Forms.NotifyIcon(Me.components) + Me.NotifyIconMain = New System.Windows.Forms.NotifyIcon(Me.components) Me.cmstrpNotifyIcon = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.tsmiChangeState = New System.Windows.Forms.ToolStripMenuItem() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.tslblUser = New System.Windows.Forms.ToolStripStatusLabel() + Me.TimerClose = New System.Windows.Forms.Timer(Me.components) + Me.ContextMenuStripForm = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.MinimierenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.btnAdminConfig = New System.Windows.Forms.Button() Me.btnUserConfig = New System.Windows.Forms.Button() - Me.TimerClose = New System.Windows.Forms.Timer(Me.components) + Me.Label1 = New System.Windows.Forms.Label() Me.cmstrpNotifyIcon.SuspendLayout() Me.StatusStrip1.SuspendLayout() + Me.ContextMenuStripForm.SuspendLayout() Me.SuspendLayout() ' - 'NotifyIcon1 + 'NotifyIconMain ' - Me.NotifyIcon1.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info - Me.NotifyIcon1.BalloonTipText = "Text" - Me.NotifyIcon1.BalloonTipTitle = "Title" - Me.NotifyIcon1.ContextMenuStrip = Me.cmstrpNotifyIcon - Me.NotifyIcon1.Icon = CType(resources.GetObject("NotifyIcon1.Icon"), System.Drawing.Icon) - Me.NotifyIcon1.Text = "Digital Data Clipboard Searcher for windream" - Me.NotifyIcon1.Visible = True + Me.NotifyIconMain.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info + Me.NotifyIconMain.BalloonTipText = "Text" + Me.NotifyIconMain.BalloonTipTitle = "Title" + Me.NotifyIconMain.ContextMenuStrip = Me.cmstrpNotifyIcon + Me.NotifyIconMain.Icon = CType(resources.GetObject("NotifyIconMain.Icon"), System.Drawing.Icon) + Me.NotifyIconMain.Text = "Digital Data Clipboard Searcher for windream" + Me.NotifyIconMain.Visible = True ' 'cmstrpNotifyIcon ' @@ -63,9 +67,9 @@ Partial Class frmMain 'StatusStrip1 ' Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tslblUser}) - Me.StatusStrip1.Location = New System.Drawing.Point(0, 99) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 88) Me.StatusStrip1.Name = "StatusStrip1" - Me.StatusStrip1.Size = New System.Drawing.Size(455, 22) + Me.StatusStrip1.Size = New System.Drawing.Size(465, 22) Me.StatusStrip1.TabIndex = 3 Me.StatusStrip1.Text = "StatusStrip1" ' @@ -75,6 +79,23 @@ Partial Class frmMain Me.tslblUser.Name = "tslblUser" Me.tslblUser.Size = New System.Drawing.Size(16, 17) ' + 'TimerClose + ' + Me.TimerClose.Interval = 10000 + ' + 'ContextMenuStripForm + ' + Me.ContextMenuStripForm.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MinimierenToolStripMenuItem}) + Me.ContextMenuStripForm.Name = "ContextMenuStripForm" + Me.ContextMenuStripForm.Size = New System.Drawing.Size(136, 26) + ' + 'MinimierenToolStripMenuItem + ' + Me.MinimierenToolStripMenuItem.Image = Global.DD_Clipboard_Searcher.My.Resources.Resources.ReduceSize + Me.MinimierenToolStripMenuItem.Name = "MinimierenToolStripMenuItem" + Me.MinimierenToolStripMenuItem.Size = New System.Drawing.Size(135, 22) + Me.MinimierenToolStripMenuItem.Text = "Minimieren" + ' 'btnAdminConfig ' Me.btnAdminConfig.Image = CType(resources.GetObject("btnAdminConfig.Image"), System.Drawing.Image) @@ -100,15 +121,24 @@ Partial Class frmMain Me.btnUserConfig.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.btnUserConfig.UseVisualStyleBackColor = True ' - 'TimerClose + 'Label1 ' - Me.TimerClose.Interval = 10000 + Me.Label1.AutoSize = True + Me.Label1.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label1.Location = New System.Drawing.Point(12, 44) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(253, 26) + Me.Label1.TabIndex = 7 + Me.Label1.Text = "Inaktivieren des Watchers über Rechtsklick Systray" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "oder Tastaturkombination Strg" & _ + " + T" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(455, 121) + Me.ClientSize = New System.Drawing.Size(465, 110) + Me.ContextMenuStrip = Me.ContextMenuStripForm + Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.btnAdminConfig) Me.Controls.Add(Me.StatusStrip1) Me.Controls.Add(Me.btnUserConfig) @@ -123,17 +153,21 @@ Partial Class frmMain Me.cmstrpNotifyIcon.ResumeLayout(False) Me.StatusStrip1.ResumeLayout(False) Me.StatusStrip1.PerformLayout() + Me.ContextMenuStripForm.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents btnUserConfig As System.Windows.Forms.Button - Friend WithEvents NotifyIcon1 As System.Windows.Forms.NotifyIcon + Friend WithEvents NotifyIconMain As System.Windows.Forms.NotifyIcon Friend WithEvents cmstrpNotifyIcon As System.Windows.Forms.ContextMenuStrip Friend WithEvents tsmiChangeState As System.Windows.Forms.ToolStripMenuItem Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip Friend WithEvents tslblUser As System.Windows.Forms.ToolStripStatusLabel Friend WithEvents btnAdminConfig As System.Windows.Forms.Button Friend WithEvents TimerClose As System.Windows.Forms.Timer + Friend WithEvents ContextMenuStripForm As System.Windows.Forms.ContextMenuStrip + Friend WithEvents MinimierenToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents Label1 As System.Windows.Forms.Label End Class diff --git a/DD_Clipboard_Searcher/frmMain.resx b/DD_Clipboard_Searcher/frmMain.resx index 319faf9..e94c02b 100644 --- a/DD_Clipboard_Searcher/frmMain.resx +++ b/DD_Clipboard_Searcher/frmMain.resx @@ -117,14 +117,14 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 132, 17 - + AAABAAMAEBAQAAEABAAoAQAANgAAABAQAAABAAgAaAUAAF4BAAAQEAAAAQAgAGgEAADGBgAAKAAAABAA AAAgAAAAAQAEAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICA @@ -177,7 +177,7 @@ - 383, 17 + 278, 17 @@ -190,6 +190,12 @@ 1iOdbmae7IkqFqH2AAAAAElFTkSuQmCC + + 395, 17 + + + 507, 17 + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO @@ -209,9 +215,6 @@ SUVORK5CYII= - - 500, 17 - AAABAAMAEBAQAAEABAAoAQAANgAAABAQAAABAAgAaAUAAF4BAAAQEAAAAQAgAGgEAADGBgAAKAAAABAA diff --git a/DD_Clipboard_Searcher/frmMain.vb b/DD_Clipboard_Searcher/frmMain.vb index 4f3c540..0513c27 100644 --- a/DD_Clipboard_Searcher/frmMain.vb +++ b/DD_Clipboard_Searcher/frmMain.vb @@ -1,6 +1,8 @@ Imports System.Threading Imports DD_LIB_Standards Public Class frmMain + Dim WithEvents Hotkey As New clsHotkey(Me) + Private PID As Integer Private WithEvents _Watcher As ClipboardWatcher = ClipboardWatcher.Singleton Private Sub frmClipboardWatch_Disposed(ByVal sender As Object, _ @@ -11,7 +13,11 @@ Public Class frmMain Private Sub _Watcher_Changed(ByVal sender As Object, _ ByVal e As EventArgs) Handles _Watcher.Changed - If MONITORING_ACTIVE = False Then Exit Sub + If MONITORING_ACTIVE = False Then + NotifyIconMain.ShowBalloonTip(20000, "Clipboard Watcher", "Clipboard-watcher is inactive.", ToolTipIcon.Info) + Exit Sub + End If + Dim Data As IDataObject = Clipboard.GetDataObject ' Dim RelevantWindow = clsWINDOWSApi.IsRelevantWindow("jonathan") @@ -23,28 +29,35 @@ Public Class frmMain 'End With Dim found As Boolean = False CLIPBOARD_TEXT = Clipboard.GetText + If LogErrorsOnly = False Then clsLogger.Add(String.Format(" >>{0} - Clipboard-Watcher fired for process '{1}'", Now.ToString, PROC_Name), False) For Each row As DataRow In DT_USER_PROFILES.Rows + If found = True Then Exit For If PROC_Name.ToUpper = row.Item("PROC_NAME").ToString.ToUpper Then Dim regex_expression = row.Item("REGEX_EXPRESSION") Dim regex As New System.Text.RegularExpressions.Regex(regex_expression) Dim match As System.Text.RegularExpressions.Match = regex.Match(CLIPBOARD_TEXT) If match.Success Then - If match.Groups(0).Value <> CURR_MATCH_RESULT Then - CURR_MATCH_RESULT = match.Groups(0).Value - If Not IsNothing(CURR_MATCH_RESULT) Then - clsSearch.RUN_WD_SEARCH(row.Item("WD_SEARCH")) - found = True - End If - Else - Exit For - End If - Else - If found = False Then + ' If match.Groups(0).Value <> CURR_MATCH_RESULT Then + CURR_MATCH_RESULT = match.Groups(0).Value + If Not IsNothing(CURR_MATCH_RESULT) Then + clsSearch.RUN_WD_SEARCH(row.Item("WD_SEARCH")) + found = True End If + 'Else + ' NotifyIconMain.ShowBalloonTip(20000, "Clipboard Watcher", String.Format("Clipboard Watcher fired but Clipboardcontent is equal: '{0}'", CURR_MATCH_RESULT), ToolTipIcon.Info) + ' If LogErrorsOnly = False Then clsLogger.Add(String.Format(" >> {0} - Equal Clipboard-result '{1}'", Now.ToString, CURR_MATCH_RESULT), False) + ' Exit For + 'End If + Else + If LogErrorsOnly = False Then clsLogger.Add(String.Format(" >> {0} - No regex-match for cliboardtext '{1}'", Now.ToString, match.Groups(0).Value), False) End If End If Next + If found = False Then + If LogErrorsOnly = False Then clsLogger.Add(String.Format(" >> {0} - Process '{1}' not configured!", Now.ToString, PROC_Name), False) + End If + End Sub Public Sub New() @@ -71,7 +84,7 @@ Public Class frmMain End Sub Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing - ClassLogger.Add(">> Logout time: " & Now.ToString, False) + clsLogger.Add(">> Logout time: " & Now.ToString, False) If ERROR_INIT = "INVALID USER" Then Exit Sub End If @@ -85,6 +98,11 @@ Public Class frmMain Catch ex As Exception + End Try + Try + Hotkey.RemoveHotKey(354522017) + Catch ex As Exception + End Try 'TempDateien löschen Try @@ -95,23 +113,31 @@ Public Class frmMain End Try If clsLogger.LOGG_MSG <> String.Empty Then - ClassLogger.Add(clsLogger.LOGG_MSG, False) + clsLogger.Add(clsLogger.LOGG_MSG, False) End If End Sub Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load ClassWindowLocation.LoadFormLocationSize(Me) If clsDatabase.DB_DEFAULT_INITIALIZED = True Then - Me.NotifyIcon1.Visible = True - Dim sql = String.Format("SELECT T.*, T2.PROC_NAME FROM TBCBS_PROFILES T, TBCBS_USER_PROFILE T1, TBCBS_PROFILE_PROCESS T2 WHERE T.GUID = T1.PROFILE_ID AND T.GUID = T2.PROFILE_ID AND T1.USER_ID = {0}", USER_GUID) - DT_USER_PROFILES = clsDatabase.Return_Datatable(sql) - If DT_USER_PROFILES.Rows.Count = 0 Then - MsgBox("Es wurden noch keine Profile für diesen User hinterlegt!", MsgBoxStyle.Exclamation) - End If + Me.NotifyIconMain.Visible = True + clsHotkey.Refresh_Profile_Links() + Hotkey.AddHotKey(Keys.T, clsHotkey.MODKEY.MOD_CONTROL, 354522017) End If tslblUser.Text = USER_USERNAME End Sub - + Private Sub ReceiveHotKey(ByVal HotKeyID As String) Handles Hotkey.HotKeyPressed + Change_Monitoring_State() + End Sub + Sub Change_Monitoring_State() + If MONITORING_ACTIVE = True Then + NotifyIconMain.ShowBalloonTip(30000, "Clipboard Watcher", "Clipboard-Watcher wurde inaktiviert!", ToolTipIcon.Info) + MONITORING_ACTIVE = False + Else + MONITORING_ACTIVE = True + NotifyIconMain.ShowBalloonTip(30000, "Clipboard Watcher", "Clipboard-Watcher wurde wieder aktiviert!", ToolTipIcon.Info) + End If + End Sub Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown If ERROR_INIT <> "INVALID USER" And LICENSE_COUNT > 0 Then If DT_USER_PROFILES.Rows.Count >= 1 Then @@ -130,14 +156,14 @@ Public Class frmMain End If End Sub - Private Sub NotifyIcon1_DoubleClick(sender As Object, e As EventArgs) Handles NotifyIcon1.DoubleClick + Private Sub NotifyIcon1_DoubleClick(sender As Object, e As EventArgs) Handles NotifyIconMain.DoubleClick If Me.Visible = False Then Me.BringToFront() Me.Visible = True TimerClose.Start() Else Me.Hide() - NotifyIcon1.Visible = True + NotifyIconMain.Visible = True End If End Sub @@ -153,11 +179,13 @@ Public Class frmMain tsmiChangeState.Image = My.Resources.control_start_blue tsmiChangeState.Text = "Überwachung Clipboard starten" MONITORING_ACTIVE = False + NotifyIconMain.ShowBalloonTip(30000, "Clipboard Watcher", "Clipboard-Watcher wurde inaktiviert!", ToolTipIcon.Info) Else tsmiChangeState.Image = My.Resources.StatusAnnotations_Stop_16xLG tsmiChangeState.Tag = "stop" tsmiChangeState.Text = "Überwachung Clipboard stoppen" MONITORING_ACTIVE = True + NotifyIconMain.ShowBalloonTip(30000, "Clipboard Watcher", "Clipboard-Watcher wurde wieder aktiviert!", ToolTipIcon.Info) End If End Sub 'Private Sub Timer1_Tick(sender As Object, e As EventArgs) @@ -192,4 +220,8 @@ Public Class frmMain End If End Sub + + Private Sub MinimierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MinimierenToolStripMenuItem.Click + Me.Hide() + End Sub End Class diff --git a/DD_Clipboard_Searcher/modCurrent.vb b/DD_Clipboard_Searcher/modCurrent.vb index 72d2ca8..d2bb754 100644 --- a/DD_Clipboard_Searcher/modCurrent.vb +++ b/DD_Clipboard_Searcher/modCurrent.vb @@ -38,4 +38,5 @@ Public PROC_PID As String Public PROC_Name As String Public PROC_WindowTitle As String + Public LOGGER_FILEPATH As String End Module diff --git a/SetupWix/Product.wxs b/SetupWix/Product.wxs index 18a2944..2bb791e 100644 --- a/SetupWix/Product.wxs +++ b/SetupWix/Product.wxs @@ -61,6 +61,18 @@ + + + + + + + + + + + + @@ -80,6 +92,7 @@ +