n3wbie

Help With Clickable icon(not defined)(variable from file)

1 post in this topic

#1 ·  Posted (edited)

Hey Guys Does Anybody has any idea about creating clickable icon with random command or along with parameters while we click

What I want to achieve:Trying to create dashboard for all my apps but they should load from ini file

what have i done until yet:Created gui and some code posted below and ini file

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1021, 548, 366, 137)
$Group1 = GUICtrlCreateGroup("Group1", 16, 32, 729, 489, -1, $WS_EX_TRANSPARENT)
$Tab1 = GUICtrlCreateTab(24, 56, 713, 449)

sheetsload()
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Group2", 760, 32, 249, 489)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Func sheetsload()
    Local $tabnames = IniRead(@ScriptDir & "/setting.ini", "Tabs", "Name", "")
    $names = StringSplit($tabnames, ",")
    For $i=1 to $names[0]
        GUICtrlCreateTabItem($names[$i])
        Local $icons = IniRead(@ScriptDir & "/setting.ini", $names[$i], "icon", "")
        $icons=StringSplit($icons,",")
        Local $exe = IniRead(@ScriptDir & "/setting.ini", $names[$i], "exe", "")
        $Exe=StringSplit($exe,",")
        Local $name = IniRead(@ScriptDir & "/setting.ini", $names[$i], "name", "")
        $name=StringSplit($name,",")
        for $o=1 to $icons[0]
            $start_position=96*($o-1)+40
;~          $vert_startpos=Ceiling ($o/7)*100
            $Icon1 = GUICtrlCreateIcon($icons[$o], -1, $start_position, $vert_startpos, 80, 80)

            ConsoleWrite("data")
            GUICtrlSetTip(-1, $name[$o])
            $Label1 = GUICtrlCreateLabel($name[$o], $start_position, 184, 80, 20)
        Next
    Next
EndFunc   ;==>sheetsload

Ini File

[Tabs]
Name=Automation,Automation1
[Automation1]
icon=path to icon
exe=path to exe
name=alpha
[Automation1]
icon=path to icon
exe=path to exe
name=alpha

Now i want to open exe file as specified in ini file

 

While Searcing for solution i got it to create button with image 

thats okay but how to do for different exe

i mean how to send some handle for different icons

i dont want to hardcode in exe anything

GUICtrlSetOnEvent(-1, "icon_click1")

i need something like GUICtrlSetOnEvent(-1, "Icon1Click("Some handle to pass here to let function know what exe to trigger")")

if anybody has any idea please let me know

Thanks In Advance

Edited by n3wbie

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