SxyfrG Posted April 23, 2008 Posted April 23, 2008 (edited) Does anyone know how to make an edit or input control that does NOT select all the text within it once the GUI that contains that control gains focus? Just like notepads edit control. If you don't know what i mean or what i'm talking about, create a GUI with an edit control, then place some text in there. Once you've done that, click on another window, then click somewhere outside the edit control of the GUI you've just created. You should notice that all the text within your edit control has been selected. That is what i want to stop happening once the window containing that edit control gains focus. If anyone could shed some light on this issue it would be much appreciated! Edited April 23, 2008 by SxyfrG My scripts:AppLauncherTRAY - Awesome app launcher that runs from the system tray NEW VERSION! | Run Length Encoding - VERY simple compression in pure autoit | Simple Minesweeper Game - Fun little game :)My website
rasim Posted April 23, 2008 Posted April 23, 2008 (edited) Hi! Try this: #include <GUIConstants.au3> $hGUI = GUICreate("Test GUI", 300, 200) $hEdit = GUICtrlCreateEdit("Hello world!", 10, 10, 280, 180) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $IdFrom = BitAND($wParam, 0xFFFF) Local $iCode = BitShift($wParam, 16) Switch $IdFrom Case $hEdit Switch $iCode Case $EN_SETFOCUS Return 1 EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Edited April 23, 2008 by rasim
SxyfrG Posted April 23, 2008 Author Posted April 23, 2008 (edited) Wow! Perfect! Thanks Rasim, EXACTLY what i was looking for! *EDIT* Just so i know, what exactly does the WM_COMMAND function do, intercept the normal function call to select all the text? Edited April 23, 2008 by SxyfrG My scripts:AppLauncherTRAY - Awesome app launcher that runs from the system tray NEW VERSION! | Run Length Encoding - VERY simple compression in pure autoit | Simple Minesweeper Game - Fun little game :)My website
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