Jump to content
Sign in to follow this  
caramen

Logic help -

Recommended Posts

Ok guys Hello, 

 

I made a simple tool that is registering all copy paste action from an user. 

 

I did option  tab (F1)

Hide tab  (F2)

Search tab (F3)

 

I tryed a bit to code my search tab but i cant figure out how to manage the index of my ListView with it.

Exept if i use regexpression ... 

But i whould like to not use it. Not becose i am afraid of it. It s becose i ll share this code. I want to keep things easy. 

 

This is what i tryed but it doesn't work. If you can point me to the right logic i whould appreciate. 

Case $Recherche
     Rechercher ()

Func Rechercher ()
   WinMove ("Caramen Copy Paste", "" , @DesktopWidth - 400 , 0 , 400 , 460 , 5 )
   GUICtrlSetState($Console, $GUI_SHOW)
   GUICtrlSetState($Edit, $GUI_SHOW)
   $KeyWord = InputBox("Recherche", "Quelle mot clef rechercher ?" )
   _GUICtrlListView_FindText ( $Console , $KeyWord  )
   _GUICtrlListView_EnsureVisible($Console, $KeyWord )
   _GUICtrlListView_EnsureVisible($Console, _GUICtrlListView_GetItemCount($Console)-1)
EndFunc ; Recherche

Or maybe i am wrong and it is working but i have to focus ?

 

Thx before.

Edited by caramen

My video tutorials : HERE ( 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

 

Share this post


Link to post
Share on other sites

I am sure i am not so far :P 

Func Rechercher ()
   WinMove ("Caramen Copy Paste", "" , @DesktopWidth - 400 , 0 , 400 , 460 , 5 )
   GUICtrlSetState($Console, $GUI_SHOW)
   GUICtrlSetState($Edit, $GUI_SHOW)
   $tInfo = DllStructCreate($LVFI_PARTIAL)
   $KeyWord = InputBox("Recherche", "Quelle mot clef rechercher ?" )
   _GUICtrlListView_FindText ( $Console , $KeyWord  )
   $ISearchThisIndex = _GUICtrlListView_FindItem ( $Console, -1 ,  $tInfo )
   _GUICtrlListView_EnsureVisible($Console, $ISearchThisIndex )
EndFunc ; Recherche

I am there ATM. 


My video tutorials : HERE ( 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

 

Share this post


Link to post
Share on other sites
Func Rechercher ()
   WinMove ("Caramen Copy Paste", "" , @DesktopWidth - 400 , 0 , 400 , 460 , 5 )
   GUICtrlSetState($Console, $GUI_SHOW)
   GUICtrlSetState($Edit, $GUI_SHOW)
   $tInfo = DllStructCreate($tagLVFINDINFO)
   DllStructSetData($tInfo, "Flags",  $LVFI_PARTIAL )
   $KeyWord = InputBox("Recherche", "Quelle mot clef rechercher ?" )
   $KeywordFinded = _GUICtrlListView_FindText ( $Console , $KeyWord  )
   $ISearchThisIndex = _GUICtrlListView_FindItem ( $Console, -1 , $tInfo , $KeywordFinded )
   MsgBox(0,"",""&$ISearchThisIndex)
   _GUICtrlListView_EnsureVisible($Console, $ISearchThisIndex  )
EndFunc ; Recherche

MsgBox = -1 :( 

Edited by caramen

My video tutorials : HERE ( 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

 

Share this post


Link to post
Share on other sites

Caramen try this sample !! 

Func Rechercher ()
   WinMove ("Caramen Copy Paste", "" , @DesktopWidth - 400 , 0 , 400 , 460 , 5 )
   GUICtrlSetState($Console, $GUI_SHOW)
   GUICtrlSetState($Edit, $GUI_SHOW)
   $tInfo = DllStructCreate($tagLVFINDINFO)
   DllStructSetData($tInfo, "Flags",  $LVFI_PARTIAL )
   $KeyWord = InputBox("Recherche", "Quelle mot clef rechercher ?" )
   $KeywordFinded = _GUICtrlListView_FindText ( $Console , $KeyWord  )
   $ISearchThisIndex = _GUICtrlListView_FindInText ( $Console , $KeyWord ,  -1 )
   MsgBox(0,"",""&$ISearchThisIndex)
   _GUICtrlListView_EnsureVisible($Console, $ISearchThisIndex  )
EndFunc ; Recherche

Thank you Caramen it is working :D .


My video tutorials : HERE ( 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

 

Share this post


Link to post
Share on other sites

I had also big trooble with highlighting. I did that it work very good :

Func Rechercher ()
   WinMove ("Caramen Copy Paste", "" , @DesktopWidth - 400 , 0 , 400 , 460 , 5 )
   GUICtrlSetState($Console, $GUI_SHOW)
   GUICtrlSetState($Edit, $GUI_SHOW)
   $tInfo = DllStructCreate($tagLVFINDINFO)
   DllStructSetData($tInfo, "Flags",  $LVFI_PARTIAL )
   $KeyWord = InputBox("Recherche", "Quelle mot clef rechercher ?" )
   $KeywordFinded = _GUICtrlListView_FindText ( $Console , $KeyWord  )
   $ISearchThisIndex = _GUICtrlListView_FindInText ( $Console , $KeyWord ,  -1 )
   $MyControl = _GUICtrlListView_EnsureVisible($Console, $ISearchThisIndex  )
   $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam)
   _GUICtrlListView_SetItemDropHilited($Console, $ISearchThisIndex , True)
   Sleep (100)
   _GUICtrlListView_SetItemDropHilited($Console, $ISearchThisIndex , False)
   Sleep (200)
   _GUICtrlListView_SetItemDropHilited($Console, $ISearchThisIndex , True)
   Sleep (300)
   _GUICtrlListView_SetItemDropHilited($Console, $ISearchThisIndex , False)
   Sleep (400)
   _GUICtrlListView_SetItemDropHilited($Console, $ISearchThisIndex , True)
   Sleep (500)
   _GUICtrlListView_SetItemDropHilited($Console, $ISearchThisIndex , False)
   Sleep (600)
   _GUICtrlListView_SetItemDropHilited($Console, $ISearchThisIndex , True)
   Sleep (700)
   _GUICtrlListView_SetItemDropHilited($Console, $ISearchThisIndex , False)
   Sleep (800)
EndFunc ; Recherche

 


My video tutorials : HERE ( 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

 

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...