JoGa Posted January 1, 2009 Posted January 1, 2009 Hi folks , in the below code the combobox event does not work, any hints? Thanks for reading. CODE#include <GuiComboBoxEx.au3> #include <GuiImageList.au3> #include <GuiConstantsEx.au3> ### Create GUI $GUI = GUICreate("ComboBoxEx", 200, 100) ### Combo $ImageCombo = _GUICtrlComboBoxEx_Create($GUI, "", 2, 2, 150, 120) $ImageList = _GUIImageList_Create(80, 15, 3) GUISetState() ### create image list _GUIImageList_AddBitmap($ImageList, "PnP#001.bmp") _GUIImageList_AddBitmap($ImageList, "PnP#002.bmp") ### Set Image List _GUICtrlComboBoxEx_SetImageList($ImageCombo, $ImageList) For $x = 0 To 1 _GUICtrlComboBoxEx_AddString($ImageCombo, "t-" & $x, $x, $x) Next while(true) $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $ImageCombo MsgBox(0, "ComboTest", "ImageCombo: " & $msg) Default MsgBox(0, "ComboTest", "Default: " & $msg) EndSwitch wend ########################################################################
Aceguy Posted January 1, 2009 Posted January 1, 2009 Hope this Helps. expandcollapse popup#include<GuiComboBoxEx.au3> #include<GuiImageList.au3> #include<GUIConstantsEx.au3> #include<ComboConstants.au3> #include<WindowsConstants.au3> ;### Create GUI $GUI = GUICreate("ComboBoxEx", 200, 100) ;### Combo $ImageCombo = _GUICtrlComboBoxEx_Create($GUI, "", 2, 2, 150, 120) $ImageList = _GUIImageList_Create(80, 15, 3) GUISetState() ;### create image list $hImage = _GUIImageList_Create(16, 16, 5, 3) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 13, FALSE) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 12, False) ;### Set Image List _GUICtrlComboBoxEx_SetImageList($ImageCombo, $hImage) For $x = 0 To 1 _GUICtrlComboBoxEx_AddString($ImageCombo, "t-" & $x, $x, $x) Next _GUICtrlComboBoxEx_SetCurSel($ImageCombo,0) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") while 1 sleep(50) wend Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case $ImageCombo Switch $iCode 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 $m=_GUICtrlComboBox_GetCurSel($ImageCombo) MsgBox(0,"","combo changed to item no "&$m ,0) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
JoGa Posted January 1, 2009 Author Posted January 1, 2009 Thanks alot Where can I find the doku for 'GUIRegisterMsg' ?
GEOSoft Posted January 1, 2009 Posted January 1, 2009 Thanks alot Where can I find the doku for 'GUIRegisterMsg' ?It's in the help filehttp://dundats.mvps.org/help/html/function...RegisterMsg.htmThe link to my online version of the help file is in my sig. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
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