Gordoni Posted June 21, 2009 Share Posted June 21, 2009 Here is my 1% of all code with that need help $fake = GUICtrlCreateCombo('', 25, 125, 105, 20, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, 'Combo Item 1|Combo Item 2|Combo Item 3') Func ComboRun() If $fake = "Combo Item 1" then ShellExecute("http://combo1.com") If $fake = "Combo Item 2" then ShellExecute("http://combo2.com") If $fake = "Combo Item 3" then ShellExecute("http://combo3.com") EndFunc When i start func ComboRun() from my gui button that doesnt work Looking for help Link to comment Share on other sites More sharing options...
Yashied Posted June 21, 2009 Share Posted June 21, 2009 Func ComboRun() Local $Data = GUICtrlRead($fake) Switch $Data Case "Combo Item 1" ShellExecute("http://combo1.com") Case "Combo Item 2" ShellExecute("http://combo2.com") Case "Combo Item 3" ShellExecute("http://combo3.com") EndSwitch EndFunc ;==>ComboRun My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Gordoni Posted June 21, 2009 Author Share Posted June 21, 2009 I dont know why but script doesnt work . Looking for help with fixing. #include <INet.au3> #include <string.au3> #Include <Misc.au3> #include <GUIConstantsEx.au3> #include <guiconstants.au3> #include <ComboConstants.au3> #include-once $hwnd = GUICreate("Program", 400, 75) $ComboRun = GUICtrlCreateButton("Go", 25, 10, 25, 20) GUICtrlSetOnEvent($ComboRun, "ComboRun") $fake = GUICtrlCreateCombo('', 50, 10, 250, 20, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, 'a1.com|a2.com|a3.com') GUISetState () Func ComboRun() Local $Data2 = GUICtrlRead($fake) Switch $Data2 Case "a1.com" ShellExecute("http://a1.com") Case "a2.com" ShellExecute("http://a2.com") Case "a3.com" ShellExecute("http://a3.com") EndSwitch EndFunc While 1 $msg=GUIGetMsg () if $msg=$GUI_EVENT_CLOSE Then ExitLoop WEnd Link to comment Share on other sites More sharing options...
rajeshontheweb Posted June 21, 2009 Share Posted June 21, 2009 (edited) While 1 $msg=GUIGetMsg () if $msg=$GUI_EVENT_CLOSE Then ExitLoop ; If $msg = $fake Then ComboRun() If $msg = $ComboRun Then ComboRun() WEnd or While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop ;Case $fake Case $ComboRun ; sorry for the hasty response! ComboRun() EndSwitch WEnd Edited June 21, 2009 by rajeshontheweb Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Zedna Posted June 21, 2009 Share Posted June 21, 2009 You mixed OnEvent and Message modes. #include <INet.au3> #include <string.au3> #Include <Misc.au3> #include <GUIConstantsEx.au3> #include <guiconstants.au3> #include <ComboConstants.au3> $hwnd = GUICreate("Program", 400, 75) $ComboRun = GUICtrlCreateButton("Go", 25, 10, 25, 20) $fake = GUICtrlCreateCombo('', 50, 10, 250, 120, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, 'a1.com|a2.com|a3.com') GUISetState () While 1 $msg=GUIGetMsg () if $msg=$GUI_EVENT_CLOSE Then ExitLoop if $msg=$ComboRun Then ComboRun() WEnd Func ComboRun() Local $Data2 = GUICtrlRead($fake) Switch $Data2 Case "a1.com" ShellExecute("http://a1.com") Case "a2.com" ShellExecute("http://a2.com") Case "a3.com" ShellExecute("http://a3.com") EndSwitch EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
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