Sign in to follow this  
Followers 0
satanttin

[Kinda solved]Making Tray menu transparent?

24 posts in this topic

#1 ·  Posted (edited)

Hello,

I have this simple tray program i made i am just wondering if i could make the tray menu transparent?

here is the code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <GuiConstantsEx.au3>
Global $FPrograms, $FCredits, $FScripts

FileCopy (@scriptfullpath, @StartupDir)

Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)
Opt("GUIOnEventMode", 1)
Opt("WinTitleMatchMode", 2)

TraySetIcon("", -1)
TraySetClick("64")
TrayCreateItem("Programs")
TrayItemSetOnEvent(-1, "Programs")
TrayCreateItem("Scripts")
TrayItemSetOnEvent(-1, "Scripts")
TrayCreateItem("Private")
TrayItemSetOnEvent(-1, "Private")
TrayCreateItem("Admin")
TrayItemSetOnEvent(-1, "Admin")
TrayCreateItem("Credits")
TrayItemSetOnEvent(-1, "Credits")
TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "Close")
GUISetState()


Func GuiPrograms()
$FPrograms = GUICreate("Programs", 123, 136, 551, 331, $WS_POPUP)
$BUren = GUICtrlCreateButton("Excel Uren", 24, 8, 75, 25)
GUICtrlSetOnEvent($BUren, "Excel_Uren")
$BDatabase = GUICtrlCreateButton("Database", 24, 40, 75, 25)
GUICtrlSetOnEvent($BDatabase, "Database")
$BScriptEditor = GUICtrlCreateButton("Make Script", 24, 72, 75, 25)
GUICtrlSetOnEvent($BScriptEditor, "Make_Script")
$ExitProgram = GUICtrlCreateButton("Exit", 24, 104, 75, 25)
GUICtrlSetOnEvent($ExitProgram, "ClosePrograms")
GUISetState()
EndFunc

Func GuiCredits()
$FCredits = GUICreate("Credits", 221, 98, 588, 311, $WS_POPUP)
$Label1 = GUICtrlCreateLabel("Program designed by ", 8, 8, 186, 17)
$Label2 = GUICtrlCreateLabel("Programs used: Autoit && Koda FormDesigner", 8, 32, 212, 17)
$BCloseCredits = GUICtrlCreateButton("Close", 72, 64, 75, 25)
GUICtrlSetOnEvent($BCloseCredits, "CloseCredits")
GUISetState()
EndFunc

func GuiScripts()
$FScripts = GUICreate("Scripts", 330, 185, 686, 333, $WS_POPUP)
$BGuiAll = GUICtrlCreateButton("Gui Overall", 8, 8, 75, 25)
$BTray = GUICtrlCreateButton("Tray function", 8, 40, 75, 25)
$BSaveLoad = GUICtrlCreateButton("Save Load", 8, 72, 75, 25)
$BCloseScripts = GUICtrlCreateButton("Close", 248, 152, 75, 25)
GUICtrlSetOnEvent($BCloseScripts, "CloseScrips")
GUISetState()
EndFunc

Func CloseScrips()
GUIDelete ($FScripts)
EndFunc

func CloseCredits()
GUIDelete ($FCredits)
EndFunc

Func ClosePrograms()
GUIDelete ($FPrograms)
EndFunc

While 1
Sleep (10)
WEnd

Func Programs()
GuiPrograms()
EndFunc

Func Scripts()
GuiScripts()
EndFunc

Func Private()
Run("explorer.exe " & "F:\coding\testing\Private")
EndFunc

Func Admin()
If @Compiled Then
ShellExecute (@scriptfullpath, "", @WorkingDir, "RunAs")
Else
ShellExecute(@AutoItExe, '/AutoIt3ExecuteScript "' & @ScriptFullPath & '"', @WorkingDir, "runas")
EndIf
Exit
EndFunc

Func Credits()
GuiCredits()
EndFunc

Func Close()
Exit
EndFunc

Func Excel_Uren()

EndFunc

Func Database()

EndFunc

Func Make_Script()
ShellExecute ("SciTE.exe", -1, "C:\Program Files (x86)\AutoIt3\SciTE")
EndFunc

hope someone can tell me if this is possible? and ifso how it's possible to do?

Edited by satanttin

Share this post


Link to post
Share on other sites



This isn't possible with the native functions.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

ahhh too bad:(

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Maybe this can help:

#include <Constants.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <FontConstants.au3>
#NoTrayIcon

Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)

OnAutoItExitRegister( "_CleanUp" )

TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "_PopTrayMenu")
TraySetOnEvent($TRAY_EVENT_SECONDARYDOWN, "_PopTrayMenu")

TraySetState()

Global $__width = 100
Global $__height = 100

Global $isShown = False

Global $shine1 = 5
Global $shine2 = 5
Global $shine3 = 125
Global $menuFontSize = 16

Global Const $DTT_TEXTCOLOR = 0x00000001
Global Const $DTT_GLOWSIZE = 0x00000800
Global Const $DTT_COMPOSITED = 0x00002000
If Not IsDeclared("tagDTTOPTS") Then Global Const $tagDTTOPTS = _
"uint Size;uint Flags;uint clrText;uint clrBorder;uint clrShadow;int TextShadowType;" & $tagPOINT & _
";int BorderSize;int FontPropId;int ColorPropId;int StateId;int ApplyOverlay;int GlowSize;ptr DrawTextCallback;int lParam;"
Global $Struct = DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;")
Global $sStruct = DllStructCreate("dword;int;ptr;int")
Global $Area[4] = [$__width*2, 0, $__height*2, 0]

Global $parent = GUICreate('hidden', $__width, $__height)
Global $Form1 = GUICreate('', $__width, $__height, -1, -1, 0, 0, $parent)
Global $GlassArea = GUICtrlCreateLabel("", 0, 0, $__width, $__height)
GUICtrlSetBkColor(-1, 0x000000)
Global $hTheme = _WinAPI_OpenThemeData($Form1, "globals")
If (@OSVersion <> "WIN_VISTA") OR (@OSVersion <> "WIN_7") Then _Vista_ApplyGlassArea($Form1, $Area, 0x000000)

    Global $controlGui, $HoverImage, $Mask, $FileGUI, $FileMenu, $EditGUI, $EditMenu, $HelpGUI, $HelpMenu, $ExitGUI, $ExitMenu
    Global $FileState = 1
    _CreateFakeGUI($FileGUI, 'FileGUI', 50, $menuFontSize*2-Round($menuFontSize/1.5), 0, -$menuFontSize, $FileMenu)
    Global $EditState = 1
    _CreateFakeGUI($EditGUI, 'EditGUI', 34, $menuFontSize*2-Round($menuFontSize/1.5), 0, $menuFontSize*0.4, $EditMenu)
    Global $HelpState = 1
    _CreateFakeGUI($HelpGUI, 'HelpGUI', 38, $menuFontSize*2-Round($menuFontSize/1.5), 0, $menuFontSize*1.8, $HelpMenu)
    Global $ExitState = 1
    _CreateFakeGUI($ExitGUI, 'ExitGUI', 35, $menuFontSize*2-Round($menuFontSize/1.5), 0, $menuFontSize*3.2, $ExitMenu)

    $FileDummy = GUICtrlCreateDummy()
    $FileContext = GUICtrlCreateContextMenu($FileDummy)
    $FileNew = GUICtrlCreateMenu("New", $FileContext)
    $FileNewProject = GUICtrlCreateMenuItem("Project", $FileNew)
    $FileNewFile = GUICtrlCreateMenuItem("File", $FileNew)
    $FileOpen = GUICtrlCreateMenuItem("Open", $FileContext)
    $FileSave = GUICtrlCreateMenuItem("Save", $FileContext)
    $FileSaveAs = guictrlcreatemenuitem("Save As...", $FileContext)
    GUICtrlCreateMenuItem("", $FileContext)
    $FileExit = guictrlcreatemenuitem("Exit", $FileContext)

_Draw_menus()

Func _CreateFakeGUI(ByRef $WinHWND, $WinTitle, $WinWIdth, $WinHeight, $Win_X, $Win_Y, ByRef $CtrlHWND)
    $WinHWND = GUICreate($WinTitle, $WinWIdth, $WinHeight, $Win_X, $Win_Y,$WS_POPUP, $WS_EX_MDICHILD, $Form1)
    $CtrlHWND = GUICtrlCreateLabel('', 0, 0, $WinWIdth, $WinHeight)
    GUICtrlSetBkColor(-1, 0x000000)
    If (@OSVersion <> "WIN_VISTA") OR (@OSVersion <> "WIN_7") Then _Vista_ApplyGlass($WinHWND, 0x000000)
    GUISetState(@SW_DISABLE, $WinHWND)
    GUISetState(@SW_HIDE, $WinHWND)
EndFunc

Func _Draw_menus()
    _Draw_Menu_ex($FileGUI, 'File ' & ChrW(9658), $menuFontSize, $shine3, 0x000000)
    _Draw_Menu_ex($EditGUI, 'Edit', $menuFontSize, $shine3, 0x000000)
    _Draw_Menu_ex($HelpGUI, 'Help', $menuFontSize, $shine3, 0x000000)
    _Draw_Menu_ex($ExitGUI, 'Exit', $menuFontSize, $shine3, 0x000000)
EndFunc

GUIRegisterMsg(0xF,"MY_PAINT")
GUIRegisterMsg($WM_SYSCOMMAND, "On_WM_SYSCOMMAND")
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

_Initial_Run()

While 1
    If $isShown = True Then
        If NOT WinActive($Form1) Then
            _Slide(0)
        Else
            _MenuBehavior($FileGUI, $FileMenu, $FileState, 'File ' & ChrW(9658))
            _MenuBehavior($EditGUI, $EditMenu, $EditState, 'Edit')
            _MenuBehavior($HelpGUI, $HelpMenu, $HelpState, 'Help')
            _MenuBehavior($ExitGUI, $ExitMenu, $ExitState, 'Exit')
        EndIf
    EndIf
    Sleep(10)
WEnd

Func _Initial_Run() ;clear the 1st flickering bug
    Local $pos = WinGetPos($Form1)
    WinMove($Form1, '', @DesktopWidth*2, @DesktopHeight*2, $pos[2], $pos[3])
    GUISetState(@SW_SHOW, $Form1)
    _ShowSubItems(True)
    _ShowSubItems(False)
    GUISetState(@SW_HIDE, $Form1)
    $isShown = False
EndFunc

Func On_WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam)
    If BitAND($wParam, 0xFFF0) = 0xF010 Then Return False
    Return $GUI_RUNDEFMSG
EndFunc

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    Local $nID = BitAND($iwParam, 0x0000FFFF)
    #forceref $hWnd, $iMsg, $iwParam, $ilParam
    Switch $nID
        Case $FileExit
            _Slide(0)
            If MsgBox(3, 'Quit?', 'Are you sure you want to quit?') = 6 then Exit
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc

Func _MenuBehavior($WinHWND, $i_MenuItem, ByRef $i_MenuState, $i_Label, $i_ContextMenu = 0)
    Local $a = GUIGetCursorInfo($WinHWND)
    Switch $a[4]
        Case $i_MenuItem
            If $a[2] = 1 Then
                If $i_MenuState <> 3 Then
                    $i_MenuState = 3
                    if ($FileState <> 1) AND ($FileMenu <> $i_MenuItem) then
                        $FileState = 1
                        _Draw_Menu_ex($FileGUI, 'File ' & ChrW(9658), $menuFontSize, $shine3, 0x000000)
                    EndIf
                    if ($EditState <> 1) AND ($EditMenu <> $i_MenuItem) then
                        $EditState = 1
                        _Draw_Menu_ex($EditGUI, 'Edit', $menuFontSize, $shine3, 0x000000)
                    EndIf
                    if ($HelpState <> 1) AND ($HelpMenu <> $i_MenuItem) Then
                        $HelpState = 1
                        _Draw_Menu_ex($HelpGUI, 'Help', $menuFontSize, $shine3, 0x000000)
                    EndIf
                    _Draw_Menu_ex($WinHWND, $i_Label, $menuFontSize, $shine1, 0x000099)
                    Switch $i_MenuItem ;functions on item menu clicks:
                        Case $FileMenu
                            ShowMenu($WinHWND, $i_MenuItem, $FileContext)
                        Case $EditMenu
                            MsgBox(0, 'info', 'clicked: EDIT')
                            _Slide(0)
                        Case $HelpMenu
                            Local $regRead = 'HKEY_LOCAL_MACHINE\Software\AutoIt v3\AutoIt'
                            Local $InstallDir = RegRead($regRead, 'InstallDir')
                            If $InstallDir <> '' then
                                Run($InstallDir & '\AutoIt3Help.exe')
                            Else
                                MsgBox(0, 'Error', 'Sorry, Couldn''t find help files')
                            EndIf
                            _Slide(0)
                        Case $ExitMenu
                            If MsgBox(3, 'Quit?', 'Are you sure you want to quit?') = 6 then Exit
                            _Slide(0)
                    EndSwitch
                EndIf
            Else
                If $i_MenuState <> 2 Then
                    $i_MenuState = 2
                    _Draw_Menu_ex($WinHWND, $i_Label, $menuFontSize, $shine2, 0x000000)
                EndIf
            EndIf
        Case Else
            If $i_MenuState <> 1 Then
                $i_MenuState = 1
                _Draw_Menu_ex($WinHWND, $i_Label, $menuFontSize, $shine3, 0x000000)
            EndIf
    EndSwitch
EndFunc

Func MY_PAINT($hWnd, $Msg, $wParam, $lParam)
    If $isShown = True then _Draw_menus()
    Return $GUI_RUNDEFMSG
EndFunc

Func _Slide($type = 1)
    If $type = 1 then
        WinSetOnTop($Form1, '', True)
        Local $mouse = MouseGetPos()
        Local $pos = WinGetPos($Form1)
        Local $posX = $mouse[0]+6
        Local $posY = $mouse[1]-10
        If @DesktopWidth - $posX <= $__width then $posX = $mouse[0]-16-$pos[2]
        WinMove($Form1, '', $posX, $posY, $pos[2], 0)
        GUISetState(@SW_SHOW, $Form1)
        For $i = 32 to $pos[3] Step 7
            WinMove($Form1, '', $posX, $posY-$i, $pos[2], $i)
            Sleep(1)
        Next
        WinMove($Form1, '', $posX, $posY-$pos[3], $pos[2], $pos[3])
        _ShowSubItems(True)
        $isShown = True
    Else
        _ShowSubItems(False)
        GUISetState(@SW_HIDE, $Form1)
        $isShown = False
    EndIf
EndFunc

Func _ShowSubItems($value)
    If $value = True Then
        GUISetState(@SW_SHOWNOACTIVATE, $FileGUI)
        GUISetState(@SW_SHOWNOACTIVATE, $EditGUI)
        GUISetState(@SW_SHOWNOACTIVATE, $HelpGUI)
        GUISetState(@SW_SHOWNOACTIVATE, $ExitGUI)
        _Draw_menus()
    Else
        GUISetState(@SW_HIDE, $FileGUI)
        GUISetState(@SW_HIDE, $EditGUI)
        GUISetState(@SW_HIDE, $HelpGUI)
        GUISetState(@SW_HIDE, $ExitGUI)
    EndIf
EndFunc

Func _PopTrayMenu()
    _Slide(1)
EndFunc

Func _CleanUp()
    _WinAPI_CloseThemeData($hTheme)
EndFunc

Func _WinAPI_CloseThemeData($hTheme)
    Local $aResult = DllCall("uxtheme.dll", "int", "CloseThemeData", "hwnd", $hTheme)

    If @error Then Return SetError(@error, @extended, 0)
    Return SetError(0, 0, $aResult[0] = 0)
EndFunc

Func _WinAPI_OpenThemeData($hWnd, $sClassList)
    Local $aResult = DllCall("uxtheme.dll", "hwnd", "OpenThemeData", "hwnd", $hWnd, "wstr", $sClassList)

    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] = 0 Then Return SetError(1, 0, 0)
    Return SetError(0, 0, $aResult[0])
EndFunc

Func _Vista_ApplyGlass($hWnd, $bColor = 0x000000)
        GUISetBkColor($bColor)
        $Ret = DllCall("dwmapi.dll", "long", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "long*", DllStructGetPtr($Struct))
        If @error Then
            Return 0
            SetError(1)
        Else
            Return $Ret
        EndIf
EndFunc

Func _Vista_ApplyGlassArea($hWnd, $Area, $bColor = 0x000000)
        If IsArray($Area) Then
            DllStructSetData($Struct, "cxLeftWidth", $Area[0])
            DllStructSetData($Struct, "cxRightWidth", $Area[1])
            DllStructSetData($Struct, "cyTopHeight", $Area[2])
            DllStructSetData($Struct, "cyBottomHeight", $Area[3])
            GUISetBkColor($bColor)
            $Ret = DllCall("dwmapi.dll", "long*", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "ptr", DllStructGetPtr($Struct))
            If @error Then
                Return 0
            Else
                Return $Ret
            EndIf
        Else
            MsgBox(16, "_Vista_ApplyGlassArea", "Area specified is not an array!")
        EndIf
    EndFunc

Func _Draw_Menu_ex($WinHandle, $iCaption, $iSize, $iShine, $iColor)
    Local $hDC = _WinAPI_GetDC($WinHandle)
    Local $tClientRect = _WinAPI_GetClientRect($WinHandle)
    Local $sText = $iCaption
    Local $hFont = _WinAPI_CreateFont($iSize, $iSize/2-1, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, _
        $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'SegoeUI')
    _DrawGlowingText($hDC, $sText, $tClientRect, $iShine, $hFont, $iColor)
    _WinAPI_DeleteObject($hFont)
    _WinAPI_ReleaseDC($WinHandle, $hDC)
EndFunc

Func _DrawGlowingText($hDC, $sText, $tRc, $iGlowSize = 10, $hFont = 0, $iTextClr = -1)
    Local $hCDC
    Local $hBrush, $hOldBrush
    Local $tRcText
    Local $tBI, $tDTO
    Local $hDIBBmp, $hOldBmp
    Local $hOldFont
    Local $tST
    Local $iFlags = BitOR($DTT_GLOWSIZE, $DTT_COMPOSITED)

    $hCDC = _WinAPI_CreateCompatibleDC($hDC)

    $tBI = DllStructCreate($tagBITMAPINFO)
    DllStructSetData($tBI, "Size", DllStructGetSize($tBI)-4)
    DllStructSetData($tBI, "Width", DllStructGetData($tRc, "Right")-DllStructGetData($tRc, "Left"))
    DllStructSetData($tBI, "Height", -(DllStructGetData($tRc, "Bottom")-DllStructGetData($tRc, "Top")))
    DllStructSetData($tBI, "Planes", 1)
    DllStructSetData($tBI, "BitCount", 32)
    DllStructSetData($tBI, "Compression", 0)

    $hDIBBmp = _WinAPI_CreateDIBSection($hDC, $tBI)
    $hOldBmp = _WinAPI_SelectObject($hCDC, $hDIBBmp)
    If $hFont Then $hOldFont = _WinAPI_SelectObject($hCDC, $hFont)

     $tDTO = DllStructCreate($tagDTTOPTS)
    DllStructSetData($tDTO, "Size", DllStructGetSize($tDTO))

    If $iTextClr <> -1 Then
        $iFlags = BitOR($iFlags, $DTT_TEXTCOLOR)
        DllStructSetData($tDTO, "clrText", $iTextClr)
    EndIf


    DllStructSetData($tDTO, "Flags", $iFlags)
    DllStructSetData($tDTO, "GlowSize", $iGlowSize)

    _WinAPI_DrawThemeTextEx($hTheme, $hCDC, 0, 0, $sText, _
        BitOR($DT_SINGLELINE, $DT_CENTER, $DT_VCENTER, $DT_NOPREFIX), $tRc, $tDTO)

    _WinAPI_BitBlt($hDC, DllStructGetData($tRc, "Left"), DllStructGetData($tRc, "Top"), _
        DllStructGetData($tRc, "Right")-DllStructGetData($tRc, "Left"), _
        DllStructGetData($tRc, "Bottom")-DllStructGetData($tRc, "Top"), $hCDC, 0, 0, 0xCC0020)

    _WinAPI_SelectObject($hCDC, $hOldBmp)
    If $hFont Then _WinAPI_SelectObject($hCDC, $hOldFont)
    _WinAPI_DeleteObject($hDIBBmp)
    _WinAPI_DeleteDC($hCDC)
EndFunc

Func _WinAPI_CreateDIBSection($hDC, Const ByRef $tBmpInfo, $iUsage = 0, $pBits = 0, $hSecond = 0, $iOffset = 0)
    Local $aResult = DllCall("gdi32.dll", "hwnd", "CreateDIBSection", "hwnd", $hDC, "ptr", DllStructGetPtr($tBmpInfo), _
                        "uint", $iUsage, "ptr", $pBits, "hwnd", $hSecond, "uint", $iOffset)

    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] = 87 Then Return SetError(1, 1, 0)
    If $aResult[0] = 0 Then Return SetError(1, 2, 0)
    Return SetError(0, 0, $aResult[0])
EndFunc

Func _WinAPI_DrawThemeTextEx($hTheme, $hDC, $iPartId, $iStateId, $sText, $iFlags, ByRef $tRect, Const ByRef $tDTTOPTS)
    Local $aResult = DllCall("uxtheme.dll", "int", "DrawThemeTextEx", "ptr", $hTheme, "hwnd", $hDC, "int", $iPartId, "int", $iStateId, _
                        "wstr", $sText, "int", -1, "uint", $iFlags, "ptr", DllStructGetPtr($tRect), "ptr", DllStructGetPtr($tDTTOPTS))

    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] <> 0 Then Return SetError(1, 0, 0)
    Return SetError(0, 0, $aResult[0] = 0)
EndFunc

Func ShowMenu($hWnd, $CtrlID, $nContextID)
    Local $timez = TimerInit()
    Local $arPos, $x, $y
    Local $hMenu = GUICtrlGetHandle($nContextID)

    $arPos = ControlGetPos($hWnd, "", $CtrlID)

    $x = $arPos[0]
    $y = $arPos[1] + $arPos[3]

    ClientToScreen($hWnd, $x, $y)
    TrackPopupMenu($hWnd, $hMenu, $x, $y)

EndFunc

Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
    Local $stPoint = DllStructCreate("int;int")

    DllStructSetData($stPoint, 1, $x)
    DllStructSetData($stPoint, 2, $y)

    DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

    $x = DllStructGetData($stPoint, 1)
    $y = DllStructGetData($stPoint, 2)
    $stPoint = 0
EndFunc

Func TrackPopupMenu($hWnd, $hMenu, $x, $y)
    DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0)
EndFunc

Posted Image

It's not the real UDF, but it's close to what you want, you can modify this code to suit your needs

Edited by dragan

Share this post


Link to post
Share on other sites

The code needs tweaking to work on 64-bit Windows dragan.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

The code needs tweaking to work on 64-bit Windows dragan.

It does? I have win7 64-bit, and it's working here. :mellow:

Share this post


Link to post
Share on other sites

I don't see the menu items text.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Works for me on Win7 x64 here, although the File menu isn't transparent, but that's probably just a program setting.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

It works only when Aero is enabled.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

@dragan: This code does not work for me on WinXP classic view.


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

XP doesn't have Aero, and DwmExtendFrameIntoClientArea is a Vista+ only, function.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

For non Aero desktops and WinXP (except Win8) you can try

It has a lot of rooms for improvement.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Maybe this can help:

#include <Constants.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <FontConstants.au3>
#NoTrayIcon

Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)

OnAutoItExitRegister( "_CleanUp" )

TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "_PopTrayMenu")
TraySetOnEvent($TRAY_EVENT_SECONDARYDOWN, "_PopTrayMenu")

TraySetState()

Global $__width = 100
Global $__height = 100

Global $isShown = False

Global $shine1 = 5
Global $shine2 = 5
Global $shine3 = 125
Global $menuFontSize = 16

Global Const $DTT_TEXTCOLOR = 0x00000001
Global Const $DTT_GLOWSIZE = 0x00000800
Global Const $DTT_COMPOSITED = 0x00002000
If Not IsDeclared("tagDTTOPTS") Then Global Const $tagDTTOPTS = _
"uint Size;uint Flags;uint clrText;uint clrBorder;uint clrShadow;int TextShadowType;" & $tagPOINT & _
";int BorderSize;int FontPropId;int ColorPropId;int StateId;int ApplyOverlay;int GlowSize;ptr DrawTextCallback;int lParam;"
Global $Struct = DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;")
Global $sStruct = DllStructCreate("dword;int;ptr;int")
Global $Area[4] = [$__width*2, 0, $__height*2, 0]

Global $parent = GUICreate('hidden', $__width, $__height)
Global $Form1 = GUICreate('', $__width, $__height, -1, -1, 0, 0, $parent)
Global $GlassArea = GUICtrlCreateLabel("", 0, 0, $__width, $__height)
GUICtrlSetBkColor(-1, 0x000000)
Global $hTheme = _WinAPI_OpenThemeData($Form1, "globals")
If (@OSVersion <> "WIN_VISTA") OR (@OSVersion <> "WIN_7") Then _Vista_ApplyGlassArea($Form1, $Area, 0x000000)

Global $controlGui, $HoverImage, $Mask, $FileGUI, $FileMenu, $EditGUI, $EditMenu, $HelpGUI, $HelpMenu, $ExitGUI, $ExitMenu
Global $FileState = 1
_CreateFakeGUI($FileGUI, 'FileGUI', 50, $menuFontSize*2-Round($menuFontSize/1.5), 0, -$menuFontSize, $FileMenu)
Global $EditState = 1
_CreateFakeGUI($EditGUI, 'EditGUI', 34, $menuFontSize*2-Round($menuFontSize/1.5), 0, $menuFontSize*0.4, $EditMenu)
Global $HelpState = 1
_CreateFakeGUI($HelpGUI, 'HelpGUI', 38, $menuFontSize*2-Round($menuFontSize/1.5), 0, $menuFontSize*1.8, $HelpMenu)
Global $ExitState = 1
_CreateFakeGUI($ExitGUI, 'ExitGUI', 35, $menuFontSize*2-Round($menuFontSize/1.5), 0, $menuFontSize*3.2, $ExitMenu)

$FileDummy = GUICtrlCreateDummy()
$FileContext = GUICtrlCreateContextMenu($FileDummy)
$FileNew = GUICtrlCreateMenu("New", $FileContext)
$FileNewProject = GUICtrlCreateMenuItem("Project", $FileNew)
$FileNewFile = GUICtrlCreateMenuItem("File", $FileNew)
$FileOpen = GUICtrlCreateMenuItem("Open", $FileContext)
$FileSave = GUICtrlCreateMenuItem("Save", $FileContext)
$FileSaveAs = guictrlcreatemenuitem("Save As...", $FileContext)
GUICtrlCreateMenuItem("", $FileContext)
$FileExit = guictrlcreatemenuitem("Exit", $FileContext)

_Draw_menus()

Func _CreateFakeGUI(ByRef $WinHWND, $WinTitle, $WinWIdth, $WinHeight, $Win_X, $Win_Y, ByRef $CtrlHWND)
$WinHWND = GUICreate($WinTitle, $WinWIdth, $WinHeight, $Win_X, $Win_Y,$WS_POPUP, $WS_EX_MDICHILD, $Form1)
$CtrlHWND = GUICtrlCreateLabel('', 0, 0, $WinWIdth, $WinHeight)
GUICtrlSetBkColor(-1, 0x000000)
If (@OSVersion <> "WIN_VISTA") OR (@OSVersion <> "WIN_7") Then _Vista_ApplyGlass($WinHWND, 0x000000)
GUISetState(@SW_DISABLE, $WinHWND)
GUISetState(@SW_HIDE, $WinHWND)
EndFunc

Func _Draw_menus()
_Draw_Menu_ex($FileGUI, 'File ' & ChrW(9658), $menuFontSize, $shine3, 0x000000)
_Draw_Menu_ex($EditGUI, 'Edit', $menuFontSize, $shine3, 0x000000)
_Draw_Menu_ex($HelpGUI, 'Help', $menuFontSize, $shine3, 0x000000)
_Draw_Menu_ex($ExitGUI, 'Exit', $menuFontSize, $shine3, 0x000000)
EndFunc

GUIRegisterMsg(0xF,"MY_PAINT")
GUIRegisterMsg($WM_SYSCOMMAND, "On_WM_SYSCOMMAND")
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

_Initial_Run()

While 1
If $isShown = True Then
If NOT WinActive($Form1) Then
_Slide(0)
Else
_MenuBehavior($FileGUI, $FileMenu, $FileState, 'File ' & ChrW(9658))
_MenuBehavior($EditGUI, $EditMenu, $EditState, 'Edit')
_MenuBehavior($HelpGUI, $HelpMenu, $HelpState, 'Help')
_MenuBehavior($ExitGUI, $ExitMenu, $ExitState, 'Exit')
EndIf
EndIf
Sleep(10)
WEnd

Func _Initial_Run() ;clear the 1st flickering bug
Local $pos = WinGetPos($Form1)
WinMove($Form1, '', @DesktopWidth*2, @DesktopHeight*2, $pos[2], $pos[3])
GUISetState(@SW_SHOW, $Form1)
_ShowSubItems(True)
_ShowSubItems(False)
GUISetState(@SW_HIDE, $Form1)
$isShown = False
EndFunc

Func On_WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam)
If BitAND($wParam, 0xFFF0) = 0xF010 Then Return False
Return $GUI_RUNDEFMSG
EndFunc

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
Local $nID = BitAND($iwParam, 0x0000FFFF)
#forceref $hWnd, $iMsg, $iwParam, $ilParam
Switch $nID
Case $FileExit
_Slide(0)
If MsgBox(3, 'Quit?', 'Are you sure you want to quit?') = 6 then Exit
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc

Func _MenuBehavior($WinHWND, $i_MenuItem, ByRef $i_MenuState, $i_Label, $i_ContextMenu = 0)
Local $a = GUIGetCursorInfo($WinHWND)
Switch $a[4]
Case $i_MenuItem
If $a[2] = 1 Then
If $i_MenuState <> 3 Then
$i_MenuState = 3
if ($FileState <> 1) AND ($FileMenu <> $i_MenuItem) then
$FileState = 1
_Draw_Menu_ex($FileGUI, 'File ' & ChrW(9658), $menuFontSize, $shine3, 0x000000)
                 EndIf
if ($EditState <> 1) AND ($EditMenu <> $i_MenuItem) then
$EditState = 1
_Draw_Menu_ex($EditGUI, 'Edit', $menuFontSize, $shine3, 0x000000)
                 EndIf
if ($HelpState <> 1) AND ($HelpMenu <> $i_MenuItem) Then
$HelpState = 1
_Draw_Menu_ex($HelpGUI, 'Help', $menuFontSize, $shine3, 0x000000)
EndIf
_Draw_Menu_ex($WinHWND, $i_Label, $menuFontSize, $shine1, 0x000099)
Switch $i_MenuItem ;functions on item menu clicks:
Case $FileMenu
ShowMenu($WinHWND, $i_MenuItem, $FileContext)
Case $EditMenu
MsgBox(0, 'info', 'clicked: EDIT')
_Slide(0)
Case $HelpMenu
Local $regRead = 'HKEY_LOCAL_MACHINE\Software\AutoIt v3\AutoIt'
Local $InstallDir = RegRead($regRead, 'InstallDir')
If $InstallDir <> '' then
Run($InstallDir & '\AutoIt3Help.exe')
Else
MsgBox(0, 'Error', 'Sorry, Couldn''t find help files')
EndIf
_Slide(0)
Case $ExitMenu
If MsgBox(3, 'Quit?', 'Are you sure you want to quit?') = 6 then Exit
_Slide(0)
EndSwitch
EndIf
Else
If $i_MenuState <> 2 Then
$i_MenuState = 2
_Draw_Menu_ex($WinHWND, $i_Label, $menuFontSize, $shine2, 0x000000)
EndIf
EndIf
Case Else
If $i_MenuState <> 1 Then
$i_MenuState = 1
_Draw_Menu_ex($WinHWND, $i_Label, $menuFontSize, $shine3, 0x000000)
EndIf
EndSwitch
EndFunc

Func MY_PAINT($hWnd, $Msg, $wParam, $lParam)
If $isShown = True then _Draw_menus()
Return $GUI_RUNDEFMSG
EndFunc

Func _Slide($type = 1)
If $type = 1 then
WinSetOnTop($Form1, '', True)
Local $mouse = MouseGetPos()
Local $pos = WinGetPos($Form1)
Local $posX = $mouse[0]+6
Local $posY = $mouse[1]-10
If @DesktopWidth - $posX <= $__width then $posX = $mouse[0]-16-$pos[2]
WinMove($Form1, '', $posX, $posY, $pos[2], 0)
GUISetState(@SW_SHOW, $Form1)
For $i = 32 to $pos[3] Step 7
WinMove($Form1, '', $posX, $posY-$i, $pos[2], $i)
Sleep(1)
Next
WinMove($Form1, '', $posX, $posY-$pos[3], $pos[2], $pos[3])
_ShowSubItems(True)
$isShown = True
Else
_ShowSubItems(False)
GUISetState(@SW_HIDE, $Form1)
$isShown = False
EndIf
EndFunc

Func _ShowSubItems($value)
If $value = True Then
GUISetState(@SW_SHOWNOACTIVATE, $FileGUI)
GUISetState(@SW_SHOWNOACTIVATE, $EditGUI)
GUISetState(@SW_SHOWNOACTIVATE, $HelpGUI)
GUISetState(@SW_SHOWNOACTIVATE, $ExitGUI)
_Draw_menus()
Else
GUISetState(@SW_HIDE, $FileGUI)
GUISetState(@SW_HIDE, $EditGUI)
GUISetState(@SW_HIDE, $HelpGUI)
GUISetState(@SW_HIDE, $ExitGUI)
EndIf
EndFunc

Func _PopTrayMenu()
_Slide(1)
EndFunc

Func _CleanUp()
_WinAPI_CloseThemeData($hTheme)
EndFunc

Func _WinAPI_CloseThemeData($hTheme)
Local $aResult = DllCall("uxtheme.dll", "int", "CloseThemeData", "hwnd", $hTheme)

If @error Then Return SetError(@error, @extended, 0)
Return SetError(0, 0, $aResult[0] = 0)
EndFunc

Func _WinAPI_OpenThemeData($hWnd, $sClassList)
Local $aResult = DllCall("uxtheme.dll", "hwnd", "OpenThemeData", "hwnd", $hWnd, "wstr", $sClassList)

If @error Then Return SetError(@error, @extended, 0)
If $aResult[0] = 0 Then Return SetError(1, 0, 0)
Return SetError(0, 0, $aResult[0])
EndFunc

Func _Vista_ApplyGlass($hWnd, $bColor = 0x000000)
GUISetBkColor($bColor)
$Ret = DllCall("dwmapi.dll", "long", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "long*", DllStructGetPtr($Struct))
If @error Then
Return 0
SetError(1)
Else
Return $Ret
EndIf
EndFunc

Func _Vista_ApplyGlassArea($hWnd, $Area, $bColor = 0x000000)
If IsArray($Area) Then
DllStructSetData($Struct, "cxLeftWidth", $Area[0])
DllStructSetData($Struct, "cxRightWidth", $Area[1])
DllStructSetData($Struct, "cyTopHeight", $Area[2])
DllStructSetData($Struct, "cyBottomHeight", $Area[3])
GUISetBkColor($bColor)
$Ret = DllCall("dwmapi.dll", "long*", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "ptr", DllStructGetPtr($Struct))
If @error Then
Return 0
Else
Return $Ret
EndIf
Else
MsgBox(16, "_Vista_ApplyGlassArea", "Area specified is not an array!")
EndIf
EndFunc

Func _Draw_Menu_ex($WinHandle, $iCaption, $iSize, $iShine, $iColor)
Local $hDC = _WinAPI_GetDC($WinHandle)
Local $tClientRect = _WinAPI_GetClientRect($WinHandle)
Local $sText = $iCaption
Local $hFont = _WinAPI_CreateFont($iSize, $iSize/2-1, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, _
     $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'SegoeUI')
_DrawGlowingText($hDC, $sText, $tClientRect, $iShine, $hFont, $iColor)
_WinAPI_DeleteObject($hFont)
_WinAPI_ReleaseDC($WinHandle, $hDC)
EndFunc

Func _DrawGlowingText($hDC, $sText, $tRc, $iGlowSize = 10, $hFont = 0, $iTextClr = -1)
Local $hCDC
Local $hBrush, $hOldBrush
Local $tRcText
Local $tBI, $tDTO
Local $hDIBBmp, $hOldBmp
Local $hOldFont
Local $tST
Local $iFlags = BitOR($DTT_GLOWSIZE, $DTT_COMPOSITED)

$hCDC = _WinAPI_CreateCompatibleDC($hDC)

$tBI = DllStructCreate($tagBITMAPINFO)
DllStructSetData($tBI, "Size", DllStructGetSize($tBI)-4)
DllStructSetData($tBI, "Width", DllStructGetData($tRc, "Right")-DllStructGetData($tRc, "Left"))
DllStructSetData($tBI, "Height", -(DllStructGetData($tRc, "Bottom")-DllStructGetData($tRc, "Top")))
DllStructSetData($tBI, "Planes", 1)
DllStructSetData($tBI, "BitCount", 32)
DllStructSetData($tBI, "Compression", 0)

$hDIBBmp = _WinAPI_CreateDIBSection($hDC, $tBI)
$hOldBmp = _WinAPI_SelectObject($hCDC, $hDIBBmp)
If $hFont Then $hOldFont = _WinAPI_SelectObject($hCDC, $hFont)

     $tDTO = DllStructCreate($tagDTTOPTS)
DllStructSetData($tDTO, "Size", DllStructGetSize($tDTO))

If $iTextClr <> -1 Then
     $iFlags = BitOR($iFlags, $DTT_TEXTCOLOR)
     DllStructSetData($tDTO, "clrText", $iTextClr)
EndIf


DllStructSetData($tDTO, "Flags", $iFlags)
DllStructSetData($tDTO, "GlowSize", $iGlowSize)

_WinAPI_DrawThemeTextEx($hTheme, $hCDC, 0, 0, $sText, _
     BitOR($DT_SINGLELINE, $DT_CENTER, $DT_VCENTER, $DT_NOPREFIX), $tRc, $tDTO)

_WinAPI_BitBlt($hDC, DllStructGetData($tRc, "Left"), DllStructGetData($tRc, "Top"), _
     DllStructGetData($tRc, "Right")-DllStructGetData($tRc, "Left"), _
     DllStructGetData($tRc, "Bottom")-DllStructGetData($tRc, "Top"), $hCDC, 0, 0, 0xCC0020)

_WinAPI_SelectObject($hCDC, $hOldBmp)
If $hFont Then _WinAPI_SelectObject($hCDC, $hOldFont)
_WinAPI_DeleteObject($hDIBBmp)
_WinAPI_DeleteDC($hCDC)
EndFunc

Func _WinAPI_CreateDIBSection($hDC, Const ByRef $tBmpInfo, $iUsage = 0, $pBits = 0, $hSecond = 0, $iOffset = 0)
Local $aResult = DllCall("gdi32.dll", "hwnd", "CreateDIBSection", "hwnd", $hDC, "ptr", DllStructGetPtr($tBmpInfo), _
                     "uint", $iUsage, "ptr", $pBits, "hwnd", $hSecond, "uint", $iOffset)

If @error Then Return SetError(@error, @extended, 0)
If $aResult[0] = 87 Then Return SetError(1, 1, 0)
If $aResult[0] = 0 Then Return SetError(1, 2, 0)
Return SetError(0, 0, $aResult[0])
EndFunc

Func _WinAPI_DrawThemeTextEx($hTheme, $hDC, $iPartId, $iStateId, $sText, $iFlags, ByRef $tRect, Const ByRef $tDTTOPTS)
Local $aResult = DllCall("uxtheme.dll", "int", "DrawThemeTextEx", "ptr", $hTheme, "hwnd", $hDC, "int", $iPartId, "int", $iStateId, _
                     "wstr", $sText, "int", -1, "uint", $iFlags, "ptr", DllStructGetPtr($tRect), "ptr", DllStructGetPtr($tDTTOPTS))

If @error Then Return SetError(@error, @extended, 0)
If $aResult[0] <> 0 Then Return SetError(1, 0, 0)
Return SetError(0, 0, $aResult[0] = 0)
EndFunc

Func ShowMenu($hWnd, $CtrlID, $nContextID)
Local $timez = TimerInit()
Local $arPos, $x, $y
Local $hMenu = GUICtrlGetHandle($nContextID)

$arPos = ControlGetPos($hWnd, "", $CtrlID)

$x = $arPos[0]
$y = $arPos[1] + $arPos[3]

ClientToScreen($hWnd, $x, $y)
TrackPopupMenu($hWnd, $hMenu, $x, $y)

EndFunc

Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
Local $stPoint = DllStructCreate("int;int")

DllStructSetData($stPoint, 1, $x)
DllStructSetData($stPoint, 2, $y)

DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

$x = DllStructGetData($stPoint, 1)
$y = DllStructGetData($stPoint, 2)
$stPoint = 0
EndFunc

Func TrackPopupMenu($hWnd, $hMenu, $x, $y)
DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0)
EndFunc

Posted Image

It's not the real UDF, but it's close to what you want, you can modify this code to suit your needs

that looks alot better xD just the length of that code damnn x'D i guess i stay with the simple look and know what i am doing O.o

well thanks anyways^^

Share this post


Link to post
Share on other sites

As I've understood TrayMenus shouldn't be too over complex or fancy, because they're intended for accessing settings of a minimised/hidden application.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

As I've understood TrayMenus shouldn't be too over complex or fancy, because they're intended for accessing settings of a minimised/hidden application.

well maybe:P but u can do alot of awesome/handy stuff with it^^ and a fancy tray menu would be a nice thing to have^^

it's like a windows start menu where i can open things with like gui's and other stuff:P

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

A simple script for everyone, work on Xp-7:

; Johnmcloud
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
TraySetOnEvent($TRAY_EVENT_SECONDARYUP, "_TrasparentTray")
TraySetState()

While 1
Sleep(100)
WEnd

Func _TrasparentTray()
$hGUI = GUICreate("Tray Menu Trasparent", 141, 94, 650, 439, BitOR($WS_CAPTION, $WS_POPUP), BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$B1 = GUICtrlCreateButton("Test1", 0, 0, 140, 33)
$B2 = GUICtrlCreateButton("Test2", 0, 40, 140, 25)
$B3 = GUICtrlCreateButton("Exit", 0, 72, 140, 17)
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 130)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $B1
MsgBox(0, 0, "Test")
Case $B3
Exit
EndSwitch
If Not WinActive($hGUI, "") Then
GUIDelete($hGUI)
ExitLoop
EndIf
WEnd
EndFunc ;==>_TrasparentTray

Instead of button can be used label, images etc. like a normal GUI, sorry for wrong coordinate-size but can be easyly adjusted but this was only a test

Posted Image

Edited by johnmcloud

Share this post


Link to post
Share on other sites

A simple script for everyone, work on Xp-7:

; Johnmcloud
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
TraySetOnEvent($TRAY_EVENT_SECONDARYUP, "_TrasparentTray")
TraySetState()

While 1
Sleep(100)
WEnd

Func _TrasparentTray()
$hGUI = GUICreate("Tray Menu Trasparent", 141, 94, 650, 439, BitOR($WS_CAPTION, $WS_POPUP), BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$B1 = GUICtrlCreateButton("Test1", 0, 0, 140, 33)
$B2 = GUICtrlCreateButton("Test2", 0, 40, 140, 25)
$B3 = GUICtrlCreateButton("Exit", 0, 72, 140, 17)
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 130)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $B1
MsgBox(0, 0, "Test")
Case $B3
Exit
EndSwitch
If Not WinActive($hGUI, "") Then
GUIDelete($hGUI)
ExitLoop
EndIf
WEnd
EndFunc ;==>_TrasparentTray

Instead of button can be used label, images etc. like a normal GUI, sorry for wrong coordinate-size but can be easyly adjusted but this was only a test

Posted Image

I guess i can make a gui for it like this and let it popup when i click on the tray icon and work from there... din't thought of it XD

sooooo... thanks for the idea^^

Share this post


Link to post
Share on other sites

; By johnmcloud and guinness - 2013
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Opt('TrayMenuMode', 1)
Opt('TrayOnEventMode', 1)

TraySetOnEvent($TRAY_EVENT_SECONDARYUP, '_TransparentMenu')
TraySetState()

While 1
    Sleep(100)
WEnd

Func _TransparentMenu()
    Local $aMouseGetPos = MouseGetPos() ; Check the mouse position.
    If @error Then Return False

    Local Const $bTRANSPARENT_COLOR = 0xABCDEF, $iTRANSPARENT_PERCENT = 210
    Local Enum $eMouse_Left, $eMouse_Top
    Local $iHeight = 65, $iWidth = 100
    Local $hGUI = GUICreate('', $iWidth, $iHeight, $aMouseGetPos[$eMouse_Left], $aMouseGetPos[$eMouse_Top] - $iHeight - 40, BitOR($WS_THICKFRAME, $WS_POPUP), Default, WinGetHandle(AutoItWinGetTitle()))

    Local $iClose = GUICtrlCreateButton('Close', 5, $iHeight - 60, $iWidth - 10, 25)
    Local $iExit = GUICtrlCreateButton('Exit', 5, $iHeight - 30, $iWidth - 10, 25)

    GUISetState(@SW_SHOW, $hGUI)

    Local $fIsExit = False ; If Exit is selected.
    While 1
        If WinActive($hGUI) = 0 Then ExitLoop
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $iExit
                $fIsExit = True
                ExitLoop

            Case $iClose
                ExitLoop
        EndSwitch
    WEnd
    GUIDelete($hGUI)

    If $fIsExit Then Exit ; Bad design, but this is merely an example.
    Return True
EndFunc   ;==>_TransparentMenu

It's not transparent, but gives you an idea about design (even if it looks poor.)


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

What i got now is :

#include 
#include 
#include 
#include 
#include 
#include 

Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
TraySetOnEvent($TRAY_EVENT_SECONDARYUP, "test")
TraySetState()

Global $FPrograms, $FCredits, $FScripts

FileCopy (@scriptfullpath, @StartupDir)

Func GuiMenu()
$GMenu = GUICreate("Menu", 166, 347, 1735, 773)
GUISetState()
EndFunc

TraySetIcon("test", -1)
TraySetClick("64")


Func GuiPrograms()
$FPrograms = GUICreate("Programs", 123, 136, 551, 331, $WS_POPUP)
$BUren = GUICtrlCreateButton("Excel Uren", 24, 8, 75, 25)
GUICtrlSetOnEvent($BUren, "Excel_Uren")
$BDatabase = GUICtrlCreateButton("Database", 24, 40, 75, 25)
GUICtrlSetOnEvent($BDatabase, "Database")
$BScriptEditor = GUICtrlCreateButton("Make Script", 24, 72, 75, 25)
GUICtrlSetOnEvent($BScriptEditor, "Make_Script")
$ExitProgram = GUICtrlCreateButton("Exit", 24, 104, 75, 25)
GUICtrlSetOnEvent($ExitProgram, "ClosePrograms")
GUISetState()
EndFunc

Func GuiCredits()
$FCredits = GUICreate("Credits", 221, 98, 588, 311, $WS_POPUP)
$Label1 = GUICtrlCreateLabel("Program designed by Tijn Tinnenbroek", 8, 8, 186, 17)
$Label2 = GUICtrlCreateLabel("Programs used: Autoit && Koda FormDesigner", 8, 32, 212, 17)
$BCloseCredits = GUICtrlCreateButton("Close", 72, 64, 75, 25)
GUICtrlSetOnEvent($BCloseCredits, "CloseCredits")
GUISetState()
EndFunc

func GuiScripts()
$FScripts = GUICreate("Scripts", 330, 185, 686, 333, $WS_POPUP)
$BGuiAll = GUICtrlCreateButton("Gui Overall", 8, 8, 75, 25)
$BTray = GUICtrlCreateButton("Tray function", 8, 40, 75, 25)
$BSaveLoad = GUICtrlCreateButton("Save Load", 8, 72, 75, 25)
$BCloseScripts = GUICtrlCreateButton("Close", 248, 152, 75, 25)
GUICtrlSetOnEvent($BCloseScripts, "CloseScrips")
GUISetState()
EndFunc

Func test()
GuiMenu()
EndFunc

Func CloseScrips()
GUIDelete ($FScripts)
EndFunc

func CloseCredits()
GUIDelete ($FCredits)
EndFunc

Func ClosePrograms()
GUIDelete ($FPrograms)
EndFunc

While 1
Sleep (10)
WEnd

Func Programs()
GuiPrograms()
EndFunc

Func Scripts()
GuiScripts()
EndFunc

Func Private()
Run("explorer.exe " & "F:\coding\testing\Private")
EndFunc

Func Admin()
If @Compiled Then
ShellExecute (@scriptfullpath, "", @WorkingDir, "RunAs")
Else
ShellExecute(@AutoItExe, '/AutoIt3ExecuteScript "' & @ScriptFullPath & '"', @WorkingDir, "runas")
EndIf
Exit
EndFunc

Func Credits()
GuiCredits()
EndFunc

Func Close()
Exit
EndFunc

Func Excel_Uren()
ShellExecute ("Werkzaamheden Tijn Tinnenbroek.xlsx", -1, "C:\Users\tti007\Desktop")
EndFunc

Func Database()
ShellExecute ("AssetManagement.mdb", -1, "\\nls0660\nlg5024\Access\Data")
EndFunc

Func Make_Script()
ShellExecute ("SciTE.exe", -1, "C:\Program Files (x86)\AutoIt3\SciTE")
EndFunc

just the problem is i want it to show up when my mouse hovers the tray icon... and i guess that only works with tray menu items am i right? cause no matter what i do with the flags (http://www.autoitscript.com/autoit3/docs/functions/TraySetClick.htm) it just opens it when i right press. kinda strange to me:O

Share this post


Link to post
Share on other sites

And another question is when i open my tray menu i want it to be in the right corner doesn't matter on what pc i am so my point is it's always in that corner is that possible? because every screen has his one resulution. i tried @DesktopWidth and stuff but that didn't worked out:(

can someone please help me with that?:(

Share this post


Link to post
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
Sign in to follow this  
Followers 0