Ziller Posted September 20, 2022 Share Posted September 20, 2022 Guten Morgen zusammen, ich möchte die Funktion isPressed nutzen, allerdings nur wenn die Eingabe in einer bestimmten Textbox ist. Wie kann ich herausfinden, ob die Textbox gerade focused ist? Viele Grüße Ziller Good Morning all, I want to use the isPressed function, but only when the input is in a specific textbox. How can I predict if the textbox is currently focused? Many greetings Ziller Link to comment Share on other sites More sharing options...
Nine Posted September 20, 2022 Share Posted September 20, 2022 Not sure if it is your own GUI, but here one way : #include <Misc.au3> #include <GUIConstants.au3> #include <Constants.au3> #include <WinAPIConv.au3> Local $hGUI = GUICreate("Example", 200, 200) Local $box = GUICtrlCreateInput("", 1, 30, 170, 30) GUIRegisterMsg($WM_COMMAND, WM_COMMAND) GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iIDFrom = _WinAPI_LoWord($wParam) Local $iCode = _WinAPI_HiWord($wParam) If $iCode = $EN_CHANGE And $iIDFrom = $box Then If _IsPressed("41") Then ConsoleWrite("a" & @CRLF) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND SkysLastChance 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...
Zedna Posted September 20, 2022 Share Posted September 20, 2022 Look here at function _IsFocused() using ControlGetFocus(): Resources UDF ResourcesEx UDF AutoIt Forum Search 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