diff --git a/Global_Indexer/App.config b/Global_Indexer/App.config index a636abe..abe144e 100644 --- a/Global_Indexer/App.config +++ b/Global_Indexer/App.config @@ -18,6 +18,9 @@ 526 + + True + \ No newline at end of file diff --git a/Global_Indexer/ClassHotkey_Windream.vb b/Global_Indexer/ClassHotkey_Windream.vb index 952ba12..38df4bc 100644 --- a/Global_Indexer/ClassHotkey_Windream.vb +++ b/Global_Indexer/ClassHotkey_Windream.vb @@ -59,7 +59,21 @@ Public Class ClassHotkey_Windream Return Nothing End Try End Function - + 'Fenster position ermitteln/auslesen + 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 Structure RECT + Dim Left As Integer + Dim Top As Integer + Dim Right As Integer + Dim Bottom As Integer + End Structure + Private Shared Sub GetWindowClientSize(ByVal hWnd As Long) + Dim rc As RECT + GetWindowRect(hWnd, rc) + 'Left = rc.Right - rc.Left + 'Height = rc.Bottom - rc.Top + End Sub Public Shared Function RUN_WD_SEARCH(HK_USR_PROFILE_ID As Integer) Try If LogErrorsOnly = False Then ClassLogger.Add(" ...RUN_WD_SEARCH with HK_USR_PROFILE_ID '" & HK_USR_PROFILE_ID & "'", False) @@ -67,7 +81,7 @@ Public Class ClassHotkey_Windream Dim Objecttype As String Dim windowname As String Dim HKPROFILE_ID As Integer - + Dim _sql = "SELECT WD_SEARCH,HKPROFILE_ID FROM TBHOTKEY_USER_PROFILE WHERE GUID = " & HK_USR_PROFILE_ID DTWD = ClassDatabase.Return_Datatable(_sql) @@ -189,21 +203,57 @@ Public Class ClassHotkey_Windream ClassLogger.Add("TempFile could not be created: " & ex.Message, True) MsgBox(ex.Message, MsgBoxStyle.Critical, "Unerwarteter Fehler in Write XmlSearch:") End Try - + CURRENT_WD_TEMPSEARCH = windream_temp_search Try + Dim myhWnd As IntPtr Dim p As New Process() p.StartInfo.FileName = windream_temp_search - p.StartInfo.WindowStyle = ProcessWindowStyle.Normal + If My.Settings.WDSearch_maximized = True Then + p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized + Else + p.StartInfo.WindowStyle = ProcessWindowStyle.Normal + End If p.Start() - 'p.WaitForExit() - 'p.Close() + + myhWnd = p.MainWindowHandle + Threading.Thread.Sleep(1000) + 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) + End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Ausführen der windream-Suche:") ClassLogger.Add("Unexpected error while executing search: " & ex.Message, True) Return "Unexpected error while executing search" End Try - + Dim psList() As Process + Try + psList = Process.GetProcesses() + + For Each p As Process In psList + Console.WriteLine(p.Id.ToString() + " " + p.ProcessName) + If p.ProcessName.Contains("indream.Find") Then + AppActivate(p.Id) + If My.Settings.WDSearch_maximized = False Then + Dim rctMain As RECT + GetWindowRect(p.MainWindowHandle, rctMain) + If rctMain.Left = 0 Or rctMain.Right = 0 Then + ShowWindow(p.MainWindowHandle, 3) ' SW_MAXIMIZE + End If + End If + ' SetForeGroundWindow(p.MainWindowHandle) + End If + + Next p + + Catch ex As Exception + ClassLogger.Add("Unexpected error while Setting foreground: " & ex.Message, True) + End Try Return "" Catch ex As Exception ClassLogger.Add("Unexpected error in Create Search: " & ex.Message, True) @@ -219,4 +269,9 @@ Public Class ClassHotkey_Windream End Function + Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer + Declare Auto Function SetForeGroundWindow Lib "User32.dll" (ByVal Hwnd As IntPtr) As Integer + + + End Class diff --git a/Global_Indexer/Global_Indexer.vbproj b/Global_Indexer/Global_Indexer.vbproj index 1cf0d16..3087e9a 100644 --- a/Global_Indexer/Global_Indexer.vbproj +++ b/Global_Indexer/Global_Indexer.vbproj @@ -46,6 +46,9 @@ On + + globe_handdrawn.ico + @@ -219,6 +222,7 @@ + True @@ -491,6 +495,10 @@ + + + + @@ -33,7 +33,7 @@ - + @@ -56,48 +56,77 @@ - + - - + + + + + + + - + - - - - + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -122,10 +151,12 @@ + - + + diff --git a/SetupWix/SetupWix.wixproj b/SetupWix/SetupWix.wixproj index 858bdd2..66eb697 100644 --- a/SetupWix/SetupWix.wixproj +++ b/SetupWix/SetupWix.wixproj @@ -6,7 +6,7 @@ 3.8 5bf6646d-6f46-45e5-8806-8783f030f311 2.0 - SetupWix + GlobalIndexer Package $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets @@ -23,6 +23,16 @@ + + + $(WixExtDir)\WixUtilExtension.dll + WixUtilExtension + + + $(WixExtDir)\WixUIExtension.dll + WixUIExtension + +