Clickable window, but with a transparent background.

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Tvlao
Posts: 18
Joined: 29 Jun 2023, 03:39

Clickable window, but with a transparent background.

10 May 2024, 09:29

When I set the background to transparent:

Code: Select all

   WinSetTransColor this.win.BackColor " 255", this.win.Title
the clicks fall through this window, to the bottom window.
But they need to not fail.
So that the windows below are disabled and do not respond to clicks.
Tvlao
Posts: 18
Joined: 29 Jun 2023, 03:39

Re: Clickable window, but with a transparent background.

10 May 2024, 11:23

Is there some kind of DLL call that would direct all mouse events to this window?

In the window - WebView2 with html markup. It is necessary that a click on a transparent background is also transmitted to WebView2.
User avatar
Noitalommi_2
Posts: 278
Joined: 16 Aug 2023, 10:58

Re: Clickable window, but with a transparent background.

11 May 2024, 04:39

Hi.

I thought about making the window only semi-transparent, then clicks would still be registered. Maybe it's something to work with?

Code: Select all

#Requires AutoHotkey 2.0
#SingleInstance

OnMessage WM_LBUTTONDOWN := 0x0201, (*)=>SoundBeep()

myGui := Gui("AlwaysOnTop")
myGui.BackColor := 0xFF0000
myGui.Show("w500 h500")
WinSetTransColor 0xFF0000 " 1", "ahk_id" myGui.Hwnd
Tvlao
Posts: 18
Joined: 29 Jun 2023, 03:39

Re: Clickable window, but with a transparent background.

11 May 2024, 10:21

This does nothing. The window is completely transparent. Only the background should be transparent, not the text.
So, the entire window is translucent. But it should have completely opaque text and a completely transparent background:

Code: Select all

#Requires AutoHotkey 2.0
#SingleInstance

#Include ../Lib/ahk2_lib/WebView2/WebView2.ahk

OnMessage WM_LBUTTONDOWN := 0x0201, (*)=>SoundBeep()

myGui := Gui("AlwaysOnTop")
myGui.BackColor := 0xFF0000
myGui.Show("w900 h400")

wvc := WebView2.create(myGui.Hwnd)
wv := wvc.CoreWebView2
wv.Navigate(A_ScriptDir . "/../../index.html")

WinSetTransColor 0xFF0000 " 100", "ahk_id" myGui.Hwnd
User avatar
Noitalommi_2
Posts: 278
Joined: 16 Aug 2023, 10:58

Re: Clickable window, but with a transparent background.

11 May 2024, 11:53

I don't know how to make just the background of the WebView element transparent. Is that even possible?
Sorry, can't help with that.
Tvlao
Posts: 18
Joined: 29 Jun 2023, 03:39

Re: Clickable window, but with a transparent background.

11 May 2024, 13:41

The problem is not making the background transparent, but rather preventing clicks from going through the transparent background.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: WarlordAkamu67 and 21 guests