Hey Leute,
ich brauche eure Hilfe! Es gelingt mir einfach nicht ein anderes Programm aus der Taskbar zuverlässig zu verbannen, es selbst und Child-Window's auszublenden und trotzdem noch mit Hilfe von z.B. ControlGetHandle drauf zuzugreifen!
Das Programm lässt sich nicht beim Aufruf von Run() + @SW_HIDE hide ausblenden, daher muss es im Nachhinein passieren und das möglichst schnell (wie mit der unten stehenden Funktion)!
Was ich also suche ist ein Möglichkeit....
1. das Programm aus der Taskbar auszublenden (erstmal das Wichtigste)
2. es selbst + Child-Window's auszublenden
3. es muss noch "ansprechbar" sein
Bisher hat mir Folgendes ganz gut gefallen, bis ich feststellen musste das sich selbst die Class des Fensters geändert hat und ich dadurch keine Ahnung hab wie ich noch drauf zugreifen soll!
Spoiler anzeigen
#include <guiconstants.au3>#include <constants.au3>#include <windowsconstants.au3>Dim $origparent[20][2], $index = 0
[/autoit] [autoit][/autoit] [autoit]Func WinTaskbarButton_Hide($WinTitle)
$hGui1 = GUICreate("dummy gui", 100, 10, -1, -1, @SW_HIDE);this is the 'holder' for hidden apps
If $origparent[$index][0] <> 0 Then Return
$title = WinGetTitle($WinTitle)
$origparent[$index][1] = WinGetHandle($title)
$origparent[$index][0] = DllCall("user32.dll", "int", "SetParent", "hwnd", $origparent[$index][1], "hwnd", $hGui1)
$index += 1
If UBound($origparent) < $index + 2 Then ReDim $origparent[$index + 5][2]
EndFunc
Func WinTaskbarButton_Show($WinTitle)
$hGui1 = GUICreate("dummy gui", 100, 10, -1, -1, @SW_HIDE);this is the 'holder' for hidden apps
If $index = 0 Then Return
If $origparent[$index - 1][0] = 0 Then Return
DllCall("user32.dll", "int", "SetParent", "hwnd", $origparent[$index - 1][1], "hwnd", $origparent[$index - 1][0])
WinActivate($origparent[$index - 1][1])
$origparent[$index - 1][0] = 0
$index -= 1
EndFunc
.. das ist eine von mir angepasste Version von diesem Script..
Spoiler anzeigen
#include <guiconstants.au3>#include <constants.au3>#include <windowsconstants.au3>
Opt("TrayIconHide", 1)
$hGui1 = GUICreate('Parent');this is the 'holder' for hidden apps
;GUISetState();hide the parent from task bar as well or remove comment to show it
MsgBox(262144, 'Hide and Seek', 'To Hide the active window press -' & @CRLF & 'To bring back the last hidden window press +' & _
@CRLF & 'To restore all and quit press #')
Dim $origparent[20][2], $index = 0
Global $hiddenwindow
HotKeySet("{-}", "Hide")
HotKeySet("{+}", "Show")
HotKeySet("{#}", "Leave")
While 1
;next line not needed, it's just to stop anyone seeing your app is running
If WinExists("Windows Task Manager") Then WinClose("Windows Task Manager")
Sleep(100)
WEnd
[/autoit] [autoit][/autoit] [autoit]Func Hide()
If $origparent[$index][0] <> 0 Then Return
$title = WinGetTitle("")
If $title = 'Program Manager' Then;caution - this is language dependent I assume
MsgBox(0, "ERROR", "Can't hide Program Manager")
Return
EndIf
$origparent[$index][1] = WinGetHandle($title)
$origparent[$index][0] = DllCall("user32.dll", "int", "SetParent", "hwnd", $origparent[$index][1], "hwnd", $hGui1)
$index += 1
If UBound($origparent) < $index + 2 Then ReDim $origparent[$index + 5][2]
EndFunc ;==>Hide
Func Show()
If $index = 0 Then Return
If $origparent[$index - 1][0] = 0 Then Return
DllCall("user32.dll", "int", "SetParent", "hwnd", $origparent[$index - 1][1], "hwnd", $origparent[$index - 1][0])
WinActivate($origparent[$index - 1][1])
$origparent[$index - 1][0] = 0
$index -= 1
EndFunc ;==>Show
Func Leave()
[/autoit] [autoit][/autoit] [autoit]While $index > 0
Show()
WEnd
Exit
EndFunc ;==>Leave
Func OnAutoItExit()
[/autoit] [autoit][/autoit] [autoit]Leave()
[/autoit] [autoit][/autoit] [autoit]EndFunc ;==>OnAutoItExit
[/autoit]Ich hoffe ihr habt eine gute Idee ![]()
Gruß cr4sh