Jump to content

HotKey(udf) assign multiple forms


Go to solution Solved by Yashied,

Recommended Posts

Posted

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

  Reveal hidden contents

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

 

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
Posted
  On 10/29/2014 at 5:37 PM, MikahS said:

 

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?

  On 10/29/2014 at 5:49 PM, czardas said:

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!

Posted
  On 10/29/2014 at 6:15 PM, xbennY0 said:

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

  Reveal hidden contents

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

 

Posted
  On 10/31/2014 at 5:24 PM, xbennY0 said:

Seriously? :(

 

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

Snips & Scripts

  Reveal hidden contents

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

 

Posted
  On 10/29/2014 at 5:37 PM, MikahS said:

 

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!

  • Solution
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
Posted

  On 11/3/2014 at 11:04 AM, Yashied said:

@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!

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
  • Recently Browsing   0 members

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