Jump to content
Sign in to follow this  
Pollo

Select right windows ?

Recommended Posts

Pollo

Hi, im new to the forum and to Autoit..

Im making a little tool to press a few keys in a game "Flyff" to auto buff myself..

I'm usually playing with 2 instance of the game.. and i wanted to make the tool to select the right game windows.. it is possible to do it via PID ?

i just started to make the tool but i got stuck and tried searching but couldn't get the answer.

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
$Main_FMR = GUICreate("iFBuffer", 342, 185, 196, 135)
GUISetBkColor(0xFFFFFF)
$Tabs = GUICtrlCreateTab(0, 0, 361, 185, $TCS_FIXEDWIDTH)
$TabSheet1 = GUICtrlCreateTabItem("Config")
$ShowWind = GUICtrlCreateButton("Show Window", 245, 33, 91, 21, $BS_FLAT)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Label1 = GUICtrlCreateLabel("FlyFF ID:", 7, 36, 55, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Combo1 = GUICtrlCreateCombo("", 60, 33, 89, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE,$CBS_OEMCONVERT,$CBS_SORT))
GUICtrlSetBkColor(-1, 0xFFFFFF)
$RefreshList = GUICtrlCreateButton("Refresh List", 156, 33, 83, 21, $BS_FLAT)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Graphic1 = GUICtrlCreateGraphic(3, 28, 337, 31, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME))
GUICtrlSetBkColor(-1, 0xABABAB)
$TabSheet2 = GUICtrlCreateTabItem("About")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $RefreshList
            $list = ProcessList("Neuz.exe")
            for $i = 1 to $list[0][0]
            GUICtrlSetData($Combo1, "")
            GUICtrlSetData($Combo1, "FlyFF (" & $list[$i][1] & ")")
        next
        Case $ShowWind
            WinActivate(GUICtrlGetHandle($Combo1) , "")
    EndSwitch
WEnd

When i have the 2 game windows and i press refresh list button it shoes in the Combo1 FlyFF (PID) for both games, but how can i handle the game window by selecting it on the Combo1 ?

What im trying to do so far its like WinActive the selected item on the Combo1 but i cant... any help ?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.