Jump to content

ArrayDisplay


Bishop12
 Share

Recommended Posts

 

 

#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 by Bishop12
Link to comment
Share on other sites

@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 :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

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

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 by Nine
Link to comment
Share on other sites

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 :D 

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