Bishop12 Posted November 20, 2019 Share Posted November 20, 2019 (edited) #Include <GUIConstants.au3> ; #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #Region ### START Koda GUI section ### $Form1_1 = GUICreate("Form1", 457, 134, 192, 124) Global $list = GUICtrlCreateCombo("", 16, 72, 89, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlCreateGroup("", -99, -99, 1, 1) $_AutoFill = GUICtrlCreateButton("Autofill", 16, 8, 75, 25) GUICtrlDelete($list) ;Recreates the list to $list = GUICtrlCreateCombo("", 16, 72, 89, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) Global $Processes = WinList() For $i = 1 To $Processes[0][0] GUICtrlSetData($list,$Processes[$i][0]) Next GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $_AutoFill Global $array = _ArrayDisplay($Processes) ;;;WinActivate($list) <<-- The Problem was here EndSwitch WEnd cause i want to add Winactivate to that Array Display Row 1 or 2 or 3 i want to activate them if i need to call that client but the problem is i dont know how can i proper call the Row 1 or 2 or 3 or Col 1 or 2 or 3 in proper function im newbie on autoit can any one give me some example or solution for this please i already search on site its been 15hours since im searching and i dont have sleep yet i wish some one can help me Thanks in advance guys Edited November 20, 2019 by Bishop12 Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 20, 2019 Share Posted November 20, 2019 @Bishop12 WinList() returns a 2-dimension array that lets you access the elements in this way: $arrArray[$intRow][$intColumn] To have access to the first element of the array which contains a title/handle of a window, you have to start from index 1, sine the 0th index (for both row and column) is reserved to handle the number of windows found. So, if you want to use WinActivate() for a specific window, use an InputBox to let the user choose which window wants to activate, and then use the WinActivate() function with the proper syntax explained just above Bishop12 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Bishop12 Posted November 20, 2019 Author Share Posted November 20, 2019 1 minute ago, FrancescoDiMuro said: @Bishop12 WinList() returns a 2-dimension array that lets you access the elements in this way: $arrArray[$intRow][$intColumn] To have access to the first element of the array which contains a title/handle of a window, you have to start from index 1, sine the 0th index (for both row and column) is reserved to handle the number of windows found. So, if you want to use WinActivate() for a specific window, use an InputBox to let the user choose which window wants to activate, and then use the WinActivate() function with the proper syntax explained just above Thankyou so much for help ill try it for a few mns ill just take a breakfast ill be back and if have problem ill ask again thankyou so much for fast respond sir sorry for little bit confused newbie only haha Link to comment Share on other sites More sharing options...
Nine Posted November 20, 2019 Share Posted November 20, 2019 (edited) There was a few other problems with your script. So instead of pointing each of them, I rewrote it for you to study it... Global $Form1_1 = GUICreate("Form1", 457, 134, 192, 124) Global $list = GUICtrlCreateCombo("", 16, 72, 89, 25) Global $_AutoFill = GUICtrlCreateButton("Autofill", 16, 8, 75, 25) Global $Processes = WinList() For $i = 1 To $Processes[0][0] If Not $Processes[$i][0] Then ContinueLoop GUICtrlSetData($list, $Processes[$i][0]) Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $_AutoFill $Processes = WinList() _ArrayDisplay($Processes) ;do some more things here... EndSwitch WEnd But the more important issue was that you were resetting the combo continually. ps. when you post script use this tool. Edited November 20, 2019 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Bishop12 Posted November 21, 2019 Author Share Posted November 21, 2019 19 hours ago, Nine said: There was a few other problems with your script. So instead of pointing each of them, I rewrote it for you to study it... Global $Form1_1 = GUICreate("Form1", 457, 134, 192, 124) Global $list = GUICtrlCreateCombo("", 16, 72, 89, 25) Global $_AutoFill = GUICtrlCreateButton("Autofill", 16, 8, 75, 25) Global $Processes = WinList() For $i = 1 To $Processes[0][0] If Not $Processes[$i][0] Then ContinueLoop GUICtrlSetData($list, $Processes[$i][0]) Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $_AutoFill $Processes = WinList() _ArrayDisplay($Processes) ;do some more things here... EndSwitch WEnd But the more important issue was that you were resetting the combo continually. ps. when you post script use this tool. Noted thankyou for helping guys ill check and test all later thankyou so much 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