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

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jsjcjsjc
Posts: 56
Joined: 25 May 2019, 03:11

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

11 Jul 2023, 10:44

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
User avatar
mikeyww
Posts: 26984
Joined: 09 Sep 2014, 18:38

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

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!
}
jsjcjsjc
Posts: 56
Joined: 25 May 2019, 03:11

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

12 Jul 2023, 01:08

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 ?
User avatar
boiler
Posts: 16986
Joined: 21 Dec 2014, 02:44

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

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.
jsjcjsjc
Posts: 56
Joined: 25 May 2019, 03:11

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

12 Jul 2023, 05:44

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
jsjcjsjc
Posts: 56
Joined: 25 May 2019, 03:11

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

12 Jul 2023, 06:07

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 556 times
User avatar
mikeyww
Posts: 26984
Joined: 09 Sep 2014, 18:38

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

12 Jul 2023, 06:21

I do not have the answer. Others here may know.
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

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

12 Jul 2023, 06:57

Run this code with autohotkey ui access.
Or first execute RunWithUiAccess() function.
viewtopic.php?f=6&t=119251
jsjcjsjc
Posts: 56
Joined: 25 May 2019, 03:11

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

12 Jul 2023, 21:04

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
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

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

12 Jul 2023, 22:13

For this You dont need admin rights
Run this code with autohotkey ui access.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 86 guests