Sign in to follow this  
Followers 0
xbennY0

HotKey(udf) assign multiple forms

10 posts in this topic




Try

_HotKeyAssign($VK_ESCAPE, "HotKeyPressed", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL), $Form1)
_HotKeyAssign($VK_ESCAPE, "HotKeyPressed", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL), $Form2)
1 person likes this

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You could decide which form to interact with after calling the hotkey. This would have to be determined by code within the function you are calling. Then you can interract with all forms, the current active window or a predetermined selection.

Edited by czardas
1 person likes this

Share this post


Link to post
Share on other sites

 

Try

_HotKeyAssign($VK_ESCAPE, "HotKeyPressed", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL), $Form1)
_HotKeyAssign($VK_ESCAPE, "HotKeyPressed", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL), $Form2)

I had already done that and it worked. did not have any other way to do it better?

You could decide which form to interact with after calling the hotkey. This would have to be determined by code within the function you are calling. Then you can interract with all forms, the current active window or a predetermined selection.

Hm...i only need to interact with this two forms!

Share this post


Link to post
Share on other sites

I had already done that and it worked. did not have any other way to do it better?

 

I don't think so.  :geek: 


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

I don't think so.  :geek:

Seriously? :(

Share this post


Link to post
Share on other sites

Seriously? :(

 

Hopefully someone will come and correct me, but if I am not mistaken I'm thinking so. :(


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

 

Try

_HotKeyAssign($VK_ESCAPE, "HotKeyPressed", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL), $Form1)
_HotKeyAssign($VK_ESCAPE, "HotKeyPressed", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL), $Form2)

Hey... i was mistaken :( it doesn't work!

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

@xbennY0

You can specify only one window but you can use the methods of identifying window like Win... functions. Anyway, you can check focus in the user-defined function.

 

_HotKey_Assign($VK_ESCAPE, '_MyFunc')

...

Func _MyFunc()
    If (WinActive('Window1')) Or (WinActive('Window2')) Then
        ; Something
    EndIf
EndFunc   ;==>_MyFunc

I strongly recommend using the latest version >HotKey UDF.

Edited by Yashied
1 person likes this

Share this post


Link to post
Share on other sites

@xbennY0

You can specify only one window but you can use the methods of identifying window like Win... functions. Anyway, you can check focus in the user-defined function.

 

_HotKey_Assign($VK_ESCAPE, '_MyFunc')

...

Func _MyFunc()
    If (WinActive('Window1')) Or (WinActive('Window2')) Then
        ; Something
    EndIf
EndFunc   ;==>_MyFunc
I strongly recommend using the latest version >HotKey UDF.

 

Nice idea bro! thanks a lot!

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