Jump to content

Sliding Toolbar


Simucal
 Share

Recommended Posts

EDIT: Added AutoItKing's Double Layer toolbar example

EDIT: Val added transparency setting to his toolbar.

EDIT: Next toolbar will be an attempt to mimic the OSX/Object dock toolbar. Stay tuned for a beta release!

EDIT: Now will snap to the nearest side of the desktop you drag it to!

EDIT: Added Valuaters Example script to the post.

EDIT: Replaced my button-hover handling code with Valuaters more effecient version.

EDIT: Now, whatever button your mouse hovers over becomes larger and the text above it turns red.

Toolbar2:

This is a sliding toolbar GUI created by myself and Valuater. It uses the WindowsAnimation DLL call along with two GUI windows to get the desired effect. This version of it is meant to be a base GUI for your script.

Base GUI Screenshot:

Posted Image

toolbar2.au3+ 79DL's

Valuater's example toolbar:

This script is pretty sweet. It allows you to configure what applications it runs along with their corresponding icons while the script is running! You can simply drag and drop the exe you want added to the toolbar while in the config menu (all changes you make to the toolbar are saved to an ini). I tried to take some better video/screenshots of it in action but my applications didnt like the transparency settings the config window used.

Example Usage Screenshots:

Posted Image

toolbar2_val.au3+ 130 DL's

AutoItKing's example toolbar:

King took Valuaters toolbar that had the config menu and made it two layered. So, if you have more applications than 7 you should give his version a try!

Double Layer Toolbar Screenshot:

Posted Image

toolbar_king.au3

Give it a try!

-Simucal

EDIT: Forgot to thank Valuater for his help in getting the desired effect!

Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

**updated code 12/24/2008**

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>

Global $hide_state = 0, $btn_state = 0, $pass = 0
Global $Button_[8], $Label_[8], $config_[12]

If Not FileExists(@ScriptDir & "\toolbar.ini") Then Create_ini()
$config_name = IniReadSection(@ScriptDir & "\toolbar.ini", "Config")
If Not IsArray($config_name) Then; this is for older versions retro use
    IniWrite(@ScriptDir & "\toolbar.ini", "Config", 1, "255")
    IniWrite(@ScriptDir & "\toolbar.ini", "Config", 2, "0"); 0 = left / 1 = right
    $config_name = IniReadSection(@ScriptDir & "\toolbar.ini", "Config")
EndIf
$Label_name = IniReadSection(@ScriptDir & "\toolbar.ini", "Label")
$Launch_name = IniReadSection(@ScriptDir & "\toolbar.ini", "Launch")

$hwnd = GUICreate("Sliding Launcher", 603, 85, -588, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_ACCEPTFILES))
$config_[1] = GUICtrlCreateLabel("Label Name", 15, 22, 60, 20)
$config_[2] = GUICtrlCreateInput("", 75, 22, 80, 20)
$config_[3] = GUICtrlCreateLabel("Program to Launch", 175, 22, 100, 20)
$config_[4] = GUICtrlCreateInput("", 270, 20, 255, 20)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$config_[5] = GUICtrlCreateButton("Cancel", 530, 5, 50, 20)
$config_[6] = GUICtrlCreateButton("Browse", 530, 30, 50, 20)
$config_[7] = GUICtrlCreateButton("Accept", 530, 55, 50, 20)
$config_[8] = GUICtrlCreateSlider(270, 50, 255, 20)
GUICtrlSetLimit($config_[8], 255, 200)
GUICtrlSetData($config_[8], $config_name[1][1])
$config_[9] = GUICtrlCreateRadio("Left Justify", 18, 50)
If $config_name[2][1] = 0 Then GUICtrlSetState($config_[9], $GUI_CHECKED)
$config_[10] = GUICtrlCreateRadio("Right Justify", 95, 50)
If $config_name[2][1] = 1 Then GUICtrlSetState($config_[10], $GUI_CHECKED)
$config_[11] = GUICtrlCreateLabel("Transparency", 195, 53, 80, 20)

GUICtrlSetState($config_[10], $GUI_DISABLE); not developed yet

For $x = 1 To 11
    GUICtrlSetState($config_[$x], $GUI_HIDE)
Next
$author = GUICtrlCreateLabel(" By...   Simucal  &&  Valuater", 120, 25, 400, 40)
GUICtrlSetFont(-1, 20, 700)
$Show = GUICtrlCreateButton(">", 585, 8, 17, 70, BitOR($BS_CENTER, $BS_FLAT))
GUISetState(@SW_HIDE, $hwnd)
WinSetTrans($hwnd, "", $config_name[1][1])

$hwnd2 = GUICreate("Sliding Launcher", 603, 85, 3, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
$Button_[1] = GUICtrlCreateButton("", 20, 35, 73, 41, $BS_ICON)
GUICtrlSetImage(-1, $Launch_name[1][1], 1)
$Label_[1] = GUICtrlCreateLabel($Label_name[1][1], 20, 8, 73, 17, $SS_CENTER + $SS_SUNKEN)
$Button_[2] = GUICtrlCreateButton("", 100, 35, 73, 41, $BS_ICON)
GUICtrlSetImage(-1, $Launch_name[2][1], 1)
$Label_[2] = GUICtrlCreateLabel($Label_name[2][1], 100, 8, 73, 17, $SS_CENTER + $SS_SUNKEN)
$Button_[3] = GUICtrlCreateButton("", 180, 35, 73, 41, $BS_ICON)
GUICtrlSetImage(-1, $Launch_name[3][1], 1)
$Label_[3] = GUICtrlCreateLabel($Label_name[3][1], 180, 8, 73, 17, $SS_CENTER + $SS_SUNKEN)
$Button_[4] = GUICtrlCreateButton("", 260, 35, 73, 41, $BS_ICON)
GUICtrlSetImage(-1, $Launch_name[4][1], 1)
$Label_[4] = GUICtrlCreateLabel($Label_name[4][1], 260, 8, 73, 17, $SS_CENTER + $SS_SUNKEN)
$Button_[5] = GUICtrlCreateButton("", 340, 35, 73, 41, $BS_ICON)
GUICtrlSetImage(-1, $Launch_name[5][1], 1)
$Label_[5] = GUICtrlCreateLabel($Label_name[5][1], 340, 8, 73, 17, $SS_CENTER + $SS_SUNKEN)
$Button_[6] = GUICtrlCreateButton("", 420, 35, 73, 41, $BS_ICON)
GUICtrlSetImage(-1, $Launch_name[6][1], 1)
$Label_[6] = GUICtrlCreateLabel($Label_name[6][1], 420, 8, 73, 17, $SS_CENTER + $SS_SUNKEN)
$Button_[7] = GUICtrlCreateButton("", 500, 35, 73, 41, $BS_ICON)
GUICtrlSetImage(-1, $Launch_name[7][1], 1)
$Label_[7] = GUICtrlCreateLabel($Label_name[7][1], 500, 8, 73, 17, $SS_CENTER + $SS_SUNKEN)
$Hide = GUICtrlCreateButton("<", 585, 8, 17, 70, BitOR($BS_CENTER, $BS_FLAT, $BS_MULTILINE))
$Edit = GUICtrlCreateButton("[]", 0, 8, 15, 70, BitOR($BS_CENTER, $BS_FLAT, $BS_MULTILINE))
GUICtrlSetTip(-1, "Config")
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd2, "int", 500, "long", 0x00040001);slide in from left
GUISetState()
Sleep(100)
WinSetTrans($hwnd2, "", $config_name[1][1])

Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
$config_tray = TrayCreateItem("Configure...")
TrayItemSetOnEvent(-1, "Set_config")
TrayCreateItem("")
$exit_tray = TrayCreateItem("Exit  Sliding Launcher")
TrayItemSetOnEvent(-1, "Set_Exit")
TraySetState()

While 1
    $msg1 = GUIGetMsg()
    If $msg1 = $GUI_EVENT_CLOSE Then Exit
    If $msg1 = $Hide Then
        If $pass = 1 Then
            WinSetTitle($hwnd2, "", "Sliding Launcher")
            $pass = 0
        Else
            Slide_out()
        EndIf
    EndIf
    If $msg1 = $Show Then Slide_in()
    If $msg1 = $Edit Then $pass = 1
    $a_pos = WinGetPos($hwnd2)
    $a_pos2 = WinGetPos($hwnd)
    If $a_pos[0] <> 0 And $hide_state = 0 Then
        WinMove($hwnd2, "", 3, $a_pos[1])
        WinMove($hwnd, "", -588, $a_pos[1])
    EndIf
    If $a_pos2[0] <> -588 And $hide_state = 1 Then
        WinMove($hwnd, "", -588, $a_pos2[1])
        WinMove($hwnd2, "", 3, $a_pos2[1])
    EndIf
    If $pass = 1 Then WinSetTitle($hwnd2, "", "Config Mode - Please Press the Button to Configure...  Press  ""<""  to Cancel")
    If $hide_state = 0 Then
        $a_mpos = GUIGetCursorInfo($hwnd2)
        If IsArray($a_mpos) = 1 Then
            For $b = 1 To 7
                If $a_mpos[4] = $Button_[$b] Then
                    If $b = 1 Then $left = 15
                    If $b > 1 Then $left = (($b - 1) * 80) + 15
                    GUICtrlSetPos($Button_[$b], $left, 30, 83, 46)
                    GUICtrlSetColor($Label_[$b], 0xff0000)
                    GUICtrlSetCursor($Button_[$b], 0)
                    While $a_mpos[4] = $Button_[$b]
                        $msg = GUIGetMsg()
                        If $msg = $Button_[$b] Then
                            If $pass = 0 Then
                                Function($B)
                                ExitLoop
                            Else
                                Set_ini($B)
                                ExitLoop
                            EndIf
                        EndIf
                        $a_mpos = GUIGetCursorInfo($hwnd2)
                        If IsArray($a_mpos) <> 1 Then ExitLoop
                    WEnd
                    $left = $left + 5
                    GUICtrlSetPos($Button_[$b], $left, 35, 73, 41)
                    GUICtrlSetColor($Label_[$b], 0x000000)
                EndIf
            Next
        EndIf
    EndIf
WEnd

Func Slide_in()
    $hide_state = 0
    GUISetState(@SW_HIDE, $hwnd)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd2, "int", 500, "long", 0x00040001);slide in from left
    WinActivate($hwnd2)
    WinWaitActive($hwnd2)
EndFunc   ;==>Slide_in

Func Slide_out()
    $hide_state = 1
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd2, "int", 500, "long", 0x00050002);slide out to left
    GUISetState(@SW_SHOW, $hwnd)
    WinActivate($hwnd)
    WinWaitActive($hwnd)
EndFunc   ;==>Slide_out

Func Create_ini()
    IniWrite(@ScriptDir & "\toolbar.ini", "Config", 1, "255")
    IniWrite(@ScriptDir & "\toolbar.ini", "Config", 2, "0"); 0 = left / 1 = right
    IniWrite(@ScriptDir & "\toolbar.ini", "Launch", 1, @ProgramFilesDir & "\Internet Explorer\iexplore.exe")
    IniWrite(@ScriptDir & "\toolbar.ini", "Launch", 2, @SystemDir & "\osk.exe")
    IniWrite(@ScriptDir & "\toolbar.ini", "Launch", 3, @ProgramFilesDir & "\Windows Media Player\wmplayer.exe")
    IniWrite(@ScriptDir & "\toolbar.ini", "Launch", 4, @SystemDir & "\notepad.exe")
    IniWrite(@ScriptDir & "\toolbar.ini", "Launch", 5, @SystemDir & "\calc.exe")
    IniWrite(@ScriptDir & "\toolbar.ini", "Launch", 6, @SystemDir & "\mstsc.exe")
    IniWrite(@ScriptDir & "\toolbar.ini", "Launch", 7, @SystemDir & "\cleanmgr.exe")
    IniWrite(@ScriptDir & "\toolbar.ini", "Label", 1, "IE Explorer")
    IniWrite(@ScriptDir & "\toolbar.ini", "Label", 2, "Keyboard")
    IniWrite(@ScriptDir & "\toolbar.ini", "Label", 3, "Media Player")
    IniWrite(@ScriptDir & "\toolbar.ini", "Label", 4, "Notepad")
    IniWrite(@ScriptDir & "\toolbar.ini", "Label", 5, "Calculator")
    IniWrite(@ScriptDir & "\toolbar.ini", "Label", 6, "Net Service")
    IniWrite(@ScriptDir & "\toolbar.ini", "Label", 7, "Clean Mngr")
EndFunc   ;==>Create_ini

Func Set_ini(ByRef $B)
    Slide_out()
    GUICtrlSetState($author, $GUI_HIDE)
    GUICtrlSetState($Show, $GUI_HIDE)
    For $x = 1 To 11
        GUICtrlSetState($config_[$x], $GUI_SHOW)
    Next
    Sleep(50)
    WinSetTrans($hwnd, "", 0)
    WinMove($hwnd, "", 3, $a_pos[1])
    GUICtrlSetData($config_[2], $Label_name[$b][1])
    GUICtrlSetData($config_[4], $Launch_name[$b][1])
    GUICtrlSetState($config_[4], $GUI_DROPACCEPTED)
    For $x = 1 To $config_name[1][1] Step 3
        WinSetTrans($hwnd, "", $x)
        Sleep(1)
    Next
    While 3
        $a_pos = WinGetPos($hwnd)
        WinMove($hwnd, "", 3, $a_pos[1])
        WinMove($hwnd2, "", 3, $a_pos[1])
        $msg3 = GUIGetMsg()
        If $msg3 = $config_[8] Then
            WinSetTrans($hwnd, "", GUICtrlRead($config_[8]))
            WinSetTrans($hwnd2, "", GUICtrlRead($config_[8]))
        EndIf
        If $msg3 = $GUI_EVENT_CLOSE Then Exit
        If $msg3 = $config_[5] Then ExitLoop
        If $msg3 = $config_[6] Then
            $Find = FileOpenDialog("Please Select a Program to Launch", @ProgramFilesDir, "exe (*.exe)", 1 + 2)
            If Not @error = 1 Then GUICtrlSetData($config_[4], $Find)
        EndIf
        If $msg3 = $config_[7] Then
            $temp_info = GUICtrlRead($config_[4])
            If FileExists($temp_info) Then
                If StringInStr($temp_info, ".lnk") Then
                    $details = FileGetShortcut($temp_info)
                    $temp_info = $details[0]
                EndIf
                If StringInStr($temp_info, ".exe") Then
                    IniWrite(@ScriptDir & "\toolbar.ini", "Config", 1, GUICtrlRead($config_[8]))
                    If BitAND(GUICtrlRead($config_[9]), $GUI_CHECKED) = $GUI_CHECKED Then
                        IniWrite(@ScriptDir & "\toolbar.ini", "Config", 2, "0"); 0 = left / 1 = right
                    Else
                        IniWrite(@ScriptDir & "\toolbar.ini", "Config", 2, "1"); 0 = left / 1 = right
                    EndIf
                    IniWrite(@ScriptDir & "\toolbar.ini", "Launch", $b, $temp_info)
                    IniWrite(@ScriptDir & "\toolbar.ini", "Label", $b, (GUICtrlRead($config_[2])))
                    $config_name = IniReadSection(@ScriptDir & "\toolbar.ini", "Config")
                    $Label_name = IniReadSection(@ScriptDir & "\toolbar.ini", "Label")
                    $Launch_name = IniReadSection(@ScriptDir & "\toolbar.ini", "Launch")
                    For $x = 1 To 7
                        GUICtrlSetData($Label_[$x], $Label_name[$x][1])
                        GUICtrlSetImage($Button_[$x], $Launch_name[$x][1])
                    Next
                    ExitLoop
                Else
                    MsgBox(262208, "Sorry!", "The ""exe"" file could not be verified   ", 4)
                EndIf
            Else
                MsgBox(262208, "Sorry!", "The file location could not be verified   ", 4)
            EndIf
        EndIf
    WEnd
    For $x = 1 To 11
        GUICtrlSetState($config_[$x], $GUI_HIDE)
    Next
    GUICtrlSetState($author, $GUI_SHOW)
    Sleep(300)
    For $x = $config_name[1][1] To 1 Step -3
        WinSetTrans($hwnd, "", $x)
        Sleep(1)
    Next

    WinMove($hwnd, "", -588, $a_pos[1])
    GUICtrlSetState($Show, $GUI_SHOW)
    WinSetTrans($hwnd, "", $config_name[1][1])
    Slide_in()
EndFunc   ;==>Set_ini

Func Function(ByRef $B)
    Slide_out()
    If FileExists($Launch_name[$b][1]) Then
        $LFile = FileGetShortName($Launch_name[$b][1])
        Run($LFile)
    Else
        MsgBox(262208, "Sorry!", "The file location could not be verified   ", 4)
    EndIf
EndFunc   ;==>Function

Func Set_Exit()
    Exit
EndFunc   ;==>Set_Exit

Func Set_Config()
    $a_pos = WinGetPos($hwnd)
    If $a_pos[0] = 3 Then Return
    Slide_in()
    $pass = 1
EndFunc   ;==>Set_Config

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

1

you could "Adverstise" on the blank GUI

2

you could create a config/settings menu

maybe have an input/drag&Drop to set the pics and titles

( i did it in XPediTE ... in my sig)

its really cool to have the user just slide his program onto the input and set the button title and pic to the users prog

just ideas

Looks cool

8)

That is a good idea for point 1. However as far as implementing the drag and drop.. I dont think I'm going to. This was more for the scripter to use as a base for their GUI than for the end user to have a customizeable shortcut bar.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

That is a good idea for point 1. However as far as implementing the drag and drop.. I dont think I'm going to. This was more for the scripter to use as a base for their GUI than for the end user to have a customizeable shortcut bar.

I had writtin a toolbar app where it reads an ini file that someone could modify. Looks very similar (code wise).

http://www.autoitscript.com/forum/index.ph...topic=24017&hl=

Link to comment
Share on other sites

Thanks for the replies!

I use it on a script for my grandparents. It automates the 7 things they do on a computer... as far as logging them into their email accounts and banking information. They just click on the bar that always stays on top and and magically things are done for them :).

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

this is really slick. Well done Simucal

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.
Link to comment
Share on other sites

If anyone else has any suggestions for effects they would like to see added, or functionality.. let me know.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Very nice valuater, once again you show your skill. I really like how that handles the buttons mouse-over and function calling. I'll add it to the script later today.

The only reason I dont want to loop the button and label creation is they arent always going to be "Button 1" through 7. Eventually users are going to want to set specific text for the lables and buttons so I think they should be set without using a loop.

Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Trying out my new demo' software to make animated gif's of my scripts. If anyone wants an animated gif of their script to add to their post let me know!

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Trying out my new demo' software to make animated gif's of my scripts. If anyone wants an animated gif of their script to add to their post let me know!

nice gif!!

maybe you could replace the second pic with a pic from this launcher

******* see my first post **********

8)

NEWHeader1.png

Link to comment
Share on other sites

Wow, nice additions Valuater.. I really like it. I'll work on an animated Gif for your version of it today!

I think the next thing I'm going to add is if you drag the window close to one side or the other it will switch which side to snap to.

EDIT: and in your case, the position of the config button and the slider button will switch if it switches sides as well.

Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...