Jump to content

HotKey(udf) assign multiple forms


xbennY0
 Share

Go to solution Solved by Yashied,

Recommended Posts

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)

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

 

Link to comment
Share on other sites

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
Link to comment
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!

Link to comment
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

 

Link to comment
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

 

Link to comment
Share on other sites

  • Solution

@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
Link to comment
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!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...