Jump to content
Sign in to follow this  
dmorand

How to determine which ListView I've selected?

Recommended Posts

dmorand

I'm trying to determine which listview I'm in when I click on the launch_app_btn because based on what listview I'm in I'll need to call a different function. I can't seem to figure out how to determine which one I've clicked on. Any help would be appreciated.

Here is a code snippet:

$launch_app_btn = GUICtrlCreateButton("Launch Application", ((725/2)-55),435,110,30)

$app_group = GUICtrlCreateGroup("Stand Alone Applications", 4, 8, 705, 122)
$appList= GUICtrlCreateListView("Application|Version|Location", 8, 22, 694, 100,$LVS_SORTASCENDING + $LVS_EX_CHECKBOXES)
GUICtrlSendMsg($appList, $LVM_SETCOLUMNWIDTH, 0, 200)
GUICtrlSendMsg($appList, $LVM_SETCOLUMNWIDTH, 2, 400)
createListView($iniFile,$ini,$appList,"application")

$web_group = GUICtrlCreateGroup("Web Applications", 4, 138, 705, 160)
$webList= GUICtrlCreateListView("Application|Version|Address", 8, 152, 694, 138,$LVS_SORTASCENDING)
GUICtrlSendMsg($webList, $LVM_SETCOLUMNWIDTH, 0, 200)
GUICtrlSendMsg($webList, $LVM_SETCOLUMNWIDTH, 2, 400)
createListView($iniFile,$ini,$webList,"web")

$support_group = GUICtrlCreateGroup("Support Sites", 4, 308, 705, 122)
$suppList= GUICtrlCreateListView("Application|Version|Address", 8, 322, 694, 100,$LVS_SORTASCENDING)
GUICtrlSendMsg($suppList, $LVM_SETCOLUMNWIDTH, 0, 200)
GUICtrlSendMsg($suppList, $LVM_SETCOLUMNWIDTH, 2, 400)
createListView($iniFile,$ini,$suppList,"support")

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $QuitItem
            Exit
        Case $BagelItem
            Run('notepad \\isops\analysts\_Application_Launcher\bagel_list_v2.txt');
        Case $ReleaseItem
            Run('notepad \\ISOPS\Analysts\_Application_Launcher\Application_Launcher_help.txt');
        Case $AboutItem 
        Case $launch_app_btn
            _GetApplication()
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
FireFox

@dmorand

GuiCtrlRead(GuiCtrlRead($applist))

@GUICtrl_ID

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
dmorand

@dmorand

GuiCtrlRead(GuiCtrlRead($applist))

@GUICtrl_ID

Cheers, FireFox.

The problem I'm having is that I've got 3 the listviews but it's not taking into account what is the current listviewitem I've selected.

$selApp = GuiCtrlRead($applist)
$selWeb = GuiCtrlRead($weblist)
$selSupp = GuiCtrlRead($supplist)

Example:

I click on an item in $appList, and when I call GuiCtrlRead($appList) I get the element number of the item I selected. If I then click on an item in $webList, but call GuiCtrlRead($appList) I still get a value.

Edited by dmorand

Share this post


Link to post
Share on other sites
FireFox

:) ...read my reply its not GuiCtrlRead($applist) but GuiCtrlRead(GuiCtrlRead($applist))

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
dmorand

:) ...read my reply its not GuiCtrlRead($applist) but GuiCtrlRead(GuiCtrlRead($applist))

Cheers, FireFox.

I read your reply, but when I click on an item in a different list, I'm still getting a value returned from the GuiCtrlRead(GuiCtrlRead($applist)). It's like it keeps track of the item I clicked on in that list, or any list. Is there a way to clear out the item selected from the list?

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  

×