BigDaddyO Posted August 13, 2018 Posted August 13, 2018 I'm using opt("GUIOnEventMode", 1) in my script. I've got 600 items in a ListView and each item has a ContextMenu created for it that all point to a _Connect() function. When executing the _Connect() function, how can I Figure out what ListView item was Right Clicked on since I need the text from that to connect with? Thanks
BrewManNH Posted August 13, 2018 Posted August 13, 2018 Use _GUICtrlListView_GetSelectedIndices to find out which Listview item is selected/highlighted. 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 GudeHow 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
FrancescoDiMuro Posted August 13, 2018 Posted August 13, 2018 @BigDaddyO You could do it via WM_NOTIFY Message too Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
BrewManNH Posted August 13, 2018 Posted August 13, 2018 1 hour ago, FrancescoDiMuro said: You could do it via WM_NOTIFY Message too He needs the information from a context menu click. 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 GudeHow 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
FrancescoDiMuro Posted August 13, 2018 Posted August 13, 2018 1 hour ago, BrewManNH said: He needs the information from a context menu click. It depends from what and how he is doing his things. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
BrewManNH Posted August 14, 2018 Posted August 14, 2018 I'll repeat it, because you didn't seem to understand what I said. He needs to get it (the selected item in the listview) after clicking a context menu linked to the ListView item. What I suggested to him is the most straightforward way of getting the information he needs in the way he's doing it. You CAN do it with a windows message handler, but there's more work to do to get it that way, and it's inefficient and more difficult for new users. 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 GudeHow 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
FrancescoDiMuro Posted August 14, 2018 Posted August 14, 2018 4 hours ago, BrewManNH said: I'll repeat it, because you didn't seem to understand what I said. Don't be so rude, honey I was simply saying that you can do it in another way, different from the one you did suggest. By the way, the OP is happy, you coded for him as you always do, so, everyone's happy Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now