czardas Posted June 17, 2011 Share Posted June 17, 2011 I have a strange issue with using Ctrl+A to select all the text in an AutoIt edit control. I had always presumed that it was me, because Manadar told me that it works fine for him so I never reported it as a bug. I am still not sure if it is a bug. However I had the same problem on Win 2000, and now XP pro - also using different hardware. I now know it has nothing to do with my coding skills because I have the same issue with the help file examples. I also know it has nothing to do with my typing because it selects all items or text perfectly well in all other applications. Although I have found a way to work around this by setting Ctrl+A as a hotkey when an edit control has focus on an active window, I still worry about undesirable knock on effects. Has anyone else ever experienced this problem, or can anyone think of something I haven't tried that might help me to solve this mystery? operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
hannes08 Posted June 17, 2011 Share Posted June 17, 2011 Hi czardas, what exactly is your issue? Doesn't it mark all characters? So far I have had no such problem. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
guinness Posted June 17, 2011 Share Posted June 17, 2011 I was going to create an Example, but thought it would be easier to search the Example >> UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted June 17, 2011 Share Posted June 17, 2011 (edited) OK, my simplified Example >> expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <GUIEdit.au3> #include <WinAPI.au3> _Main() Func _Main() Local $hEdit, $hGUI, $iEdit, $iSelectAll $hGUI = GUICreate("An Example of using Ctrl+A and GUICtrlCreateEdit()", 500, 500) $iEdit = GUICtrlCreateEdit("An Example of using Ctrl+A and GUICtrlCreateEdit()", 10, 10, 480, 480) $hEdit = GUICtrlGetHandle(-1) $iSelectAll = GUICtrlCreateDummy() GUISetState(@SW_SHOW) Local $aAccelKeys[1][2] = [["^a", $iSelectAll]] ; Set Accelerator For Ctrl+A. GUISetAccelerators($aAccelKeys) ControlClick($hGUI, "", $iEdit) ; Click to disable initial highlight. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $iSelectAll ; Capture the HotKey and using _GUICtrlEdit_SetSel() select all the text in GUICtrlCreateEdit() Switch _WinAPI_GetFocus() Case $hEdit _GUICtrlEdit_SetSel($hEdit, 0, -1) EndSwitch EndSwitch WEnd EndFunc ;==>_Main Edited June 17, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
czardas Posted June 17, 2011 Author Share Posted June 17, 2011 (edited) OK, my simplified Example >> expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <GUIEdit.au3> #include <WinAPI.au3> _Main() Func _Main() Local $hEdit, $hGUI, $iEdit, $iSelectAll $hGUI = GUICreate("An Example of using Ctrl+A and GUICtrlCreateEdit()", 500, 500) $iEdit = GUICtrlCreateEdit("An Example of using Ctrl+A and GUICtrlCreateEdit()", 10, 10, 480, 480) $hEdit = GUICtrlGetHandle(-1) $iSelectAll = GUICtrlCreateDummy() GUISetState(@SW_SHOW) Local $aAccelKeys[1][2] = [["^a", $iSelectAll]] ; Set Accelerator For Ctrl+A. GUISetAccelerators($aAccelKeys) ControlClick($hGUI, "", $iEdit) ; Click to disable initial highlight. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $iSelectAll ; Capture the HotKey and using _GUICtrlEdit_SetSel() select all the text in GUICtrlCreateEdit() Switch _WinAPI_GetFocus() Case $hEdit _GUICtrlEdit_SetSel($hEdit, 0, -1) EndSwitch EndSwitch WEnd EndFunc ;==>_Main Thanks for that example Guiness, it seems to work fine and is probably better than my method, although I am unrgistering the hotkey whenever the GUI loses focus. EDIT => This is much easier and more stable. I was under the impression that hotkeys like Ctrl+A were automatically set when you create the edit control. Ctrl+C, Ctrl+Z, Ctrl+X all work fine. I'm glad I'm not the only one who had this happen. Edited June 17, 2011 by czardas operator64 ArrayWorkshop 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