Probably somthing simple

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Rishu0182
Posts: 33
Joined: 02 Feb 2017, 11:49

Probably somthing simple

25 Sep 2018, 08:54

So basically I have a button within my program that brings up a gui with a giant edit field. In that edit field are the contents of a text file. Currently it works, but when you open the GUI, all of the text is highlighted. None of my other edit fields that I load variables into have this issue, but this is the only one that has FileRead. Anyone know how I can stop AHK from highlighting the full text in the edit field?

Code: Select all

ListOfHostrings:
Gui, 30: Destroy
FileRead, HotstringList, %A_Desktop%\Hotstring List.txt
Gui, 30:Add, Edit, w550 h500 ReadOnly, %HotstringList%
Gui, 30:Color, White
Gui, 30:Show, x270 y5 Autosize, List of Acronyms and Functions
return
Thanks!!
User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Probably somthing simple

25 Sep 2018, 12:32

Code: Select all

ListOfHostrings:
Gui, 30: Destroy
FileRead, HotstringList, %A_Desktop%\Hotstring List.txt
Gui, 30:Add, Edit, w550 h500 HwndhEdit ReadOnly, %HotstringList%

Gui, 30:Color, White
Gui, 30:Show, x270 y5 Autosize, List of Acronyms and Functions
ControlSend,,{End}, ahk_id %hEdit%
return
https://autohotkey.com/board/topic/4490 ... /?p=279465
Rishu0182
Posts: 33
Joined: 02 Feb 2017, 11:49

Re: Probably somthing simple

25 Sep 2018, 12:51

Thanks Dewd! Perfect
User avatar
emmanuel d
Posts: 90
Joined: 17 Nov 2013, 04:45

Re: Probably somthing simple

25 Sep 2018, 14:23

Code: Select all

#SingleInstance force ;|ignore|off]
ListOfHostrings:
Gui, 30: Destroy
FileRead, HotstringList, %A_Desktop%\Hotstring List.txt
Gui, 30:Add, Edit, w550 h500 ReadOnly hwndhMyEdit, %HotstringList%
; EM_SETSEL := 0x0B1
; wParam = (WPARAM)(INT) nStart; 
; lParam = (LPARAM)(INT) nEnd;
; Parameters
; nStart
    ; Specifies the starting character position of the selection. 
; nEnd
    ; Specifies the ending character position of the selection. 
Gui, 30:Color, White
Gui, 30:Show, x270 y5 Autosize, List of Acronyms and Functions
SendMessage,0x0B1,% -1,0,,ahk_id %hMyEdit% ; Deselect all
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 128 guests