Jojo-OP2 Posted April 20, 2019 Share Posted April 20, 2019 (edited) Hi, In my script I'm using the following code : Global $Arr[1][2] = [["{ENTER}", $Enter_KEY]] GUISetAccelerators($Arr) So when the "Enter" key is used, some fuction are executed based on the Control currently focused. It works vers well for my 2 input boxes, but it breaks" the "$ES_WANTRETURN" flag I'm using for my Edit control. I've written a custom Func which reproduce the line feed/carriage return in the edit box, and i'm using this func to replace the carret on the correct line : https://www.autoitscript.com/forum/topic/118476-how-to-position-the-cursor-in-a-multi-line-edit/?tab=comments#comment-824334 But is there a way to skip this control so it receive the normal message and performs a carriage return like it would without an accelerator ? Edited April 22, 2019 by Jojo-OP2 Solved Link to comment Share on other sites More sharing options...
Nine Posted April 20, 2019 Share Posted April 20, 2019 Case $msg = $Enter_KEY If ControlGetFocus ($hGUI) = "Edit2" Then ControlSend ($hGUI,"","Edit2", @LF) Something as simple as that ? Jojo-OP2 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Jojo-OP2 Posted April 20, 2019 Author Share Posted April 20, 2019 Thanks ! It works flawlessly. I feel a bit ashamed, I didn't think about this ^^ Link to comment Share on other sites More sharing options...
Nine Posted April 20, 2019 Share Posted April 20, 2019 19 minutes ago, Jojo-OP2 said: Thanks ! It works flawlessly. Another easy solution is to use notification like this : GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iIDFrom = _WinAPI_LoWord($wParam) Local $iCode = _WinAPI_HiWord($wParam) If $iIDFrom = $idEdit Then If $iCode = $EN_SETFOCUS Then GUISetAccelerators("") If $iCode = $EN_KILLFOCUS Then GUISetAccelerators($Arr) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_WM_COMMAND Jojo-OP2 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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