ricky Posted June 2, 2015 Share Posted June 2, 2015 (edited) Hello,I'm using the script : https://www.autoitscript.com/forum/topic/131052-sysinfolog-v211/?page=1How can I add a search case in the SysInfoLogViewer? I want to search a text and highlight the line in yellow for example.I try to find someting in the forum, but impossible.Thanks for your help. Edited June 2, 2015 by ricky03 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 2, 2015 Moderators Share Posted June 2, 2015 ricky03,A quick look at the Help file (did you do that before posting?) shows that _GUICtrlListView_FindText/FindInText are likely candidates for your search code.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ricky Posted June 2, 2015 Author Share Posted June 2, 2015 Thanks, I take a look in the help but not correctly, sorry.Maybe I will have more questions and keep this topic to do it. Link to comment Share on other sites More sharing options...
ricky Posted June 2, 2015 Author Share Posted June 2, 2015 It exists something like _WinAPI_FindTextDlg to the ListView? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 2, 2015 Moderators Share Posted June 2, 2015 ricky03,Not as far as I know.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 2, 2015 Moderators Share Posted June 2, 2015 ricky03,It does not seem too difficult to get the search working:expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiListView.au3> $sText = "Text to match" $hGUI = GUICreate("Test", 500, 500) $cLV= GUICtrlCreateListView("Items in ListView", 10, 10, 480, 300) For $i = 0 To 99 If Mod($i, 10) Then GUICtrlCreateListViewItem("Item " & $i, $cLV) Else GUICtrlCreateListViewItem($sText, $cLV) EndIf Next $cInput = GUICtrlCreateInput($sText, 10, 350, 400, 20) $cFind = GUICtrlCreateButton("Find", 10, 400, 80, 30) GUISetState() $iIndex = -1 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cFind $iIndex = _GUICtrlListView_FindText($cLV, $sText, $iIndex, True, True) _GUICtrlListView_ClickItem($cLV, $iIndex) EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ricky Posted June 3, 2015 Author Share Posted June 3, 2015 Hello,thanks for your help.Before your post I tried with a code and it doesn't work. I try with your's and the problem is the same. Could you help me? Maybe I made a mistake.Please find below the viewer from sysinfolog modified and a log to analyse : SysInfoLog_06-04-2015_031159.log _SysInfoLogViewer_v2.11.au3Thanks for your help Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 3, 2015 Moderators Share Posted June 3, 2015 ricky03,Firstly, the script uses OnEvent mode and so adding a GUIGetMsg inside the idle loop serves no purpose at all.Secondly, you need to use the ListView ControlID as the first parameter of the _GUICtrlListView_FindText function call - you were using some other value.Changing the code as seen in this modified section works fine for meLocal $ID_GUI = GUICreate($strTitle, 900, 500, -1, -1, 0x00CF0000) Local $LabelSearch = GUICtrlCreateLabel("Enter the text to find in this log:", 10, 10, 150, 20, 0) Local $TextFind = GUICtrlCreateInput("Text to find", 170, 10, 240, 20) Local $ButtonSearch = GUICtrlCreateButton("&Search", 420, 10, 80, 20) GUICtrlSetOnEvent($ButtonSearch, "_Search") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Local $nMsg, $sText = "" Local $ID_PRB = GUICtrlCreateProgress(10, 10, 200, 10, 1) GUICtrlSetBkColor($ID_PRB, 0xFFFFFF) GUISetOnEvent(-3, '_AllExit') GUISetOnEvent(-5, 'SIL_AutoSizeGUI') GUISetOnEvent(-6, 'SIL_AutoSizeGUI') GUISetOnEvent(-12, 'SIL_AutoSizeGUI') Opt('GUIOnEventMode', 1) GUISetState(@SW_SHOW, $ID_GUI) GUIRegisterMsg(0x0024, '_WM_GETMINMAXINFO') ; _LvScreen() Global $init = -1 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; While 1 Sleep(10) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< WEnd Func _Search() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $sText = GUICtrlRead($TextFind) $init = _GUICtrlListView_FindText($ID_LV, $sText, $init, True, False) _GUICtrlListView_ClickItem($ID_LV, $init) EndFuncHow about for you?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ricky Posted June 3, 2015 Author Share Posted June 3, 2015 Thanks it works better, but it search only in the first coloumn, why? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 3, 2015 Moderators Share Posted June 3, 2015 ricky03,There is a wonderful Help file provided with AutoIt - go and read the page for _GUICtrlListView_FindText and you will get the answer (to which incidentally I gave you a very good hint in the first post I made in this thread).M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ricky Posted June 4, 2015 Author Share Posted June 4, 2015 Now it works, thansk for your help.Func _Search() ; #include <ColorConstants.au3> Local $COLOR_BLACK = 0x000000 Local $COLOR_RED = 0xFF0000 GUICtrlSetColor($TextFind, $COLOR_BLACK) Local $sText = GUICtrlRead($TextFind) $SearchInit = _GUICtrlListView_FindInText($ID_LV, $sText, $SearchInit) If $SearchInit = -1 Then GUICtrlSetColor($TextFind, $COLOR_RED) Else _GUICtrlListView_ClickItem($ID_LV, $SearchInit) EndIf EndFunc ;==>_SearchNow I manage if nothing is found, but how to focus on the first line if nothing is found?I tried with the code below, but of course the line is highlighted and selected._GUICtrlListView_ClickItem($ID_LV, 0)If nothing found, the text in the iput is red, but how to change the color if we write a new entrie in the input? I try with GUICtrlSetOnEvent with the input, but it doesn't work!Who can help me?Thanks in advance Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 4, 2015 Moderators Share Posted June 4, 2015 ricky03,Change this section:Opt('GUIOnEventMode', 1) GUISetState(@SW_SHOW, $ID_GUI) GUIRegisterMsg($WM_GETMINMAXINFO, '_WM_GETMINMAXINFO') GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; _LvScreen() Global $init = -1 ; While 1 Sleep(10) WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) ; If something has changed in the input If BitAND($wParam, 0xFFFF) = $TextFind And BitShift($wParam, 16) = $EN_CHANGE Then ; Set colour to black GUICtrlSetColor($TextFind, $COLOR_BLACK) EndIf EndFunc ;==>_WM_COMMAND ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Func _Search() $sText = GUICtrlRead($TextFind) $init = _GUICtrlListView_FindInText($ID_LV, $sText, $init, False, False) If $init = -1 Then ; Set colour to red GUICtrlSetColor($TextFind, $COLOR_RED) ; Ensure top item_is visible _GUICtrlListView_EnsureVisible($ID_LV, 0) Else _GUICtrlListView_ClickItem($ID_LV, $init) EndIf EndFuncPlease ask if you have any questions.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ricky Posted June 4, 2015 Author Share Posted June 4, 2015 (edited) This variable $EN_CHANGE not declared, what is this?Where can I found a help about your function WM_COMMAND? I don't understand the If tests. Edited June 4, 2015 by ricky03 Link to comment Share on other sites More sharing options...
l3ill Posted June 4, 2015 Share Posted June 4, 2015 (edited) Allow me to introduce...Helpfile, Search Button, This is Ricky03.Ricky03, this is the Search Button and Helpfile."Pleased to meet you Ricky03" Edited June 4, 2015 by l3ill msp My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 4, 2015 Moderators Share Posted June 4, 2015 (edited) ricky03,As l3ill has pointed out, the Help file does exist and is very comprehensive. But to answer these particular questions:- You need to include EditConstants.au3, my error for not making that clear.- I suggest reading the GUIRegisterMsg tutorial in the Wiki to get a basic understanding of Windows messaging.M23 Edited June 4, 2015 by Melba23 Wrong button, too soon Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ricky Posted June 4, 2015 Author Share Posted June 4, 2015 Thanks for the help and for the links, Noe it works Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 4, 2015 Moderators Share Posted June 4, 2015 ricky03,Delighted to hear it. Did you find the tutorial easy to follow?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ricky Posted June 4, 2015 Author Share Posted June 4, 2015 Yes and no. English is not my native language, I need to take time and actually i'm so tired to read it correctly today.I will give you a feedback ASAP. Link to comment Share on other sites More sharing options...
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