Liebe AutoIt-Community!
Ich habe mir ein Script erstellt, welches sich über eine Toolbar (ein Ordner, den man an die Spitze des desktops geschoben hat und immer im Vordergrumgrund ist) die von mir handnachprogrammierte Ubuntu-Leiste legt.
Wenn ich das Startmenü, das ich unter Applications geschoben habe öffne, kommt natürlich automatisch der Vista-Aero-Schatten mit. Beim Ausblenden aber bleibt er da. Habe auch schon versucht, die Startmenü-GUI nachher wieder zu @SW_HIDEn, hat aber nix gemacht.
Hier der Code:
Spoiler anzeigen
HotKeySet ("^!{end}", "onautoitexit")
WinSetTrans ("[CLASS:BaseBar]", "", 0);visible:255
Global $off_enabled = 0
Global $date_enabled = 0
Global $time = @hour & ":" & @min & ":" & @sec & "; " & @mday & "." & @mon & "." & @year
$main = GUICreate ("TopBar", @desktopwidth, 36, 0, 0, 0x80000000, 0x00000080, WinGetHandle ("[CLASS:BaseBar]"))
$apps = GUICtrlCreateButton ("Applications", 3, 3, 110, 31)
$places = GUICtrlCreateButton ("Places (not yet set)", 113, 3, 110, 31)
$System = GUICtrlCreateButton ("System (not yet set)", 223, 3, 110, 31)
$net = GUICtrlCreateButton ("Firefox", 336, 3, 31, 31, 0x0040)
GUICtrlSetImage ($net, @ProgramFilesDir & "\Mozilla Firefox\firefox.exe", 1)
$mail = GUICtrlCreateButton ("Empathy", 367, 3, 31, 31, 0x0040)
GUICtrlSetImage ($mail, @ProgramFilesDir & "\Windows Mail\WinMail.exe", 1)
$term = GUICtrlCreateButton ("Terminal", 398, 3, 31, 31, 0x0040)
GUICtrlSetImage ($term, @SystemDir & "\cmd.exe", 1)
$date = GUICtrlCreateButton ($time, @desktopwidth-200, 3, 160, 31)
GUICtrlSetFont ($date, 8.5, 800)
$off = GUICtrlCreateButton ("Shutdown", @DesktopWidth-34, 3, 31, 31, 0x0040)
GUICtrlSetImage ($off, @SystemDir & "\shell32.dll", 28)
GUISetState (@SW_SHOW, $main)
[/autoit] [autoit][/autoit] [autoit]$shtdwn = GUICreate ("Topbar-Shutdown", 150, 84, @DesktopWidth-150, 36, 0x80000000, 0x00000080)
$lockscreen = GUICtrlCreateButton ("Lock Screen", 1, 1, 148, 20)
$stnd = GUICtrlCreateButton ("Standby", 1, 21, 148, 20)
$lgf = GUICtrlCreateButton ("Log off", 1, 42, 148, 20)
$dwn = GUICtrlCreateButton ("Shut Down", 1, 63, 148, 20)
$dategui = GUICreate ("Topbar-Date", 177, 160, @DesktopWidth-200, 36, 0x80000000, 0x00000080)
GUICtrlCreateMonthCal ("Today: ", -2, -2)
GUICtrlCreateLabel ("Calendar4TopBar", 10, 10, 0, 0)
While 1
Switch GUIGetMsg ()
Case $apps
_appsgui ()
Case $places
;startmenu
Case $net
Run (@ProgramFilesDir & "\Mozilla Firefox\firefox.exe")
Case $mail
Run (@ProgramFilesDir & "\Windows Mail\WinMail.exe")
Case $term
Run (@SystemDir & "\cmd.exe")
Case $off
_shutdowngui ()
Case $date
_dategui ()
Case $lockscreen
Run(@ComSpec & " /C " & "%windir%\System32\rundll32.exe user32.dll,LockWorkStation", "", @SW_HIDE)
Case $stnd
ConsoleWrite ("1")
Case $lgf
ConsoleWrite (2)
Case $dwn
ConsoleWrite(3)
EndSwitch
If $time <> @hour & ":" & @min & ":" & @sec & "; " & @mday & "." & @mon & "." & @year Then
$time = @hour & ":" & @min & ":" & @sec & "; " & @mday & "." & @mon & "." & @year
GUICtrlSetData ($date, $time)
EndIf
$timer = TimerInit ()
If $off_enabled = 1 And WinActive ("", "Shut Down") = 0 Then
_shutdowngui ()
EndIf
If $date_enabled = 1 And WinActive ("", "Calendar4TopBar") = 0 Then
_dategui ()
EndIf
WEnd
Func _shutdowngui ()
If $off_enabled = 1 Then
GUISetState (@SW_HIDE, $shtdwn)
$off_enabled = 0
Else
GUISetState (@SW_SHOW, $shtdwn)
$off_enabled = 1
GUISetState (@SW_HIDE, $dategui)
$date_enabled = 0
EndIf
EndFunc
Func _dategui ()
If $date_enabled = 1 Then
GUISetState (@SW_HIDE, $dategui)
$date_enabled = 0
Else
GUISetState (@SW_SHOW, $dategui)
$date_enabled = 1
GUISetState (@SW_HIDE, $shtdwn)
$off_enabled = 0
EndIf
EndFunc
Func _appsgui ()
WinMove (WinGetHandle ("[CLASS:DV2ControlHost]"), "", 0, 36)
WinSetState (WinGetHandle ("[CLASS:DV2ControlHost]"), "", @SW_SHOW)
GUISetState (@SW_HIDE, $shtdwn)
$off_enabled = 0
GUISetState (@SW_HIDE, $dategui)
$date_enabled = 0
EndFunc
Func onautoitexit ()
WinSetTrans ("[CLASS:BaseBar]", "", 255)
WinSetState (WinGetHandle ("[CLASS:DV2ControlHost]"), "", @SW_SHOW)
Exit 0
EndFunc