Bug with input fields

Report problems with documented functionality
fanno
Posts: 1
Joined: 21 Mar 2021, 04:15

Bug with input fields

21 Mar 2021, 04:53

Hello all

My first post

input field (EDIT) don't work as expected. There is bug if using "WinSet, TransColor, CC0000"

running code blow i have extraced from complex project but it took some time to extract hope you can use it.
Udklip.PNG
Udklip.PNG (94.89 KiB) Viewed 457 times
1= area you can click and start input text in to
2 = area where you CANT

if you have a longer fiend above you can then input(click with mouse) in to the field below
Sample code with bug:

Code: Select all

#SingleInstance Force
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
CoordMode, Pixel, Relative

Gosub, CreateUI

MailLoop:
Goto, MailLoop


CreateUI:
	CreateUIX := 100
	CreateUIY := 100

	Gui, Color, CC0000
	Gui, Font, S7, Verdana

	Gui, Add, DropDownList, w100 x+1 BackgroundTrans ,

	Gui, Add, Edit, w40 y+1 c000000 ,
	Gui, Add, Edit, w400 y+1 c000000 ,
	Gui, Add, Edit, w40 y+1 c000000 ,
	Gui, Add, Edit, w400 y+1 c000000 ,
	
	Gui, Font, FF00000
	Gui, Font, S7, Verdana

	Gui +LastFound +AlwaysOnTop +ToolWindow
	WinSet, TransColor, CC0000
	Gui, Show, x%CreateUIX% y%CreateUIY%
Return
now if you comment out:

Code: Select all

;	WinSet, TransColor, CC0000
from the sample code then all the problems go away but that defeated the point of the UI to be on top and transparent ect.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Bug with input fields

21 Mar 2021, 11:03

i dont know if this is an ahk bug or just how windows does things given the circumstances. all ahk is doing is setting 2 window flags (WS_EX_LAYERED and LWA_COLORKEY)
it can be fixed if there was a different way of achieving the same effect(which i dont know if there is or there might be but it might be too complicated to implement or too situational vs. the effort required to implement it)
if urearrange them a bit, it becomes clear that the area of the control above dictates the valid hittest area for the row of control beneath, in alternating fashion:
image.png
image.png (5.76 KiB) Viewed 425 times
i think u should just assign HWNDs to ur edit controls and make a context-sensitive *LButton hotkey that checks with MouseGetPos, , , , ctrlHwnd, 2 if ctrlHwnd is one of the edit control hwnds and if it is, it GuiControl, Focuses it

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 42 guests