Sign in to follow this  
Followers 0
nekkutta

$WM_COMMAND and _GUICtrlComboBox_AutoComplete Help

5 posts in this topic

#1 ·  Posted (edited)

I'm pretty good at autoit, but when it comes to handling windows message codes, haven't really had much experience.

I've read through the help file and example scripts and it really didn't help much...

I am writing a program for someone to use in their business and I really need to get this working.

I have one primary gui that spawns off other guis, each gui is in a function with the ctrls that need to be modified declared as globals, but there is several comboboxes spread across the various guis and I realize I will have to use GuiRegisterMsg for $WM_COMMAND, and I understand that there are 4 parameters for the $WM_COMMAND function, $hWnd, $iMsg, $iwParam, $ilParam. $hWnd and $iMsg I can get, but in the examples it does some weird things with the $iwParam, and the $ilParam ie.

$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word

could someone clarify some of this, maybe some example code, to help me figure out how to setup a layered switch to switch between the various guis and then the comboboxes in those guis.

TIA

EDIT:

This is what I have come up with after doing some more reading, and I am afraid to test it without getting some expert opinion on it. (also I don't have the database populated either, lol)

Func _AutoCompleteHandle($hWnd, $iMsg, $iwParam, $ilParam)
    $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
    $iCode = BitShift($iwParam, 16) ; Hi Word
    Switch $hWnd
        Case $frm_Main
            Switch $ilParam
                Case $cmb_Main_PlayerSelect
                    If $iCode = $CBN_EDITCHANGE Then _GUICtrlComboBox_AutoComplete($cmb_Main_PlayerSelect)
                Case $cmb_Main_Quests
                    If $iCode = $CBN_EDITCHANGE Then _GUICtrlComboBox_AutoComplete($cmb_Main_Quests)
                Case $cmb_Main_Achievement
                    If $iCode = $CBN_EDITCHANGE Then _GUICtrlComboBox_AutoComplete($cmb_Main_Achievement)
            EndSwitch
        Case $frm_Acheiv_Admin
            If $ilParam = $cmb_Achiev And $iCode = $CBN_EDITCHANGE Then _GUICtrlComboBox_AutoComplete($cmb_Achiev)
        Case $frm_Quest_Admin
            If $ilParam = $cmb_Quests And $iCode = $CBN_EDITCHANGE Then _GUICtrlComboBox_AutoComplete($cmb_Quests)
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc

please let me know if I'm on the right track with this, or if I have something wrong.

Edited by nekkutta

[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Share this post


Link to post
Share on other sites



I am writing a program for someone to use in their business and I really need to get this working...

Case $cmb_Main_PlayerSelect
                    If $iCode = $CBN_EDITCHANGE Then _GUICtrlComboBox_AutoComplete($cmb_Main_PlayerSelect)
                Case $cmb_Main_Quests
                    If $iCode = $CBN_EDITCHANGE Then _GUICtrlComboBox_AutoComplete($cmb_Main_Quests)
Business... Riiiiiiiight. :graduated:

Have you seen this?

:(


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Yes, I have and this is for an instore rpg player(ie. customer) database. so unless you wish to help....


[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Share this post


Link to post
Share on other sites

Yes, I have and this is for an instore rpg player(ie. customer) database. so unless you wish to help....

Let the eye rolling continue unabated...

:graduated:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


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