Jump to content



Photo

Tray Toolbar Another one


  • Please log in to reply
20 replies to this topic

#1 Micha1405

Micha1405

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 26 May 2006 - 06:45 PM

I've made this Toobar which start from Tray. Save your settings in config file to load diffrent settings.

Tested with Windows XP SP2 / Use Beta :)

:( New Version look @ trayToolBar2.au3 :D

Plain Text         
; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.103 ; Author:           Michael ; ; Script Function:  Start your favorite application from tray ; ;Date:              23.05.2006 Start scripting ;ChangeLog          24.05.2006 Reduce Memory usage / Code from Valuater ;                   IF Slide out Config Mode Off ;                   26.05.2006 Tooltip / Func Reset Toolbar ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstants.au3> #include <File.au3> #include <Array.au3> #include <constants.au3> #NoTrayIcon Opt("TrayMenuMode",1) Opt("TrayOnEventMode", 1) TraySetClick(16) Global $Button[11],$x Global $app="TrayToolBar" Global $ConfigFlag=0 Global $LockFlag=0 Global $IniFile=@ScriptDir&"\"& $app &".TCF" $font="Comic Sans MS" $TimerStart = 0 $appWidth=50 $appHeight=405 $Speed=500 _checkIni() $MainHwnd=GUICreate($app,$appWidth,$appHeight,@DesktopWidth-$appWidth,@DesktopHeight-$appHeight-30,($WS_SYSMENU),BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST ) ) GUISetFont (8, -1, 0, $font) GUISetBkColor("0xCCCCCC",$MainHwnd) $Button[1] = GUICtrlCreateButton("Setup", 5, 2, 35, 35,BitOR($BS_ICON,$BS_CENTER) ) $Button[2] = GUICtrlCreateButton("Setup", 5, 40, 35, 35, BitOR($BS_ICON,$BS_CENTER)) $Button[3] = GUICtrlCreateButton("Setup", 5, 78, 35, 35,BitOR($BS_ICON,$BS_CENTER)) $Button[4] = GUICtrlCreateButton("Setup", 5, 116, 35, 35, BitOR($BS_ICON,$BS_CENTER)) $Button[5] = GUICtrlCreateButton("Setup", 5, 154, 35, 35, BitOR($BS_ICON,$BS_CENTER)) $Button[6] = GUICtrlCreateButton("Setup", 5, 192, 35, 35, BitOR($BS_ICON,$BS_CENTER)) $Button[7] = GUICtrlCreateButton("Setup", 5, 230, 35, 35, BitOR($BS_ICON,$BS_CENTER)) $Button[8] = GUICtrlCreateButton("Setup", 5, 268, 35, 35, BitOR($BS_ICON,$BS_CENTER)) $Button[9] = GUICtrlCreateButton("Setup", 5, 306, 35, 35, BitOR($BS_ICON,$BS_CENTER)) $Button[10] = GUICtrlCreateButton("Setup", 5, 344, 35, 35, BitOR($BS_ICON,$BS_CENTER)) _ReDrawButton() ;------------Tray Settings------------ $TrayMnuShow= TrayCreateItem("Show") TrayItemSetOnEvent(-1, "_slide_in") $TrayMnuOption=TrayCreateMenu("Options") $TrayMnuLock=TrayCreateItem("Lock Toolbar",$TrayMnuOption) TrayItemSetOnEvent(-1, "_LockBar") TrayCreateItem("",$TrayMnuOption) $TrayMnuLoad=TrayCreateItem("Load Settings",$TrayMnuOption) TrayItemSetOnEvent(-1, "_LoadSettings") $TrayMnuSaveAs=TrayCreateItem("Save Settings",$TrayMnuOption) TrayItemSetOnEvent(-1, "_SaveSettings") $TrayMnuReset=TrayCreateItem("Reset current Toolbar",$TrayMnuOption) TrayItemSetOnEvent(-1, "_ResetSettings") $TrayMnuSetup=TrayCreateItem("Setup Mode") TrayItemSetOnEvent(-1, "_ConfigOn") TrayCreateItem("") $TrayMnuExit= TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "_Exit") TraySetState() _slide_in();Start _main() Func _main()     while 1         if TimerDiff($TimerStart) > 60000 then             _ReduceMemory()             $TimerStart = TimerInit()         EndIF         $Msg = GUIGetMsg()         $trayMsg =TrayGetMsg()     Select         Case  $Msg=$Button[1]             $x=1             _checkAction()         Case  $Msg=$Button[2]             $x=2             _checkAction()         Case  $Msg=$Button[3]             $x=3             _checkAction()         Case  $Msg=$Button[4]             $x=4             _checkAction()         Case  $Msg=$Button[5]             $x=5             _checkAction()         Case  $Msg=$Button[6]             $x=6             _checkAction()         Case  $Msg=$Button[7]             $x=7             _checkAction()         Case  $Msg=$Button[8]             $x=8             _checkAction()         Case  $Msg=$Button[9]             $x=9             _checkAction()         Case $Msg=$Button[10]             $x=10             _checkAction()         Case $Msg=$GUI_EVENT_CLOSE             _slide_out()         EndSelect     wend     Sleep(100) EndFunc Func _checkAction()     If $ConfigFlag=1 or GUICtrlRead($Button[$x])="Setup" then             _SetupButton()             Else ;Start Program             $var=IniRead($IniFile,$app,"Button"&$x,"")             run($var)             _slide_out()             EndIf       EndFunc Func _SetupButton() $var=FileOpenDialog("Select Program",@ProgramFilesDir&"\","Programs (*.exe)") if not @error Then Iniwrite($IniFile,$app,"Button"&$x,$var) _ConfigOff() _ReDrawButton() Else _ConfigOff()    EndIf   EndFunc Func _slide_in() DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $MainHwnd, "int", $Speed, "long", 0x00040008);slide-in from bottom GUISetState(@SW_SHOW, $MainHwnd) EndFunc Func _slide_out()     if $ConfigFlag=1 then _ConfigOff() if $LockFlag=0 then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $MainHwnd, "int", $Speed, "long", 0x00050004);slide-out to bottom EndFunc Func _ConfigOn() $ConfigFlag=1    GUISetBkColor("0xF00000",$MainHwnd)  GUISetCursor(3,1) _slide_in() EndFunc Func _ConfigOff()     $ConfigFlag=0       GUISetBkColor("0xCCCCCC",$MainHwnd)     GUISetCursor(2,1)     _slide_in() EndFunc Func _checkIni()     If not FileExists($IniFile) Then;create new ini         for $i=1 to 10             IniWrite($IniFile,$app,"Button"&$i,"Setup")         next             IniWrite($IniFile,$app,"LastConfig",$IniFile)         Else         $var=IniRead($IniFile,$app,"LastConfig",$IniFile)         if $var<>$IniFile then $IniFile=$var     EndIf EndFunc Func _ReDrawButton()     for $i=1 to 10     $var=IniRead($IniFile,$app,"Button"&$i,"Setup")     If $var="Setup" Then     GUICtrlSetImage($Button[$i], 'shell32.dll', 162, $BS_ICON);Use setup Icon         GUICtrlSetData($Button[$i],"Setup")         GUICtrlSetTip($Button[$i],"Click to Setup") Else        $file=IniRead($IniFile,$app,"Button"&$i,"")     GUICtrlSetImage($Button[$i],$file,"Button"&$i,1)     GUICtrlSetData($Button[$i],$i)     GUICtrlSetTip($Button[$i],StringTrimLeft($file,StringInStr($file,"\",0,-1)))     EndIf     next EndFunc Func _lockBar()     if $LockFlag=0 Then         _slide_in()         $LockFlag=1         TrayItemSetState($TrayMnuLock,$TRAY_CHECKED)     Else         $LockFlag=0         TrayItemSetState($TrayMnuLock,$TRAY_UNCHECKED)     EndIf           EndFunc Func _SaveSettings() $file=FileSaveDialog($app,@ScriptDir&"\","TrayToolBar Profile (*.tcf)") if not @error then     if StringRight($file,4)<>".tcf" then $file=$file &".tcf"         Dim $aRecords         If Not _FileReadToArray($IniFile,$aRecords) Then         MsgBox(4096,"Error", " Error reading settings    error:" & @error)     Else     _FileWriteFromArray($file,$aRecords,1)     IniWrite($IniFile,$app,"LastConfig",$file)      $IniFile=$file     EndIf EndIf EndFunc Func _LoadSettings() $file=FileOpenDialog($app,@ScriptDir&"\","Config (*.tcf)",1,"TrayToolBar.tcf")     if Not @error Then     $IniFile=$file     _ReDrawButton()     EndIf   EndFunc Func _ResetSettings() $var=MsgBox(4,$app,"Shure reset all settings "&$app&" ?")         if $var=6 Then             for $i=1 to 10             Iniwrite($IniFile,$app,"Button"&$i,"Setup")             Next            EndIf         _ReDrawButton() EndFunc Func _exit() $LockFlag=0 IniWrite(@ScriptDir&"\"& $app&".tcf",$app,"LastConfig",$IniFile)    _slide_out() exit EndFunc Func _ReduceMemory($i_PID = -1);from Valuater see <a href='http://www.autoitscript.com/forum/index.ph...topic=19370&hl=' class='bbc_url' title=''>http://www.autoitscript.com/forum/index.ph...topic=19370&hl=</a>        If $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf If @error Then Return 1 Return $ai_Return[0] EndFunc;==> _ReduceMemory()



EDIT 1 Now no blank Icon if not configured it use setup icon
EDIT 2 Now it works with Win98 Thanks Lapo
EDIT 3 Change _Reduce Memory()
EDIT 4 New Version TrayToolBar2.au3 uploaded :oops:

comming soon new version with parameters and better tooltip :(

Attached Files


Edited by Micha1405, 05 June 2006 - 06:39 PM.








#2 Micha1405

Micha1405

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 27 May 2006 - 11:43 AM

:) No Comments ??? Not working or not good ??

#3 malinduta

malinduta

    Seeker

  • Active Members
  • 16 posts

Posted 27 May 2006 - 12:01 PM

Very nice :)

:( No Comments ??? Not working or not good ??

Working.

#4 marfdaman

marfdaman

    ...and when you wake, the morning showers you with light...

  • Active Members
  • PipPipPipPipPipPip
  • 405 posts

Posted 27 May 2006 - 12:06 PM

Yep works fine! Nice idea!
Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#5 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 27 May 2006 - 03:25 PM

Yes it works well. The blank buttons should have a setup icon i think before they are assigned to a program.
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

#6 Daniel W.

Daniel W.

    I hacked 127.0.0.1 !!!

  • Active Members
  • PipPipPipPipPipPip
  • 434 posts

Posted 27 May 2006 - 03:41 PM

Looks nice, but why you create .tdf file? and not a ini?
--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------

Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.


#7 Micha1405

Micha1405

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 27 May 2006 - 03:42 PM

It is a ini file :) i renamed it because there can be other ini files

@RazerM Good idea use setup icon ! I will check it


I update the first post

Edited by Micha1405, 27 May 2006 - 03:50 PM.


#8 Rick

Rick

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 328 posts

Posted 27 May 2006 - 10:26 PM

I prefer this one to the other toolbars recently put on this forum

also, what would be nice would be a parameters option ie: explorer.exe c:\temp ?

and an optional description tooltip

other than that its brilliant
Who needs puzzles when we have AutoIt!!

#9 Lapo

Lapo

    Prodigy

  • Active Members
  • PipPipPip
  • 178 posts

Posted 28 May 2006 - 04:26 AM

:) No Comments ??? Not working or not good ??


Changing this (Return $ai_Return[0] >> Return $ai_Return ) works fine on a
win98se beta 3, 1, 1, 125

Func _ReduceMemory($i_PID = -1);from Valuater see http://www.autoitscript.com/forum/index.ph...topic=19370&hl=

If $i_PID <> -1 Then
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
Else
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
EndIf
Return $ai_Return
EndFunc;==> _ReduceMemory()

#10 Micha1405

Micha1405

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 28 May 2006 - 07:34 AM

:) Thanks i 've changed it and update the first post

#11 Micha1405

Micha1405

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 28 May 2006 - 07:48 AM

I prefer this one to the other toolbars recently put on this forum

also, what would be nice would be a parameters option ie: explorer.exe c:\temp ?

and an optional description tooltip

other than that its brilliant


:) Nice idea it will be in the next version

#12 Lapo

Lapo

    Prodigy

  • Active Members
  • PipPipPip
  • 178 posts

Posted 29 May 2006 - 03:31 AM

:) Thanks i 've changed it and update the first post


SORRY it was a workaround .. the correct one is :
thanks to Zedna http://www.autoitscript.com/forum/index.ph...=189233&st=60&#

Func _ReduceMemory($i_PID = -1);from Valuater see http://www.autoitscript.com/forum/index.php?showtopic=19370&hl=        If $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf If @error Then Return 1 Return $ai_Return[0] EndFunc;==> _ReduceMemory()


sorry again

Edited by Lapo, 29 May 2006 - 03:38 AM.


#13 Micha1405

Micha1405

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 29 May 2006 - 05:17 AM

look @ first post

#14 Micha1405

Micha1405

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 05 June 2006 - 12:37 PM

Next Version is online :D

Now you can use:
- other icons
- parameters for your application
- your own tooltip text
- Hotkey F10 for config mode

download traytoolbar2.au3 and enjoy it

Attached Files


Edited by Micha1405, 05 June 2006 - 12:40 PM.


#15 i542

i542

    Captain on the Bridge.

  • Active Members
  • PipPipPipPipPipPip
  • 1,821 posts

Posted 04 August 2006 - 06:27 PM

Update file at top, so peoples don't must search whole topic for latest version.
Very good script :whistle:
i542
I can do signature me.

#16 JoeCool

JoeCool

    Prodigy

  • Active Members
  • PipPipPip
  • 163 posts

Posted 04 August 2006 - 08:10 PM

Next Version is online :whistle:

Now you can use:
- other icons
- parameters for your application
- your own tooltip text
- Hotkey F10 for config mode

download traytoolbar2.au3 and enjoy it


Is it possible to open a file throught the default application of window ?
without having to specified the application

Someting like Run ( cmd /c c:\myscript.au3 )
? :-)

#17 NELyon

NELyon

    Do you wanna brew my avatar?

  • Active Members
  • PipPipPipPipPipPip
  • 3,526 posts

Posted 04 August 2006 - 09:35 PM

wow, i like this alot. Puts all my applications at my mousetip

#18 i542

i542

    Captain on the Bridge.

  • Active Members
  • PipPipPipPipPipPip
  • 1,821 posts

Posted 06 August 2006 - 05:51 PM

WOW! It is amazing!!!
i542
I can do signature me.

#19 Somniis

Somniis

    Wayfarer

  • Active Members
  • Pip
  • 72 posts

Posted 06 August 2006 - 06:15 PM

It works great! As another poster stated, I too like it better than the other toolbar scripts on the forum. :)

Edit: I'd like to suggest a drag-and-drop method of adding new programs to it. Also, perhaps more than 10 buttons (user-configurable?) for more programs. :whistle:

Edited by Somniis, 06 August 2006 - 06:28 PM.


#20 Micha1405

Micha1405

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 07 August 2006 - 10:28 AM

Thanks for all your postings ! I'll try to implement your ideas soon.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users