How do you preserve highlighting of selected text in a GUI edit box, when it's not the active window? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
balkinishu
Posts: 17
Joined: 17 Nov 2017, 11:13

How do you preserve highlighting of selected text in a GUI edit box, when it's not the active window?

Post by balkinishu » 18 Aug 2022, 17:10

For example

If Chrome is the active window, selected text will look like this
active_highlight.jpg
active_highlight.jpg (20 KiB) Viewed 753 times

If Chrome is not the active window, but still within view, selected text will look like this
inactive_highlight.jpg
inactive_highlight.jpg (17.77 KiB) Viewed 753 times

How do I keep selected text visibly highlighted (preferably in a different color) in a AHK created GUI when that GUI is not the active window. My GUI edit box selected text highlighting disappears whenever my GUI is not the active window.

Thanks in advance to anyone who help me out on this.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: How do you preserve highlighting of selected text in a GUI edit box, when it's not the active window?

Post by BoBo » 19 Aug 2022, 15:04

Embedding a browser component within the GUI? Or what about using @geek's :arrow: Neutron instead?

teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: How do you preserve highlighting of selected text in a GUI edit box, when it's not the active window?  Topic is solved

Post by teadrinker » 19 Aug 2022, 18:40

Code: Select all

ES_NOHIDESEL := 0x100		; https://www.autohotkey.com/docs/misc/Styles.htm

Gui, New, +AlwaysOnTop
Gui, Add, Edit, w200 %ES_NOHIDESEL%, AutoHotkey
Gui, Show

GuiClose() {
   ExitApp
}

balkinishu
Posts: 17
Joined: 17 Nov 2017, 11:13

Re: How do you preserve highlighting of selected text in a GUI edit box, when it's not the active window?

Post by balkinishu » 20 Aug 2022, 18:31

Thanks Teadrinker. That's exactly what I was looking for. Much appreciated.
teadrinker wrote:
19 Aug 2022, 18:40

Code: Select all

ES_NOHIDESEL := 0x100		; https://www.autohotkey.com/docs/misc/Styles.htm

Gui, New, +AlwaysOnTop
Gui, Add, Edit, w200 %ES_NOHIDESEL%, AutoHotkey
Gui, Show

GuiClose() {
   ExitApp
}

Post Reply

Return to “Ask for Help (v1)”