Jump to content

problem with autocomplete


Overlord
 Share

Recommended Posts

Hey guys, I'm having trouble with adding automplete to one of my 2 comboboxes.

I succesfully added autocomplete to the 2nd box but when I want to add it now to the 1st combobox, It's not working.

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=giftsender.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Run_Obfuscator=y
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.3.0.0
    Author:  myName
    
    Script Function:
    Template AutoIt script.
    
#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <GUIComboBox.au3>

$IDfile = IniRead("C:\giftsender.ini", "Userlist", "users", "")
$ALL_IDS = StringSplit($IDfile, "|", 1)

#Region ### START Koda GUI section ### Form=c:\program files\autoit3\scite\koda\templates\my own templates\giftsender.kxf
$Form1_1 = GUICreate("Giftsender V1.0", 332, 210, 256, 284)
GUISetBkColor(0xC0DCC0)

$ID = GUICtrlCreateCombo("", 128, 64, 177, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetData(-1, $IDfile, "")
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND_ID")

$Label1 = GUICtrlCreateLabel("GIFTSENDER", 97, 24, 102, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x0000FF)
$start = GUICtrlCreateButton("Send", 118, 160, 75, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x0000FF)
$Label2 = GUICtrlCreateLabel("Recipient :", 24, 64, 81, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x0000FF)

$combo = GUICtrlCreateCombo("", 128, 112, 177, 25)
GUICtrlSetData(-1, "---Street Thug Job Tier---|Eight of Diamonds|Nine of Diamonds|Ten of Diamonds|Jack of Diamonds|Queen of Diamonds|King of Diamonds|Ace of Diamonds|---Associate Job Tier---|Eight of Hearts|Nine of Hearts|Ten of Hearts|Jack of Hearts|Queen of Hearts|King of Hearts|Ace of Hearts|---Soldier Job Tier---|Rat Sculpture|Sheep Sculpture|Rooster Sculpture|Monkey Sculpture|Tiger Sculpture|Snake Sculpture|Dragon Sculpture|Eight of Clubs|Nine of Clubs|Ten of Clubs|Jack of Clubs|Queen of Clubs|King of Clubs|Ace of Clubs|White Poker Chip|Brown Poker Chip|Red Poker Chip|Blue Poker Chip|Green Poker Chip|Purple Poker Chip|Gold Poker Chip|---Enforcer Job Tier---|Ebony Cigar|Sky Cigar|Rose Cigar|Ivory Cigar|Turquoise Cigar|Gold Cigar|Royal Cigar|Eight of Spades|Nine of Spades|Ten of Spades|Jack of Spades|Queen of Spades|King of Spades|Ace of Spades|---Hitman Job Tier---|Topaz Ring|Opal Ring|Amethyst Ring|Emerald Ring|Sapphire Ring|Ruby Ring|Diamond Ring|Solid Tie|Striped Tie|Checked Tie|Geometric Tie|Dot Tie|Paisley Tie|Knitted Tie|---Capo Job Tier---|Warhol Painting|Cezanne Painting|Matisse Painting|Van Gogh Painting|Dali Painting|Monet Painting|Rembrandt Painting|Silver Cufflinks|Gold Cufflinks|Amber Cufflinks|Jasper Cufflinks|Agate Cufflinks|Onyx Cufflinks|Pearl Cufflinks|---Consigliere Job Tier---|Mill Reef|Sea Bird|Arkle|Golden Miller|St Simon|Ormonde|Eclipse")
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND_Combo")

$Label3 = GUICtrlCreateLabel("Item:", 64, 112, 45, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x0000FF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $start
            Go()
            $IDfile = IniRead("C:\giftsender.ini", "Userlist", "users", "")
            $ALL_IDS = StringSplit($IDfile, "|", 1)
            GUICtrlSetData($ID, "", "")
            GUICtrlSetData($ID, $IDfile, "")
        ;           sendgift()
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func Go()
    For $i = 1 To $ALL_IDS[0]
        If $ALL_IDS[0] Then
        ;MsgBox(0, "Info", "String(GUICtrlRead($combo)) = " & String(GUICtrlRead($combo)) & @CR & "$ALL_IDS[$i] = " & $ALL_IDS[$i] )
            If $ALL_IDS[$i] == String(GUICtrlRead($combo)) Then
            ;Input is already a part of the list, do not add it
            ;MsgBox(0, "Info", "This entry is a duplicate")
                Return 0
            EndIf
        EndIf
    Next

    If GUICtrlRead($ID) Then
        $IDfile &= "|" & GUICtrlRead($ID)
        IniWrite("C:\giftsender.ini", "Userlist", "users", $IDfile)
    EndIf
EndFunc  ;==>Go

Func sendgift()
    ConsoleWrite(GUICtrlRead($ID & @LF))
    ConsoleWrite(GUICtrlRead($combo & @LF))
    Select
        Case GUICtrlRead($combo) = "Topaz Ring"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "8" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Opal Ring"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "9" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Amethyst Ring"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "10" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Emerald Ring"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "11" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Sapphire Ring"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "12" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ruby Ring"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "13" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Diamond Ring"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "14" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Warhol Painting"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "15" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Cezanne Painting"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "16" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Matisse Painting"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "17" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Van Gogh Painting"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "18" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Dali Painting"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "19" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Monet Painting"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "20" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Rembrandt Painting"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "21" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Rat Sculpture"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "22" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Sheep Sculpture"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "23" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Rooster Sculpture"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "24" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Monkey Sculpture"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "25" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Tiger Sculpture"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "26" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Snake Sculpture"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "27" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Dragon Sculpture"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "28" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "White Poker Chip"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "29" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Brown Poker Chip"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "30" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Red Poker Chip"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "31" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Blue Poker Chip"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "32" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Green Poker Chip"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "33" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Purple Poker Chip"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "34" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Gold Poker Chip"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "35" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Eight of Diamonds"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "36" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Nine of Diamonds"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "37" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ten of Diamonds"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "38" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Jack of Diamonds"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "39" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Queen of Diamonds"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "40" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "King of Diamonds"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "41" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ace of Diamonds"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "42" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Eight of Hearts"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "43" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Nine of Hearts"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "44" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ten of Hearts"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "45" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Jack of Hearts"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "46" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Queen of Hearts"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "47" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "King of Hearts"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "48" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ace of Hearts"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "49" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Eight of Clubs"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "50" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Nine of Clubs"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "51" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ten of Clubs"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "52" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Jack of Clubs"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "53" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Queen of Clubs"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "54" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "King of Clubs"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "55" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ace of Clubs"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "56" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Eight of Spades"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "57" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Nine of Spades"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "58" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ten of Spades"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "59" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Jack of Spades"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "60" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Queen of Spades"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "61" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "King of Spades"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "62" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ace of Spades"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "63" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Solid Tie"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "64" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Striped Tie"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "65" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Checked Tie"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "66" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Geometric Tie"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "67" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Dot Tie"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "68" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Paisley Tie"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "69" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Knitted Tie"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "70" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Silver Cufflinks"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "71" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Gold Cufflinks"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "72" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Amber Cufflinks"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "73" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Jasper Cufflinks"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "74" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Agate Cufflinks"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "75" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Onyx Cufflinks"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "76" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Pearl Cufflinks"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "77" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Mill Reef"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "78" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Sea Bird"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "79" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Arkle"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "80" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Golden Miller"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "81" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "St Simon"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "82" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Ormonde"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "83" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
        Case GUICtrlRead($combo) = "Eclipse"
            $oIE = _IECreate("http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=gift&recipients[1]=" & GUICtrlRead($ID) & "&gift_id=" & "84" & "&xw_action=send"); sends the item to the recipient
            _IEQuit($oIE)
    EndSelect
EndFunc  ;==>sendgift

Func _Edit_Changed_ID()
    _GUICtrlComboBox_AutoComplete($ID)
EndFunc  ;==>_Edit_Changed_ID

Func _Edit_Changed_Combo()
    _GUICtrlComboBox_AutoComplete($combo)
EndFunc  ;==>_Edit_Changed_Combo


Func WM_COMMAND_ID($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg
    Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo
    If Not IsHWnd($ID) Then $hWndCombo = GUICtrlGetHandle($ID)
    $hWndFrom = $ilParam
    $iIDFrom = BitAND($iwParam, 0xFFFF); Low Word
    $iCode = BitShift($iwParam, 16); Hi Word
    Switch $hWndFrom
        Case $ID, $hWndCombo
            Switch $iCode
                Case $CBN_CLOSEUP; Sent when the list box of a combo box has been closed
                    _DebugPrint("$CBN_CLOSEUP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_DBLCLK; Sent when the user double-clicks a string in the list box of a combo box
                    _DebugPrint("$CBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_DROPDOWN; Sent when the list box of a combo box is about to be made visible
                    _DebugPrint("$CBN_DROPDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_EDITCHANGE; Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box
                    _DebugPrint("$CBN_EDITCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    _Edit_Changed_ID()
                ; no return value
                Case $CBN_EDITUPDATE; Sent when the edit control portion of a combo box is about to display altered text
                    _DebugPrint("$CBN_EDITUPDATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_ERRSPACE; Sent when a combo box cannot allocate enough memory to meet a specific request
                    _DebugPrint("$CBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_KILLFOCUS; Sent when a combo box loses the keyboard focus
                    _DebugPrint("$CBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_SELCHANGE; Sent when the user changes the current selection in the list box of a combo box
                    _DebugPrint("$CBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_SELENDCANCEL; Sent when the user selects an item, but then selects another control or closes the dialog box
                    _DebugPrint("$CBN_SELENDCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_SELENDOK; Sent when the user selects a list item, or selects an item and then closes the list
                    _DebugPrint("$CBN_SELENDOK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_SETFOCUS; Sent when a combo box receives the keyboard focus
                    _DebugPrint("$CBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_COMMAND_ID

Func WM_COMMAND_Combo($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg
    Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo
    If Not IsHWnd($combo) Then $hWndCombo = GUICtrlGetHandle($combo)
    $hWndFrom = $ilParam
    $iIDFrom = BitAND($iwParam, 0xFFFF); Low Word
    $iCode = BitShift($iwParam, 16); Hi Word
    Switch $hWndFrom
        Case $combo, $hWndCombo
            Switch $iCode
                Case $CBN_CLOSEUP; Sent when the list box of a combo box has been closed
                    _DebugPrint("$CBN_CLOSEUP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_DBLCLK; Sent when the user double-clicks a string in the list box of a combo box
                    _DebugPrint("$CBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_DROPDOWN; Sent when the list box of a combo box is about to be made visible
                    _DebugPrint("$CBN_DROPDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_EDITCHANGE; Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box
                    _DebugPrint("$CBN_EDITCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    _Edit_Changed_Combo()
                ; no return value
                Case $CBN_EDITUPDATE; Sent when the edit control portion of a combo box is about to display altered text
                    _DebugPrint("$CBN_EDITUPDATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_ERRSPACE; Sent when a combo box cannot allocate enough memory to meet a specific request
                    _DebugPrint("$CBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_KILLFOCUS; Sent when a combo box loses the keyboard focus
                    _DebugPrint("$CBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_SELCHANGE; Sent when the user changes the current selection in the list box of a combo box
                    _DebugPrint("$CBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_SELENDCANCEL; Sent when the user selects an item, but then selects another control or closes the dialog box
                    _DebugPrint("$CBN_SELENDCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_SELENDOK; Sent when the user selects a list item, or selects an item and then closes the list
                    _DebugPrint("$CBN_SELENDOK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
                Case $CBN_SETFOCUS; Sent when a combo box receives the keyboard focus
                    _DebugPrint("$CBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                ; no return value
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_COMMAND_Combo

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)
EndFunc  ;==>_DebugPrint
Link to comment
Share on other sites

You need to subclass the control's message procedure to handle it's internal message and not the whole GUI window message procedure or do something like this because it seems to me that by calling GUIRegisterMsg the second time you're just making this new function handle the entire WM_COMMAND event of the whole window:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

Dim $hGUI = GUICreate('Title', 400, 200)
Dim $ComboBox1 = GUICtrlCreateCombo('', 0, 0, 190, 25)
Dim $ComboBox2 = GUICtrlCreateCombo('', 210, 0, 190, 25)

GUIRegisterMsg($WM_COMMAND, '_OnCommand')
GUICtrlSetData($ComboBox1, '1|2|3|4|5|6|7|8|9|10')
GUICtrlSetData($ComboBox2, '1|2|3|4|5|6|7|8|9|10')

GUISetState()

Do
    Sleep(20)
Until GUIGetMsg() = -3

GUIDelete()

Func _OnCommand($hWnd, $iMsg, $iwParam, $ilParam)
    Switch BitAND($iwParam, 0xFFFF)
        Case $ComboBox1
            ConsoleWrite('First combo box message' & @LF)
        
        Case $ComboBox2
            ConsoleWrite('Second combo box message' & @LF)
    EndSwitch
    
    Return $GUI_RUNDEFMSG
EndFunc

Subclassing is not difficult at all, just search the forum, you'll come up with a few great detailed example. Or, take a look at the help file under the function _WinAPI_CallWindowProc.

Link to comment
Share on other sites

thx, now I know where to search again :-)

will keep posted :-)

EDIT: btw, I never got the 1st to work.... I started with the second combobox as it here was really needed. So for $combo I got it to work. after that I tried to add it also to $ID which is teh second combobox but here I can't get it to work. Meanwhile, the $combo autocomplete is still working

Edited by Overlord
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...