#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=Unbenannt-2.ico #AutoIt3Wrapper_Res_Comment=WinClip #AutoIt3Wrapper_Res_Description=Copy Clipboard on Tray #AutoIt3Wrapper_Res_Fileversion=1.2.0.2 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: Christian Blank Script Function: WinClip -> a small ClipBoard Manager for Windows #ce ---------------------------------------------------------------------------- #include #Include global $copying = false; global $len_limit = 40; Global $lastclip = ClipGet(); Global $arr[10] Global $trayItems[13]; update_menu() Opt("TrayMenuMode",1) While 1 if($copying == false) Then if($lastclip <> ClipGet()) Then $lastclip = ClipGet(); pusharr(); $arr[0] = $lastclip; update_menu(); EndIf endif $msg = TrayGetMsg() Select case $msg = $trayItems[11] Exit case $msg = $trayItems[10] clear(); case $msg = $trayItems[12] Case $msg = 0 ContinueLoop case $msg = -3 ; irgendein default event -> no op case $msg = -11 ; irgendein default event -> no op case Else get_clip($msg); EndSelect WEnd func update_menu() for $x=0 to 12 TrayItemDelete($trayItems[$x]) $trayItems[$x] = 0; Next for $x=9 to 0 step -1 local $a = $arr[$x]; if(stringlen($a) > 0) Then $a = StringStripWS($a,4) $a = StringStripWS($a,1) $a = StringReplace($a,@CRLF," \n ") $a = StringReplace($a,@CR," \n ") $a = StringReplace($a,@LF," \n ") if(stringlen($a) > $len_limit) Then $a = StringLeft($a,$len_limit -3) & " ..." endif if(stringlen($a) > 0) Then $trayItems[$x] = TrayCreateItem($a); endif endif Next $trayItems[12] = TrayCreateItem("---") ; RESERVED $trayItems[10] = TrayCreateItem("clear") $trayItems[11] = TrayCreateItem("beenden") TraySetState() EndFunc func get_clip($msg) for $x=0 to 9 if($trayItems[$x] == $msg) Then $a = $arr[$x] if(stringlen($a) > 0) Then $copying = True ClipPut($a) $lastclip = $a; $copying = false ;msgbox(0,0,$a); ExitLoop endif EndIf Next EndFunc func clear() for $x=0 to 9 $arr[$x] = ""; Next update_menu(); EndFunc func pusharr() $arr[9] = $arr[8]; $arr[8] = $arr[7]; $arr[7] = $arr[6]; $arr[6] = $arr[5]; $arr[5] = $arr[4]; $arr[4] = $arr[3]; $arr[3] = $arr[2]; $arr[2] = $arr[1]; $arr[1] = $arr[0]; EndFunc