I have a GUI that records the list of all the CMs in a folder. When the 'run' button is clicked, it will open the first CHM in the list. Then I have created a function that should extend the tree.
My problem is my job, it works up to And here's my function: Many problems with the code. But the real problem with your code is that you are setting the code Such a question has not been encouraged on the stack overflow, we get queries that will be useful for others in the future, rather than helping with a specific code. Before asking such questions in the future, please try and debug the problem yourself, you can add the MsgBox () and stops there. When I run my program, the signal is not given.
#include & lt; GuiConstantsEx.au3 & gt; # Include & lt; GuiListBox.au3 & gt; # Include & lt; GuiTreeView.au3 & gt; # Include & lt; File.au3 & gt; # Include & lt; Array.au3 & gt; ; GUI $ guiTitle = "Automation" GUICreate ($ guiTitle, 250, 430) Global $ hWnd = ControlGetHandle ("[Class: HH Generator; Title: AutoIt Help]", "", "[Class: SysTreeView32, Example: 1]" Enter global $ hChild = _GUICtrlTreeView_GetFirstChild ($ hWnd, 0) local $ source = InputBox ("source folder", "source folder", ""), InputBox then @error = 1 then exitif then @error = 4 then Exit; GUI_List or $ add = GUICtrlCreateButton ("show", 10, 53, 230, 20) $ picList = GUICtrlCreateList ("", 10, 78, 230, 300) $ run = GUICtrlCreateButton ("run", 170, 385, 70, 30) GUISetState (@SW_SHOW) while $ 1 msg = GUIGetMsg () Switch to msg; Enter $$ Global $ file list = _FileListToArray ($ source, "* .chm") If @error = 1 then exit MsgBox (0, "", "no files were found.") If the endfinder @ferror = 4 then MSBBC (0, "", "no file was found.") Exit the INIF $ i = 1 $ file list for [0]; List_FIX image GUICtrlSetData ($ PicList, $ filelist [$ i]) Next; Run Case $ Run if the _GUICtrlListBox_GetCount ($ picList) = 0 then MsgBox (0, "", "no files were found.") Otherwise $ i = 1 to $ file list [0] If not WinExists ("AutoIT Help") Then ShellExecute ($ Source & amp; "\" & Amp; $ FileList [1]) _Expand ($ hWnd, $ hChild) endif Next Endif; Exit Case $ GUI_EVENT_CLOSE ExitLoop EndSwitch going endif
function _Expand ($ hWnd, $ hChild) WinWaitActive ("AutoIt help If the _GUICtrlTreeView_GetText ($ hWnd, $ hChild) = "Tutorials" then exit ExitLoop _GUICtrlTreeView_Expand (ControlGetHandle ("[Class]"), while MsgBox (0, "", "Extension"), while 1 $ hChild = _GUICtrlTreeView_GetNextChild ($ hWnd, $ hChild) : HH Generator; Title: AutoIt Help] "," "," [Class: SysTreeView32, Example: 1] "), $ hchild, True) EndFunc
_GUICtrlTreeView_GetNextChild .
$ hWnd and
$ h child As a result, the window is not found before running the window-making process, and when you call
_Expand then $ HWND will always be taped.
ConsoleWrite statement through the shown value of variable value, which shows you that when you expand , Then there is no handle value of
$ hWnd , from there it is clear
No comments:
Post a Comment