Page 1 of 1

How to create a blue rectangle area that is always on screen top level

Posted: 11 Jul 2023, 10:44
by jsjcjsjc
Hello
How to create a blue rectangle area that is always on screen top level ? Even win+D
and it will display "ok" after clicking in this area ? I try to use this blue rectangle area in a touch screen as a trigger.

I can only use loop to monitor this area, but i think it's not prefec as loop will consume more system resources.

thanks in advance

Re: How to create a blue rectangle area that is always on screen top level  Topic is solved

Posted: 11 Jul 2023, 11:05
by mikeyww

Code: Select all

#Requires AutoHotkey v1.1.33
Gui +AlwaysOnTop -Caption +ToolWindow
Gui Color, Blue
Gui Show, w100 h100
OnMessage(WM_LBUTTONDOWN := 0x0201, "WM_LBUTTONDOWN")

WM_LBUTTONDOWN(wParam, lParam) {
 Gui Hide
 MsgBox 64, Status, OK!
}

Re: How to create a blue rectangle area that is always on screen top level

Posted: 12 Jul 2023, 01:08
by jsjcjsjc
mikeyww wrote:
11 Jul 2023, 11:05

Code: Select all

#Requires AutoHotkey v1.1.33
Gui +AlwaysOnTop -Caption +ToolWindow
Gui Color, Blue
Gui Show, w100 h100
OnMessage(WM_LBUTTONDOWN := 0x0201, "WM_LBUTTONDOWN")

WM_LBUTTONDOWN(wParam, lParam) {
 Gui Hide
 MsgBox 64, Status, OK!
}
works great!! :D
I try to Show this rectangle in left bottom. "Gui Show, x0 y980 w100 h100" is ok, but "Gui Show, x0 y%A_ScreenHeight%-100 w100 h100" is not ok.
could you please help me with it ?

Re: How to create a blue rectangle area that is always on screen top level

Posted: 12 Jul 2023, 05:06
by boiler
jsjcjsjc wrote: I try to Show this rectangle in left bottom. "Gui Show, x0 y980 w100 h100" is ok, but "Gui Show, x0 y%A_ScreenHeight%-100 w100 h100" is not ok.
You need to force an expression:

Code: Select all

Gui Show, % "x0 y" . (A_ScreenHeight-100) . " w100 h100"
See % Expression.

Re: How to create a blue rectangle area that is always on screen top level

Posted: 12 Jul 2023, 05:44
by jsjcjsjc
boiler wrote:
12 Jul 2023, 05:06
jsjcjsjc wrote: I try to Show this rectangle in left bottom. "Gui Show, x0 y980 w100 h100" is ok, but "Gui Show, x0 y%A_ScreenHeight%-100 w100 h100" is not ok.
You need to force an expression:

Code: Select all

Gui Show, % "x0 y" . (A_ScreenHeight-100) . " w100 h100"
See % Expression.
I see, thanks

Re: How to create a blue rectangle area that is always on screen top level

Posted: 12 Jul 2023, 06:07
by jsjcjsjc
mikeyww wrote:
11 Jul 2023, 11:05

Code: Select all

#Requires AutoHotkey v1.1.33
Gui +AlwaysOnTop -Caption +ToolWindow
Gui Color, Blue
Gui Show, w100 h100
OnMessage(WM_LBUTTONDOWN := 0x0201, "WM_LBUTTONDOWN")

WM_LBUTTONDOWN(wParam, lParam) {
 Gui Hide
 MsgBox 64, Status, OK!
}
another question is if my chrome is in full screen status, the taskbar will pop up after touch this rectangle ? is it possible to block it ?
thanks

Code: Select all

#Requires AutoHotkey v1.1.33

Gui +AlwaysOnTop -Caption +ToolWindow
Gui +LastFound
WinSet, TransColor, FFFFFF
WinSet, Transparent, 200
; Gui Show, x0 y780 w100 h100
Gui Show, % "x0 y" . (A_ScreenHeight-100) . " w100 h100"
OnMessage(WM_LBUTTONDOWN := 0x0201, "WM_LBUTTONDOWN")

WM_LBUTTONDOWN(wParam, lParam) {
req := ComObjCreate("MSXML2.ServerXMLHTTP")
req.open("GET", "https://powerbi.com", true)
req.send()
}
image.png
image.png (52.77 KiB) Viewed 662 times

Re: How to create a blue rectangle area that is always on screen top level

Posted: 12 Jul 2023, 06:21
by mikeyww
I do not have the answer. Others here may know.

Re: How to create a blue rectangle area that is always on screen top level

Posted: 12 Jul 2023, 06:57
by malcev
Run this code with autohotkey ui access.
Or first execute RunWithUiAccess() function.
viewtopic.php?f=6&t=119251

Re: How to create a blue rectangle area that is always on screen top level

Posted: 12 Jul 2023, 21:04
by jsjcjsjc
malcev wrote:
12 Jul 2023, 06:57
Run this code with autohotkey ui access.
Or first execute RunWithUiAccess() function.
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=119251
thanks, but I don't have admin :D

Re: How to create a blue rectangle area that is always on screen top level

Posted: 12 Jul 2023, 22:13
by malcev
For this You dont need admin rights
Run this code with autohotkey ui access.