Jump to content
Sign in to follow this  
xbennY0

HotKey(udf) assign multiple forms

Recommended Posts

MikahS

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)
  • Like 1

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
czardas

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
  • Like 1

Share this post


Link to post
Share on other sites
xbennY0

 

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
MikahS

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
MikahS

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
xbennY0

 

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
Yashied

@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
  • Like 1

Share this post


Link to post
Share on other sites
xbennY0

@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  

×