Jump to content

Application Launcher (Array Problem)


 Share

Recommended Posts

Good afternoon,

I hope someone can help me Im still a novice when it comes to AutoIT and Ive run into a brick wall.

Im trying to create an Dynamic Application Launcher menu based on information contained within an INI file. Ive managed to create the buttons without a problem. However Im having difficulty creating the events which are triggered when a button is pressed.

e.g. Launching Paint / Notepad

Ive assigned the values to an array (not sure if I've gone about this the right way) but Im not sure how to access the values or create the events based on those values contained within the array.

Any help will be much appreciated thanks in advance

Application Launcher:

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

Opt("TrayIconHide", 1)
Opt('MustDeclareVars', 1)

If @Compiled = 1 Then
   Local $list = ProcessList(@ScriptName)
   If $list[0][0] > 1 Then Exit
EndIf

; Reading ini file
Global $INI_File = @ScriptDir & "\config.ini"
Global $WindowTitle = IniRead($INI_File, "Parameters", "GUITitle", "TS Launcher")
Global $ApplicationCount = IniRead($INI_File, "Parameters", "AppCount", "1")

_Main()

Func _Main()
    Local $buttonclose, $ct
    Local $GUI,$GUI_Width,$GUI_Height,$GUI_Border,$X,$Y

    Local $AppButton[$ApplicationCount]
    Local $ApplicationName[$ApplicationCount]
    Local $ApplicationDescription[$ApplicationCount]
    Local $ApplicationPath[$ApplicationCount]
    Local $ApplicationExecutable[$ApplicationCount]
    
    $GUI_Width = 145
    $GUI_Height = 62 + (40*$ApplicationCount)
    
    $GUI_Border = 5
    
    $X = @DesktopWidth - ($GUI_Width + $GUI_Border)
    $Y = @DesktopHeight - ($GUI_Height + $GUI_Border)
    
    $GUI = GUICreate($WindowTitle, $GUI_Width, $GUI_Height, $X, $Y, $WS_BORDER, $WS_EX_TOOLWINDOW)  
    Local $GUIButtonLayout = 0
    Local $GUILabelLayout = 14
    Local $ArrayStart = 0
    
    For $AppID = 1 To $ApplicationCount
        $ApplicationName[$ArrayStart] = IniRead($INI_File, "App" & $AppID, "Name", "Notepad")
        $ApplicationDescription[$ArrayStart] = IniRead($INI_File, "App" & $AppID, "Description", "Notepad")
        $ApplicationPath[$ArrayStart] = IniRead($INI_File, "App" & $AppID, "Path", "C:\WINDOWS\")
        $ApplicationExecutable[$ArrayStart] = IniRead($INI_File, "App" & $AppID,"Executable", "notepad.exe")
        
        $AppButton[$ArrayStart] = GUICtrlCreateButton ($ApplicationName[$ArrayStart], 0,$GUIButtonLayout,40,40,$BS_ICON)
        GUICtrlSetImage (-1, $ApplicationPath[$ArrayStart] & $ApplicationExecutable[$ArrayStart],0)
        GUICtrlSetTip(-1,$ApplicationDescription[$ArrayStart],$ApplicationName[$ArrayStart])
        GUICtrlCreateLabel($ApplicationName[$ArrayStart],45, $GUILabelLayout, 200, 20)
        
        $ArrayStart+=1
        $GUIButtonLayout+=40
        $GUILabelLayout+=40
        
    Next
;~  _ArrayDisplay($AppButton, "$AppButton set manually 1D")
;~  _ArrayDisplay($ApplicationName, "$ApplicationName set manually 1D")
;~  _ArrayDisplay($ApplicationDescription, "$ApplicationDescription set manually 1D")
;~  _ArrayDisplay($ApplicationPath, "$ApplicationPath set manually 1D")
;~  _ArrayDisplay($ApplicationExecutable, "$ApplicationExecutable set manually 1D")
    
    $buttonclose = GUICtrlCreateButton("Exit", 0, $GUIButtonLayout, 40, 40, $BS_ICON)

    GUICtrlSetImage(-1, "shell32.dll", 28)
    GUICtrlSetTip(-1,"Exit")
    GUICtrlCreateLabel("Exit / Disconnect",45, $GUILabelLayout, 200 , 20)
    GUISetState()
    WinSetOnTop($GUI, "", 1)
    
; Run the GUI until the dialog is closed
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $buttonclose
                ExitLoop
            Case Else
        EndSwitch
    WEnd
    GUIDelete()
EndFunc   ;==>_Main

CONFIG.INI

CODE
[Parameters]

GUITitle=Application Launcher

AppCount=2

[App1]

Name=Notepad

Description=Notepad

Path=C:\WINDOWS\

Executable=NOTEPAD.EXE

[App2]

Name=Paint

Description=Microsoft Paint

Path=C:\Windows\System32\

Executable=mspaint.exe

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

Link to comment
Share on other sites

Hi my friend...

First of all, try this in your code...

Global $AppCount = IniReadSectionNames ($INI_File) ; Gets the names of all sections

$AppCount = $AppCount[0]-1 ; $AppCount[0] = Total number of sections... except we want to exclude the "Parameters" one... That's why the "-1" is here

It should avoid you to maintain the "AppCount" line in the "Parameters" section. Therfore you can add many applications (sections) without having the risk

to omit to update the AppCount value.

Regarding Events management... I have to look a bit more but I think it's possible.

See you soon for the solution (I hope).

Bye

FreeRiderHonour & Fidelity

Link to comment
Share on other sites

Fantastic!

Thanks for that, I was wondering whether or not I could automate that part Ive made the changes to my code and it works a treat- Thanks again.

Thanks for looking into the events issue I will continue searching and if I find a solution I'll let you know... thanks again for your assistance

Edited by PlayZoneUK

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

Link to comment
Share on other sites

It's me again...

Here is a modified version of your script... and it works (I made the test)...

Main modifications :

- GuiOnEventMode activated instead of $GuiGetMsg

- Application count automated (no need to maintain the related value in the "Parameters" section

- An Exit function and a RunApplication function have been added to manager gui events

Take a look and tell me if something's not OK and I'll try to help...

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

Opt("TrayIconHide", 1)
Opt('MustDeclareVars', 1)
Opt('GUIOnEventMode' , 1); **** THIS LINE WAS ADDED BY FREERIDER
If @Compiled = 1 Then
   Local $list = ProcessList(@ScriptName)
   If $list[0][0] > 1 Then Exit
EndIf

; Reading ini file
Global $INI_File = @ScriptDir & "\config.ini"
Global $WindowTitle = IniRead($INI_File, "Parameters", "GUITitle", "TS Launcher")
Global $ApplicationCount = IniReadSectionNames ($INI_File) ; **** THIS LINE WAS ADDED BY FREERIDER
$ApplicationCount = $ApplicationCount[0]-1; **** THIS LINE WAS ADDED BY FREERIDER

_Main()

Func _Main()
    Local $buttonclose, $ct
    Local $GUI,$GUI_Width,$GUI_Height,$GUI_Border,$X,$Y
    Local $AppButton[$ApplicationCount]
    Local $ApplicationName[$ApplicationCount]
    Local $ApplicationDescription[$ApplicationCount]
    Local $ApplicationPath[$ApplicationCount]
    Local $ApplicationExecutable[$ApplicationCount]
   
    $GUI_Width = 145
    $GUI_Height = 62 + (40*$ApplicationCount)
   
    $GUI_Border = 5
   
    $X = @DesktopWidth - ($GUI_Width + $GUI_Border)
    $Y = @DesktopHeight - ($GUI_Height + $GUI_Border)
   
    $GUI = GUICreate($WindowTitle, $GUI_Width, $GUI_Height, $X, $Y, $WS_BORDER, $WS_EX_TOOLWINDOW)  
    Local $GUIButtonLayout = 0
    Local $GUILabelLayout = 14
    Local $ArrayStart = 0
   
    For $AppID = 1 To $ApplicationCount
        $ApplicationName= IniRead($INI_File, "App" & $AppID, "Name", "Not Found")
        $ApplicationDescription = IniRead($INI_File, "App" & $AppID, "Description", "Not Found")
        $ApplicationPath = IniRead($INI_File, "App" & $AppID, "Path", "Not Found")
        $ApplicationExecutable = IniRead($INI_File, "App" & $AppID,"Executable", "Not Found")
        $AppButton = GUICtrlCreateButton ($ApplicationName, 0,$GUIButtonLayout,40,40,$BS_ICON)
        GUICtrlSetOnEvent(-1,"RunApplication")
        GUICtrlSetImage (-1, $ApplicationPath & $ApplicationExecutable,0)
        GUICtrlSetTip(-1,$ApplicationDescription,$ApplicationName)
        GUICtrlCreateLabel($ApplicationName,45, $GUILabelLayout, 200, 20)
       
        $ArrayStart+=1
        $GUIButtonLayout+=40
        $GUILabelLayout+=40
       
    Next
;~  _ArrayDisplay($AppButton, "$AppButton set manually 1D")
;~  _ArrayDisplay($ApplicationName, "$ApplicationName set manually 1D")
;~  _ArrayDisplay($ApplicationDescription, "$ApplicationDescription set manually 1D")
;~  _ArrayDisplay($ApplicationPath, "$ApplicationPath set manually 1D")
;~  _ArrayDisplay($ApplicationExecutable, "$ApplicationExecutable set manually 1D")
   
    $buttonclose = GUICtrlCreateButton("Exit", 0, $GUIButtonLayout, 40, 40, $BS_ICON)
    GUICtrlSetOnEvent($buttonclose,"Quit"); **** THIS LINE WAS ADDED BY FREERIDER
    GUICtrlSetImage(-1, "shell32.dll", 28)
    GUICtrlSetTip(-1,"Exit")
    GUICtrlCreateLabel("Exit / Disconnect",45, $GUILabelLayout, 200 , 20)
    GUISetState()
    WinSetOnTop($GUI, "", 1)
EndFunc  ;==>_Main

Func RunApplication () ; **** THIS FUNCTION WAS ADDED BY FREERIDER
    Local $ChoosenButton, $SectionContent
    $ChoosenButton = Guictrlread(@GUI_CtrlId); Gets the name of the application to run
    For $AppID = 1 To $ApplicationCount; Loops until desired application is found
        $SectionContent = IniReadSection($INI_File,"App" & $AppID )
        If $SectionContent[1][1] = $ChoosenButton Then; Application section has been found (Name of the control = Name value in the ini file)
            Run ($SectionContent[3][1] & $SectionContent[4][1]); Runs the application
            Return; and returns
        EndIf
    Next
EndFunc

Func Quit () ; **** THIS FUNCTION WAS ADDED BY FREERIDER
    Exit
EndFunc

While 1  ; Main script loop 
    Sleep (250)
WEnd

FreeRiderHonour & Fidelity

Link to comment
Share on other sites

Thanks for the quick response and thanks for taking the time to look at my code.

Ive read through the post and noticed that Id actually tried some of what you suggested in an earlier version However I missed out the most important part:

Opt('GUIOnEventMode' , 1)

DOH!

Thanks again

Edited by PlayZoneUK

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

Link to comment
Share on other sites

You'r right.. This line is important...

However I have an other suggestion for you... Instead of use a Gui you should use the tray (see "TrayCreateMenu" and related function in the help file) to display the application list.

This would allow you to always have the script running without to have the Gui activated. You only could activate the tray menu when clicking on the tray Icon.

Note that in the tray you also can display icons included into the menu items.

Bye

FreeRiderHonour & Fidelity

Link to comment
Share on other sites

Hi FreeRider,

Good suggestion, Ive used the suggested method before for another type of Launcher in the past and it works great (nothing this complex and without the icons - which I really wanted). However the requirement for the Application Launcher is that it will be sat on a Terminal Server and remote clients will have no desktop / toolbar / system tray. The Launcher program is required to provide an interface to specified applications within the ini file.

However now that you mention it, I have changed the requirements of the program a number of times to make it more generic (not having applications hardcoded). Maybe I can move the goalposts again and implement your suggestion to suit if it isnt in a TS Environment ;)

Thanks for the suggestion I will have a look and let you know.

Edited by PlayZoneUK

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

Link to comment
Share on other sites

Evening All,

I've incorporated FreeRider's suggestion into the script. However in order to use the functionality provided from the following post:

http://www.autoitscript.com/forum/index.php?showtopic=20967

Ive had to remove the following include from my script:

#include <WindowsConstants.au3>oÝ÷ Øjë#oz·¦¢÷¶nÞ¶°wh¬-Û-)Ûç¥w¢|§r[^/z)æÉÊx¶Ø^~e£§ê뢷(uæèÄ-=Øú趦)^³Ovëh"Ýô÷b'r[{OvZ)Ý£¢{-j{ljíöÛùNGMúXÂÁQ4Î5Cé­ëâ¢ë%ÉתÞu«ßШËwôihm©B¢{-Ó~0°TM3P
Edited by PlayZoneUK

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

Link to comment
Share on other sites

Right I've fixed the include problem.... just the main issue now of launching applications from the tray menu.

Ta very much for any help with this issue

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

Link to comment
Share on other sites

Hi FreeRider,

Thanks for getting back to me

Because Ive used the following method available from the following:

http://www.autoitscript.com/forum/index.php?showtopic=20967

It doesnt seem to make any difference if I add that code as the custom tray menu with icons doesn't appear to use the standard autoit tray menu controls

Ive merged the two tray menus into my script e.g. AutoIT Tray Menu and the custom Tray Menu with icons. The AutoIT tray menu works no problem but it doesnt have any icons ;) have any ideas?

Application Launcher.au3

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include "ModernMenuRaw.au3" ; Only unknown constants are declared here
#include <ButtonConstants.au3>
#NoTrayIcon

Opt("TrayIconHide", 1)
Opt("TrayMenuMode",1)
Opt("TrayOnEventMode",1)
Opt('MustDeclareVars', 1)
Opt('GUIOnEventMode' , 1); **** THIS LINE WAS ADDED BY FREERIDER
If @Compiled = 1 Then
   Local $list = ProcessList(@ScriptName)
   If $list[0][0] > 1 Then Exit
EndIf

; Reading ini file
Global $nTrayIcon1,$nTrayMenu1
Global $INI_File = @ScriptDir & "\config.ini"
Global $WindowTitle = IniRead($INI_File, "Parameters", "GUITitle", "Application Launcher")
Global $TrayIcon = IniRead($INI_File, "Parameters", "TrayIcon", "shell32.dll")
Global $Mode = IniRead($INI_File, "Parameters", "Mode", "Tray")
Global $ApplicationCount = IniReadSectionNames ($INI_File) ; Gets the names of all sections (ADDED BY FREERIDER)
$ApplicationCount = $ApplicationCount[0]-1 ; $AppCount[0] = Total number of sections... except we want to exclude the "Parameters" one... That's why the "-1" is here (ADDED BY FREERIDER)
Global $AppTray,$AppButton,$AppSettings

;Create the tray icon and set custom icon
$nTrayIcon1 = _TrayIconCreate($WindowTitle, $TrayIcon)
_TrayIconSetState() ; Show the tray icon

;Sets AutoIT Tray Menu Icon
TraySetIcon($TrayIcon)

_Main()

Func _Main()
    Local $buttonclose, $trayclose
    Local $GUI,$GUI_Width,$GUI_Height,$GUI_Border,$X,$Y
    Local $ApplicationName,$ApplicationDescription,$ApplicationPath,$ApplicationExecutable
    
   
    $GUI_Width = 145
    $GUI_Height = 62 + (40*$ApplicationCount)
   
    $GUI_Border = 5
   
    $X = @DesktopWidth - ($GUI_Width + $GUI_Border)
    $Y = @DesktopHeight - ($GUI_Height + $GUI_Border + 30)
   
    $GUI = GUICreate($WindowTitle, $GUI_Width, $GUI_Height, $X, $Y, $WS_BORDER, $WS_EX_TOOLWINDOW)  
    Local $GUIButtonLayout = 0
    Local $GUILabelLayout = 14
    
    $nTrayMenu1     = _TrayCreateContextMenu()
   
    For $AppID = 1 To $ApplicationCount
        $ApplicationName= IniRead($INI_File, "App" & $AppID, "Name", "Not Found")
        $ApplicationDescription = IniRead($INI_File, "App" & $AppID, "Description", "Not Found")
        $ApplicationPath = IniRead($INI_File, "App" & $AppID, "Path", "Not Found")
        $ApplicationExecutable = IniRead($INI_File, "App" & $AppID,"Executable", "Not Found")
        
        ;Build GUI
        $AppButton = GUICtrlCreateButton ($ApplicationName, 0,$GUIButtonLayout,40,40,$BS_ICON)
        GUICtrlSetOnEvent(-1,"RunApplication")
        GUICtrlSetImage (-1, $ApplicationPath & $ApplicationExecutable,0)
        GUICtrlSetTip(-1,$ApplicationDescription,$ApplicationName)
        GUICtrlCreateLabel($ApplicationName,45, $GUILabelLayout, 200, 20)
        $GUIButtonLayout+=40
        $GUILabelLayout+=40
        
        ;Build non-standard Tray Menu Items
        $AppTray = _TrayCreateItem($ApplicationName)
        GUICtrlSetOnEvent(-1, "RunApplication")
        _TrayItemSetIcon(-1, $ApplicationPath & $ApplicationExecutable)
        
        ;Build standard AutoIT Tray Menu Items
        $AppTray = TrayCreateItem($ApplicationName)
        TrayItemSetOnEvent(-1, "RunApplicationTray")
    Next
   
    $buttonclose = GUICtrlCreateButton("Exit", 0, $GUIButtonLayout, 40, 40, $BS_ICON)
    GUICtrlSetOnEvent($buttonclose,"Quit"); **** THIS LINE WAS ADDED BY FREERIDER
    GUICtrlSetImage(-1, "shell32.dll", 28)
    GUICtrlSetTip(-1,"Exit")
    GUICtrlCreateLabel("Exit / Disconnect",45, $GUILabelLayout, 200 , 20)
    GUISetState()
    WinSetOnTop($GUI, "", 1)
    
    ;Build remaining non-standard Tray menu items
    _TrayCreateItem("")
    _TrayItemSetIcon(-1, "", 0)
    $AppSettings = _TrayCreateItem("Settings")
    _TrayItemSetIcon($AppSettings, "shell32.dll", -36)
    GUICtrlSetOnEvent($AppSettings, "Settings")
    _TrayCreateItem("")
    _TrayItemSetIcon(-1, "", 0)
    $trayclose = _TrayCreateItem("Exit / Disconnect")
    _TrayItemSetIcon($trayclose, "shell32.dll", -28)
    GUICtrlSetOnEvent($trayclose, "Quit")
    
    ;Build remaining standard AutoIT Tray menu items
    TrayCreateItem("")
    $AppSettings = TrayCreateItem("Settings")
    TrayItemSetOnEvent($AppSettings, "Settings")
    TrayCreateItem("")
    $trayclose = TrayCreateItem("Exit / Disconnect")
    TrayItemSetOnEvent($trayclose, "Quit")
    
    TraySetState()
EndFunc  ;==>_Main

Func RunApplication () ; **** THIS FUNCTION WAS ADDED BY FREERIDER
    Local $ChoosenButton, $SectionContent
    MsgBox(4096, "",Guictrlread(@GUI_CtrlId))
    $ChoosenButton = Guictrlread(@GUI_CtrlId); Gets the name of the application to run
    For $AppID = 1 To $ApplicationCount; Loops until desired application is found
        $SectionContent = IniReadSection($INI_File,"App" & $AppID )
        If $SectionContent[1][1] = $ChoosenButton Then; Application section has been found (Name of the control = Name value in the ini file)
            Run ($SectionContent[3][1] & $SectionContent[4][1]); Runs the application
            Return; and returns
        EndIf
    Next
EndFunc

Func RunApplicationTray () ; This function is for the standard AutoIT Tray Menu
    Local $ChoosenButton, $SectionContent
    $ChoosenButton = TrayItemGetText(@TRAY_ID)
    For $AppID = 1 To $ApplicationCount; Loops until desired application is found
        $SectionContent = IniReadSection($INI_File,"App" & $AppID )
        If $SectionContent[1][1] = $ChoosenButton Then; Application section has been found (Name of the control = Name value in the ini file)
            Run ($SectionContent[3][1] & $SectionContent[4][1]); Runs the application
            Return; and returns
        EndIf
    Next
EndFunc

Func Quit () ; **** THIS FUNCTION WAS ADDED BY FREERIDER AND MODIFIED BY PLAYZONEUK TO CLOSE APPLICATIONS ON EXIT
    Local $Question = MsgBox(4,"Question", "Warning if you exit, the launcher will close" & @CRLF & "all applications launched by this facility." & @CRLF & @CRLF & "Do you want to proceed?")
    If $Question = 7 Then Return
    For $AppID = 1 To $ApplicationCount; Loops until desired application is found
        Local $Process = IniRead($INI_File,"App" & $AppID,"Executable", "Not Found")
        ProcessClose($Process)
    Next
    _TrayIconDelete($nTrayIcon1)
    Exit
EndFunc

Func Settings () 
    MsgBox(4096, "Settings", "Settings GUI goes here.")
    Return
EndFunc

While 1  ; Main script loop 
    Sleep (250)
WEnd

_TrayIconDelete($nTrayIcon1)
Exit
Edited by PlayZoneUK

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

Link to comment
Share on other sites

Hi PlayZoneUK

At the moment... No Idea. Even with the sampes included in the topic "http://www.autoitscript.com/forum/index.php?showtopic=20967" It's not working and

I don't have time now to go forward with that.

As I'm interested in, I'll check that later and let you know what's the result.

FreeRiderHonour & Fidelity

Link to comment
Share on other sites

Hi FreeRider,

Thanks for your assistance with this... I appreciate you taking the time to look into this for me.

I'll keep looking / experimenting as well and I'll let you know if I come across anything.

Thanks again.

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

Link to comment
Share on other sites

Hi PlayZoneUK

It appears that.... the custom tray with icons do not use standard trayfunctions...

In the ModernMenuRaw.au3 file the equivalent function to "TrayItemGetText" is missing. As Tray Item was not created using standard function (TrayCreateItem)

the TrayItemGetText(@TRAY_ID) cannot work...

I'm still investigating...

Bye

EDIT N°1 **** Problem fixed..."TrayItemGetText" found !!! *****

Use Function _GetMenuText($nMenuItemID) which is included in the ModernMenuRaw.au3. When calling the function the "$nMenuItemID" is @GUI_CtrlID

therefore syntax is $Text = _GetMenuText(@GUI_CtrlID).

Don't forget to put Opt("GUIOnEventMode", 1) in the script, otherwise it will not work.

I'll update Holger's item (as you also ask for the same question...)

Ciao

Edited by FreeRider

FreeRiderHonour & Fidelity

Link to comment
Share on other sites

  • 2 months later...

Hi FreeRider,

Soz haven't been around much... just wanted to say thank you for you assistance with this matter

Words of Wisdom and Favourite Quotes:

'Nothing is impossible, despite what other people say and think, prove them wrong and show them what you can do!'

'Understanding is a three edged sword, your side, their side and the truth!'

'The truth that humanity has never been able to grasp, is that death may be the only absolute freedom there is!'

'I've run out of places to put the brush... what do you suggest?'

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...