Sign in to follow this  
Followers 0
yousefsamy

now i want to know Hotkeyset Functions !!

13 posts in this topic

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 ?? :pirate:

Share this post


Link to post
Share on other sites



yousefsamy,

Please post the code you are using and the content of the SciTE console. :)

M23

P.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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 -   :ermm:  :geek:

----

oh i solved it -_-

$k = _ScreenCapture_Capture( @DesktopDir & "11.jpg")
hotkeyset( " {Enter} " , $k )

Edited by yousefsamy

Share this post


Link to post
Share on other sites

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? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by yousefsamy

Share this post


Link to post
Share on other sites

yousefsamy,

Do you want the HotKey to act in the same way as the button and take a screenshot? :huh:

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

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

yousefsamy,

Do you want the HotKey to act in the same way as the button and take a screenshot? :huh:

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

 

:thumbsup:  Cant describe you with words ... :sweating: Thanx

should i learn Func codes ??

Edited by yousefsamy

Share this post


Link to post
Share on other sites

should i learn Func codes ??

 

I don't know what you mean, but yes, I think you should. :graduated:


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

I don't know what you mean, but yes, I think you should. :graduated:

 

My Dear i mean[[ Func ]] is it important or it's only another way to type codes 

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by somdcomputerguy
1 person likes this

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

#12 ·  Posted (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 by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

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 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0