Jump to content

Recommended Posts

Posted

Really Great Work!!!

This type of UDF programming is right up my alley. I have spent allot of time working with visual appearances in Autoit.

You have surpassed some of the things I was attempting to accomplish here..

Thanks for sharing,

Valuater

8)

NEWHeader1.png

  • 4 weeks later...
Posted (edited)

This is an UDF to create Mac style toolbars, like MobyDock, ObjectDock...

screenshots:

IconDock_1.jpg

IconDock_2.jpg

IconDock_3.jpg

examples included.

Download: IconDock.zip

for german users: http://www.autoit.de/index.php?page=Thread&postID=215581#post215581

enjoy

I noticed that it does not get the icon for, lnk files or .doc and xls. Right at the moment that is my only issue that I can't seem to overcome.

How ever, I can make it read the path to the .lnk file and then add my own icon but then I have to filechangedir then shellexecute in order to make the file open.

Any ideas?

Edited by FastJMAN1
  • 3 months later...
Posted

Thanks for the UDF. It looks great. I have used an example posted here to try and put together a utility for my school.

Instead of calling an exe that is already installed on my machine, I'd like to click on an icon in the dock bar, and then have it call a function in my script. It seems like this is possible, but it is not obvious to me right now.

Here is the code I have.

#include <GuiConstantsEx.au3>
#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <IconDock.au3>

HotKeySet("{ESC}", "_Exit")
Global $iIconSizeMin = 48
Global $iIconSizeMax = 64

Global $hIconDock = _IconDock_Create(0,80 - $iIconSizeMax - $iIconSizeMin, @DesktopWidth, $iIconSizeMax + $iIconSizeMin, BitOR($IconDock_Align_Horizontal, $IconDock_Center), $IconDock_Up, $iIconSizeMin, $iIconSizeMax, True)
_IconDock_BeginUpdate($hIconDock)
Global $aIcon[8] = [7]
$aIcon[1] = _IconDock_IconSetIcon($hIconDock, 1, "d:BackupIconsAcroRd32.ico")
$aIcon[2] = @SystemDir & "taskmgr.exe"
$aIcon[3] = @SystemDir & "write.exe"
$aIcon[4] = @SystemDir & "notepad.exe"
$aIcon[5] = @SystemDir & "osk.exe"
$aIcon[6] = @SystemDir & "charmap.exe"
$aIcon[7] = @SystemDir & "mspaint.exe"

For $i = 1 To $aIcon[0]
If $i = 1 Then
  _IconDock_IconAdd($hIconDock, $aIcon[1], _AdobeReader(), $IconDock_RBUTTONDOWN);, $sText = ""[, $iX = 0[, $iY = 0]]]]])
ElseIf $i = 2 Then
_IconDock_IconAddFile($hIconDock, $aIcon[2], 0, "_EventFunction", $IconDock_RBUTTONDOWN)
ElseIf $i = 3 Then
_IconDock_IconAddFile($hIconDock, $aIcon[3], 0, "_EventFunction", $IconDock_RBUTTONDOWN)
ElseIf $i = 4 Then
_IconDock_IconAddFile($hIconDock, $aIcon[4], 0, "_EventFunction", $IconDock_RBUTTONDOWN)
ElseIf $i = 5 Then
_IconDock_IconAddFile($hIconDock, $aIcon[5], 0, "_EventFunction", $IconDock_RBUTTONDOWN)
ElseIf $i = 6 Then
_IconDock_IconAddFile($hIconDock, $aIcon[6], 0, "_EventFunction", $IconDock_RBUTTONDOWN)
ElseIf $i = 7 Then
_IconDock_IconAddFile($hIconDock, $aIcon[7], 0, "_EventFunction", $IconDock_RBUTTONDOWN)
EndIf
Next
_IconDock_EndUpdate($hIconDock)

While 1
Sleep(100)
WEnd
Func _EventFunction($hID, $iIconIndex, $iEventMsg)
Switch $hID
  Case $hIconDock
   Switch $iEventMsg
    Case $IconDock_RBUTTONDOWN
     Local $moved = DockMoveBar($hIconDock)
     If $moved = False Then ; If $moved = true the bar was moved - don't open options.
      DockConfig()
     EndIf
   EndSwitch
EndSwitch
EndFunc   ;==>_EventFunction
Func DockConfig()
        Local $hwdDock, $HRadio, $VRadio, $OKButton, $CancelButton, $msg
        $hwdDock = GUICreate("Dock Config", 280, 150)
        GUICtrlCreateLabel("IconSizeMin:", 10, 13, 80, 20)
        GUICtrlCreateLabel("IconSizeMax:", 10, 43, 80, 20)
        GUICtrlCreateLabel("Orientation:", 10, 83, 80, 20)
        $HRadio = GUICtrlCreateRadio("Horizontal", 100, 80, 100, 20)
        $VRadio = GUICtrlCreateRadio("Vertical", 200, 80, 100, 20)
        $OKButton = GUICtrlCreateButton("OK", 50, 120, 50, 20)
        $CancelButton = GUICtrlCreateButton("Cancel", 160, 120, 50, 20)
        GUISetState()
;MsgBox(0,0,"0k")
        While True
                $msg = GUIGetMsg()
                Switch $msg
                        Case $GUI_EVENT_CLOSE, $CancelButton
                                ExitLoop
                        Case $OKButton
                                MsgBox(0,"pressed", "Pressed OK Button")
                                ExitLoop
                EndSwitch
                Sleep(20)
        WEnd
        GUIDelete($hwdDock)
EndFunc

Func DockMoveBar($hwdGuiBar)
        Local $PosDiff[2], $WinPos, $WinPos2, $MousePos, $dll, $moved
        $dll = DllOpen("user32.dll")
        While 1
                $MousePos = MouseGetPos()
                $WinPos = WinGetPos($hwdGuiBar)
                $PosDiff[0] = $WinPos[0] - $MousePos[0]
                $PosDiff[1] = $WinPos[1] - $MousePos[1]
                While _IsPressed("02", $dll)
                        $MousePos = MouseGetPos()
                        WinMove($hwdGuiBar, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
                WEnd
                Sleep(10)
                ExitLoop
        WEnd
        $WinPos2 = WinGetPos($hwdGuiBar, "")
        If ($WinPos[0] < $WinPos2[0] - 3) Or ($WinPos[1] < $WinPos2[1] - 3) Or ($WinPos[0] > $WinPos2[0] + 3) Or ($WinPos[1] > $WinPos2[1] + 3) Then
                $moved = True ; If the window was moved, don't run program on return.
        Else
                $moved = False
        EndIf
        Sleep(10)
        Return $moved
EndFunc

Func _Exit()
_IconDock_Destroy($hIconDock)
Exit
EndFunc   ;==>_Exit
Func _AdobeReader()
MsgBox(0,"Adobe Reader", "Opening Adobe Reader")
Run("c:Program FilesAdobeReader 10.0ReaderAcroRd32.exe")
EndFunc

When I start the program it instantly tries to run the function, but I only want it to run when I click on the icon, which also doesn't appear.

If you can offer me any help, it would be much appreciated.

Thanks,

Jeff

  • 2 months later...
Posted (edited)

Hoooly snap this is awesome! lolol i literally giggled when i started using it.

hahahahahaha

edit:

would love to see some support for something other than .exe on the bar, such as loading links to webpages, etc, but i'll be working with this over the next few days to try and meet a project we are working on. if anything comes up i'll note it.

Still enjoying the heck out of this lol

Edited by xeroTechnologiesLLC
  • 3 years later...
Posted

I just noticed this revived thread ... and the example sounds very worthwhile.

Great stuff eukalyptus :)

The art of GDI+ programming can be learned by your code :)

Br,

UEZ

Would anyone have current links?

 

Posted (edited)

Thank you for that link.  It's good to see that such a dramatic example of GDI+ hasn't evaporated.

IconDock.thumb.png.7854fbed2194d7d566b68

 

Edited by qwert
Added image for reference
  • 1 year later...
Posted (edited)

Excellent !

But when we compile this Script as 64-bit EXE, it does not work. 

What changes we have to do, so it can be compiled as 64-bit EXE ?

 

Edited by areeb

Areeb Qaisar

  • 6 years later...

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
  • Recently Browsing   0 members

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