iTwIx Posted April 28, 2012 Share Posted April 28, 2012 hey guys, a friend of mine needs help with hotkeys. this is his script: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 112, 40, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 112, 64, 97, 17) $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 112, 88, 97, 17) $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 112, 112, 97, 17) $Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 112, 136, 97, 17) $Checkbox7 = GUICtrlCreateCheckbox("Checkbox7", 112, 160, 97, 17) $Checkbox8 = GUICtrlCreateCheckbox("Checkbox8", 112, 184, 97, 17) $Label1 = GUICtrlCreateLabel("Hot Key Ctrl+1", 8, 16, 72, 17) $Label2 = GUICtrlCreateLabel("Hot Key Ctrl+2", 8, 40, 72, 17) $Label3 = GUICtrlCreateLabel("Hot Key Ctrl+3", 8, 64, 72, 17) $Label4 = GUICtrlCreateLabel("Hot Key Ctrl+4", 8, 88, 72, 17) $Label5 = GUICtrlCreateLabel("Hot Key Ctrl+5", 8, 112, 72, 17) $Label6 = GUICtrlCreateLabel("Hot Key Ctrl+6", 8, 136, 72, 17) $Label7 = GUICtrlCreateLabel("Hot Key Ctrl+7", 8, 160, 72, 17) $Label8 = GUICtrlCreateLabel("Hot Key Ctrl+8", 8, 184, 72, 17) $Label9 = GUICtrlCreateLabel("Hot Key For Open and Close Alt+1", 8, 208, 165, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd he said that when he presses any hotkey it dsnt works... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 28, 2012 Moderators Share Posted April 28, 2012 iTwIx,Welcome to the Autoit forum. And why does your friend think his HotKeys will work if he does not use HotKeySet at some point in the script? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
iTwIx Posted April 28, 2012 Author Share Posted April 28, 2012 yh xD he only wrote hotkey in the label.... xD i was kinda but he was keeping asking me to do it... btw thnx for the welcome =) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 28, 2012 Moderators Share Posted April 28, 2012 iTwIx, And so what is the question that you have? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
iTwIx Posted April 28, 2012 Author Share Posted April 28, 2012 for now its all... thnx=) Link to comment Share on other sites More sharing options...
iTwIx Posted April 28, 2012 Author Share Posted April 28, 2012 how hes script is the following: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{Alt}"); That For Closs And Open the From #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 112, 40, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 112, 64, 97, 17) $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 112, 88, 97, 17) $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 112, 112, 97, 17) $Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 112, 136, 97, 17) $Checkbox7 = GUICtrlCreateCheckbox("Checkbox7", 112, 160, 97, 17) $Checkbox8 = GUICtrlCreateCheckbox("Checkbox8", 112, 184, 97, 17) $Label1 = GUICtrlCreateLabel("HotKeySet 1", 8, 16, 72, 17) $Label2 = GUICtrlCreateLabel("HotKeySet 2", 8, 40, 72, 17) $Label3 = GUICtrlCreateLabel("HotKeySet 3", 8, 64, 72, 17) $Label4 = GUICtrlCreateLabel("HotKeySet 4", 8, 88, 72, 17) $Label5 = GUICtrlCreateLabel("HotKeySet 5", 8, 112, 72, 17) $Label6 = GUICtrlCreateLabel("HotKeySet 6", 8, 136, 72, 17) $Label7 = GUICtrlCreateLabel("HotKeySet 7", 8, 160, 72, 17) $Label8 = GUICtrlCreateLabel("HotKeySet 8", 8, 184, 72, 17) $Label9 = GUICtrlCreateLabel("Hot Key For Open and Close Alt", 8, 208, 165, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 HotKeySet("{1}")("") Case $Checkbox2 HotKeySet("{2}")("") Case $Checkbox3 HotKeySet("{3}")("") Case $Checkbox4 HotKeySet("{4}")("") Case $Checkbox5 HotKeySet("{5}")("") Case $Checkbox6 HotKeySet("{6}")("") Case $Checkbox7 HotKeySet("{7}")("") Case $Checkbox8 HotKeySet("{8}")("") EndSwitch WEnd but it still dsnt work Link to comment Share on other sites More sharing options...
guinness Posted April 28, 2012 Share Posted April 28, 2012 (edited) You have to assign a function to HotKeySet and it's incorrectly formatted too. Refer to the Help file about HotKeySet. Edited April 28, 2012 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 28, 2012 Moderators Share Posted April 28, 2012 iTwIx,And why should it? Does your friend look at the Help file before coding or does he expect AutoIt to guess what he wants? The syntax for HotKeySet should be:HotKeySet( HotKey, "Function_Name")So where is the "Function_Name" (and the function itself? M23P.S. And you do not need the { } either. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
iTwIx Posted April 28, 2012 Author Share Posted April 28, 2012 (edited) ok this is what my friend replayed me in another website: See That i make it #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{z}", "Selectoncheckbox1") #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 EndSwitch WEnd Func Selectoncheckbox1() MsgBox(4096, "", "This is a message.") EndFunc ;==>ShowMessage but i went change MsgBox(4096, "", "This is a message.") to Select on checkbox1 not MsgBox(4096, "", "Select on checkbox1") went change to select on checkbox1 no went it MsgBox sorry bro i dont understand what have u said... ok that it [/size][/font][/color] #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{z}", "Selectoncheckbox1") #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 EndSwitch WEnd Func Selectoncheckbox1() MsgBox(4096, "", "00000000000") ; i went change Msgbox to i dont know what need to change MsgBox to ...... to make (HotKeySet) can Select On Checkbox1 EndFunc (write it and GM will know what i mean i went change Msgbox to i dont know what need to change MsgBox to ...... to make (HotKeySet) can Select On Checkbox1) (I am very sorry for bothering you) Edited April 28, 2012 by iTwIx Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 28, 2012 Moderators Share Posted April 28, 2012 iTwIx, I have absolutely no idea what you are trying to do. The first script you have posted shows the HotKey being set (although you do not need the { } as I have already mentioned) but what on earth do you mean by? to make (HotKeySet) can Select On Checkbox1The HotKey runs the function that you tell it to run - in this case Selectoncheckbox1. If you want the function to run when you select the checkbox then you need to do something like this: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 Selectoncheckbox1() EndSwitch WEnd Func Selectoncheckbox1() MsgBox(4096, "", "00000000000") EndFunc ;==>Selectoncheckbox1 Perhaps you need to get your friend to post here explaining what is going on rather than giving you snippets of script which only confuse us all. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
iTwIx Posted April 28, 2012 Author Share Posted April 28, 2012 yh im confused too lol my friend doesnt speaks well english so... Link to comment Share on other sites More sharing options...
SeaSky Posted May 1, 2012 Share Posted May 1, 2012 iTwIx i Will Help me i am Really Surprised for Melba23 cant help you ! see will add 2 func Only that it Func Selectoncheckbox() GUICtrlSetState($Checkbox1, $GUI_CHECKED) EndFunc Func Selectoncheckbox1() GUICtrlSetState($Checkbox1, $GUI_unchecked) EndFunc will make 2 hotkeyset if went all Script #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{z}", "Selectoncheckbox") HotKeySet("{x}", "Selectoncheckbox1") #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Selectoncheckbox() GUICtrlSetState($Checkbox1, $GUI_CHECKED) EndFunc Func Selectoncheckbox1() GUICtrlSetState($Checkbox1, $GUI_unchecked) EndFunc if he went add more check box he will need add other to func but change name func and change name $Checkbox1 Depending on the name $Checkbox 1 and the name next func not any name HotKeySet("{x}", "Here name the next Func") so will add Func Here name The Next Func any name but Be necessary in HotKeySet i hope i help your Friend 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