xbennY0 Posted October 29, 2014 Share Posted October 29, 2014 Is it possible to assign a HotKey to multiple forms? Example: _HotKeyAssign($VK_ESCAPE, "HotKeyPressed", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL), $Form1+$Form2) I'm using this UDF: '?do=embed' frameborder='0' data-embedContent>> Thanks! Link to comment Share on other sites More sharing options...
MikahS Posted October 29, 2014 Share Posted October 29, 2014 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) xbennY0 1 Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy 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 More sharing options...
czardas Posted October 29, 2014 Share Posted October 29, 2014 (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 October 29, 2014 by czardas xbennY0 1 operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
xbennY0 Posted October 29, 2014 Author Share Posted October 29, 2014 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 More sharing options...
MikahS Posted October 30, 2014 Share Posted October 30, 2014 I had already done that and it worked. did not have any other way to do it better? I don't think so. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy 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 More sharing options...
xbennY0 Posted October 31, 2014 Author Share Posted October 31, 2014 I don't think so. Seriously? Link to comment Share on other sites More sharing options...
MikahS Posted October 31, 2014 Share Posted October 31, 2014 Seriously? Hopefully someone will come and correct me, but if I am not mistaken I'm thinking so. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy 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 More sharing options...
xbennY0 Posted November 2, 2014 Author Share Posted November 2, 2014 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! Link to comment Share on other sites More sharing options...
Solution Yashied Posted November 3, 2014 Solution Share Posted November 3, 2014 (edited) @xbennY0You 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 ;==>_MyFuncI strongly recommend using the latest version >HotKey UDF. Edited November 3, 2014 by Yashied xbennY0 1 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
xbennY0 Posted November 3, 2014 Author Share Posted November 3, 2014 @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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now