yousefsamy Posted June 23, 2014 Posted June 23, 2014 Every time i tried to use this code : HotKeySet ( "key" [, "function"] ) ==> Hotkeyset(" c ","ScreenCapture") <== Error !! i got error msg told me that [[ Undefined function ... what's the problem ??
Moderators Melba23 Posted June 23, 2014 Moderators Posted June 23, 2014 yousefsamy,Please post the code you are using and the content of the SciTE console. M23P.S. See here how to do it. 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
yousefsamy Posted June 23, 2014 Author Posted June 23, 2014 (edited) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ScreenCapture.au3> $Form1 = GUICreate("Form1", 468, 293, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 48, 32, 369, 209) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 HotKeySet("c","ScreenCapture") _ScreenCapture_Capture( @DesktopDir & "\11.jpg") ShellExecute (@DesktopDir & "\11.jpg") EndSwitch WEnd i think u forgot me - ---- oh i solved it $k = _ScreenCapture_Capture( @DesktopDir & "11.jpg") hotkeyset( " {Enter} " , $k ) Edited June 23, 2014 by yousefsamy
Moderators Melba23 Posted June 23, 2014 Moderators Posted June 23, 2014 yousefsamy,You get the error because there is no ScreenCapture function to run when you set the HotKey. What are you expecting the HotKey to do? 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
yousefsamy Posted June 23, 2014 Author Posted June 23, 2014 (edited) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ScreenCapture.au3> $Form1 = GUICreate("Form1", 468, 293, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 48, 32, 369, 209) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $k = _ScreenCapture_Capture( @DesktopDir & "\11.jpg") HotKeySet("d" , $k ) ;<== Not Run with this key [ d ] ?? why !! ShellExecute (@DesktopDir & "\11.jpg") EndSwitch WEnd but how can i make the hotkey like only {s} i cant do it ?? Edited June 23, 2014 by yousefsamy
Moderators Solution Melba23 Posted June 23, 2014 Moderators Solution Posted June 23, 2014 yousefsamy,Do you want the HotKey to act in the same way as the button and take a screenshot? If so you can do it like this:#include <GUIConstantsEx.au3> #include <ScreenCapture.au3> ; Run the function when you press the HotKey HotKeySet("d", "_ScreenShot") $Form1 = GUICreate("Form1", 468, 293, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 48, 32, 369, 209) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; Run the function when you press the button _ScreenShot() EndSwitch WEnd Func _Screenshot() ; Take and dispaly the screenshot _ScreenCapture_Capture(@DesktopDir & "\11.jpg") ShellExecute (@DesktopDir & "\11.jpg") EndFuncAll clear? M23 yousefsamy 1 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
yousefsamy Posted June 23, 2014 Author Posted June 23, 2014 (edited) yousefsamy, Do you want the HotKey to act in the same way as the button and take a screenshot? If so you can do it like this: #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> ; Run the function when you press the HotKey HotKeySet("d", "_ScreenShot") $Form1 = GUICreate("Form1", 468, 293, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 48, 32, 369, 209) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; Run the function when you press the button _ScreenShot() EndSwitch WEnd Func _Screenshot() ; Take and dispaly the screenshot _ScreenCapture_Capture(@DesktopDir & "\11.jpg") ShellExecute (@DesktopDir & "\11.jpg") EndFunc All clear? M23 Cant describe you with words ... Thanx should i learn Func codes ?? Edited June 23, 2014 by yousefsamy
somdcomputerguy Posted June 24, 2014 Posted June 24, 2014 should i learn Func codes ?? I don't know what you mean, but yes, I think you should. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
yousefsamy Posted June 24, 2014 Author Posted June 24, 2014 I don't know what you mean, but yes, I think you should. My Dear i mean[[ Func ]] is it important or it's only another way to type codes
somdcomputerguy Posted June 24, 2014 Posted June 24, 2014 (edited) I think the Language Reference - User Functions section in the Help file could explain it better than I could. http://www.autoitscript.com/autoit3/docs/intro/lang_functions.htm Kudos to you for wanting to learn more about AutoIt! Edited June 24, 2014 by somdcomputerguy yousefsamy 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
yousefsamy Posted June 24, 2014 Author Posted June 24, 2014 I think the Language Reference - User Functions section in the Help file could explain it better than I could. http://www.autoitscript.com/autoit3/docs/intro/lang_functions.htm Kudos to you for wanting to learn more about AutoIt! That's okay i will bro ,, i have another question should i post it here or in a new topic ?
somdcomputerguy Posted June 24, 2014 Posted June 24, 2014 (edited) I'm not sure really. Since this is turning into an offshoot of your original post, I guess just keep it here, especially if this new question is related to the script you had a problem with previously. A moderator, probably Melba23, who helped you earlier, can make a better decision on that. In fact, I'm just a regular user here, and my decisions don't count, so I wouldn't even try to make one. Edited June 24, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
yousefsamy Posted June 24, 2014 Author Posted June 24, 2014 I'm not sure really. Since this is turning into an offshoot of your original post, I guess just keep it here, especially if this new question is related to the script you had a problem with previously. A moderator, probably Melba23, who helped you earlier, can make a better decision on that. In fact, I'm just a regular user here, and my decisions don't count. oh no my dear you can help and you are a good one i will make a new topic with my problem ok and i am waiting ur reply
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