Jump to content

_GUICtrlListBox_FindString


 Share

Recommended Posts

#include <Array.au3>
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <MsgBoxConstants.au3>


Local $ttlWindow = "DSD Window UserInterface (Ver 1.16.1) - ntmmm"
Local $cidList = "[CLASS:ListBox; INSTANCE:1]"
Local $hsfserver = "LSD_6_INCH"

WinActivate("DSD Window UserInterface (Ver 1.16.1) - ntmmm")

WinMove ( $ttlWindow , "" , 0, 0 ) 

;Test 1

MsgBox($MB_SYSTEMMODAL, "", ControlListView ( $ttlWindow , "", $cidList , "GetText", 3, 0))
MsgBox($MB_SYSTEMMODAL, "", ControlListView ( $ttlWindow , "", $cidList , "FindItem", "LSD_6_INCH", 1))
MsgBox($MB_SYSTEMMODAL, "", ControlListView ( $ttlWindow , "", $cidList , "GetSelected", 1))

;Test 2

MsgBox($MB_SYSTEMMODAL, "", ControlListView ( $ttlWindow , "", $control_hd , "GetText", 3, 0))
MsgBox($MB_SYSTEMMODAL, "", ControlListView ( $ttlWindow , "", $control_hd , "FindItem", "LSD_6_INCH", 1))
MsgBox($MB_SYSTEMMODAL, "", ControlListView ( $ttlWindow , "", $control_hd , "GetSelected", 1))

What are the msg box result ?

 

To be sure you got control on the wanted control. You can try that : 

ControlListView ( $ttlWindow , "", $cidList , "SelectAll" )
ControlListView ( $ttlWindow , "", $control_hd , "SelectAll" )

If it s not selected at all you got an handle problem.

If you got a way for us to execut that list... 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

This is a ListBOX that the user is  trying to interact with ListVIEW functions won't work with it. It's a multicolumn listbox, not a listview.

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

Link to comment
Share on other sites

4 minutes ago, BrewManNH said:

This is a ListBOX that the user is  trying to interact with ListVIEW functions won't work with it. It's a multicolumn listbox, not a listview.

So i guess it is normal if it s not working :D 

Tryed to help him debug something that will never work :P ( not on purpose ofc btw ) 

 

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

I give it an other try... if @FrancescoDiMuro suggestion does not help you... 

 

Does this selecting the wanted control ??? 

 

#include <Array.au3>
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>


Local $ttlWindow = "DSD Window UserInterface (Ver 1.16.1) - ntmmm"
Local $cidList = "[CLASS:ListBox; INSTANCE:1]"
Local $hsfserver = "LSD_6_INCH"

WinActivate($ttlWindow)

_GUICtrlListBox_SelectString ( $ttlWindow , $hsfserver  )

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

9 minutes ago, caramen said:

I give it an other try... if @FrancescoDiMuro suggestion does not help you... 

 

Does this selecting the wanted control ??? 

 

#include <Array.au3>
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>


Local $ttlWindow = "DSD Window UserInterface (Ver 1.16.1) - ntmmm"
Local $cidList = "[CLASS:ListBox; INSTANCE:1]"
Local $hsfserver = "LSD_6_INCH"

WinActivate($ttlWindow)

_GUICtrlListBox_SelectString ( $ttlWindow , $hsfserver  )

 

@caramen

not working also....:sweating::sweating:

Link to comment
Share on other sites

So you cannot control that.

 

If you read Fracesco topic...

It is not possible.

 

You got a circumvention way by using the clip board.

 

Local $ttlWindow = "DSD Window UserInterface (Ver 1.16.1) - ntmmm"
Local $cidList = "[CLASS:ListBox; INSTANCE:1]"
Local $hsfserver = "LSD_6_INCH"


Local $control_hd = ControlGetHandle($ttlWindow,"","[CLASS:ListBox; INSTANCE:1]")


Local $num = _GUICtrlListBox_GetCount($control_hd)


; Here I select all the rows
_GUICtrlListBox_SelItemRangeEx($control_hd, 1, $num)

Try that, it should select all your items. Then you can Ctrl + C .

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

1 hour ago, Rammanan said:

i have try but i don't understand how to copy to clipboard.

Show us... 

 

$MyClipData = ClipGet ()

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

@caramen

Below are the code i try but always get NO File Found.:think:

Local $ttlWindow = "DSD Window UserInterface (Ver 1.16.1) - ntmmm"
Local $cidList = "[CLASS:ListBox; INSTANCE:1]"
Local $hsfserver = "LSD_6_INCH"

WinActivate("DSD Window UserInterface (Ver 1.16.1) - ntmmm")
WinWaitActive("DSD Window UserInterface (Ver 1.16.1) - ntmmm")
$hdlWindow = WinGetHandle($ttlWindow)
Local $control_hd = ControlGetHandle($hdlWindow, "", "[CLASS:ListBox; INSTANCE:1]")
Local $num = _GUICtrlListBox_GetCount($control_hd)

_GUICtrlListBox_SelItemRangeEx($control_hd, 1, $num)
$MyClipData = ClipGet()
 MsgBox($MB_SYSTEMMODAL, "", "The following data is now stored in the clipboard: " & @CRLF & $MyClipData)
 If StringInStr($MyClipData, "LSD_6_INCH") > 0 Then
  MsgBox(32,'',"File found")
Else
  MsgBox(32,'',"No File found")
EndIf

 

Edited by Rammanan
Link to comment
Share on other sites

Does the code i gave you is corectly selecting items ? 

Can you copy manualy then past ? 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

If it's manualy not working. 

It wont work with autoIT. 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Guys i am helping him in PM i asked him if he want. 

 

We did a couple of test more. 

Think i got it. All row are accessible but guess they are translated from japanes or somthing. ::::::::::

 

Ok let's try more : 

$MyWantedText1 = _GUICtrlListBox_GetText($Handle, 1 )
MsgBox (0 , "" , $MyWantedText1 )
$MyWantedText2 = _GUICtrlListBox_GetText($Handle, 2 )
MsgBox (0 , "" , $MyWantedText2 )
$MyWantedText3 = _GUICtrlListBox_GetText($Handle, 3 )
MsgBox (0 , "" , $MyWantedText3 )
$MyWantedText4 = _GUICtrlListBox_GetText($Handle, 4 )
MsgBox (0 , "" , $MyWantedText4 )
$MyWantedText5 = _GUICtrlListBox_GetText($Handle, 5 )
MsgBox (0 , "" , $MyWantedText5 )
$MyWantedText6 = _GUICtrlListBox_GetText($Handle, 6 )
MsgBox (0 , "" , $MyWantedText6 )

Send me results

still get same 

ScreenHunter_12 Oct. 30 20.06.gif

ScreenHunter_11 Oct. 30 20.06.gif

ScreenHunter_10 Oct. 30 20.06.gif

ScreenHunter_09 Oct. 30 20.06.gif

 

What do you think i am sure we can get that work for him. He got singular "issue" now. 

 

I dont even know how to try to translate this to be sure it is the good way of thinking. 

 

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

It is now an interesting challenge ^^ 

 

My solution whould be sooo weird xD

 

Export data into a text file. 

Translate everything with copy past from text file

Transforme data into readable Var

Manage that with Japanes characters. HMmmm Other ideas ?

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Im thinking encoding issue, but am not sure how it could be affecting this.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

The crazy thing is... It is accessing on data so we are not missing anything on the control BUT lol! , Each time i run a msg box on his comput the msgbox was sending us  a different return value. (Without changing code or acting on the soft ) 

 

I never seen that before... how it is possible ????

 

 

BTW he can read the EDIT control on the software so i helped him this way : 

 

We select the item one after one since getcount is working. 

With For Next or Do Until Or If EndIf He will choose the most appropriate with his needs. 

Reading EDIT control after each item selection And manage the script like this.

 

But i wonder what was the problem before. I whould like to know.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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