AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

make a window transparent and click through it

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
sam.reckoner



Joined: 11 Oct 2007
Posts: 10

PostPosted: Sat Jun 28, 2008 4:10 pm    Post subject: make a window transparent and click through it Reply with quote

Is it possible to make a window transparent and then be able to click through the same window to the underlying matter?

I would like to create a status window that is mostly transparent, but that I can click through.

Thanks in advance.
Back to top
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1354

PostPosted: Sat Jun 28, 2008 4:22 pm    Post subject: Reply with quote

Code:
WinSet, ExStyle, +0x00000020, ahk_id %hwnd%
Back to top
View user's profile Send private message
sam.reckoner



Joined: 11 Oct 2007
Posts: 10

PostPosted: Tue Jul 08, 2008 2:58 pm    Post subject: Reply with quote

Thanks for your response. But, this doesn't do the click-through part.

tic wrote:
Code:
WinSet, ExStyle, +0x00000020, ahk_id %hwnd%
Back to top
View user's profile Send private message
argneo



Joined: 14 Sep 2007
Posts: 124

PostPosted: Tue Jul 08, 2008 3:03 pm    Post subject: Reply with quote

Is the window in the back regularly the same?
because you could send clicks to the window directly by getting the ID... Almost like you would do in games...
_________________

WoW
Back to top
View user's profile Send private message
sam.reckoner



Joined: 11 Oct 2007
Posts: 10

PostPosted: Tue Jul 08, 2008 3:20 pm    Post subject: Reply with quote

Thanks for your response.

The window I am trying to get this working with scrolls lines of text (error/status messages) approximately twice every second. It's a status window that I would like to keep track of. Making it transparent is very useful, except that I cannot click any of the icons under it. I would like to be able to use the transparency but also to click at the underlying icons. I would like to regain control of this window (i.e. click into it) by using the taskbar, or the window's title bar.

[ Moderator!: Don't top-post ]
Back to top
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1354

PostPosted: Tue Jul 08, 2008 4:29 pm    Post subject: Reply with quote

sam.reckoner wrote:
Thanks for your response. But, this doesn't do the click-through part.

tic wrote:
Code:
WinSet, ExStyle, +0x00000020, ahk_id %hwnd%


Well....it does...so maybe test it properly in future Rolling Eyes

Code:
DetectHiddenWindows, on

Gui, 1: +LastFound +AlwaysOnTOp
hwnd1 := WinExist()
WinSet, ExStyle, +0x00000020, ahk_id %hwnd1%
WinSet, Transparent, 100, ahk_id %hwnd1%
Gui, 1: Show, w500 h500
Return
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Tue Jul 08, 2008 4:54 pm    Post subject: Reply with quote

sam.reckoner wrote:
Thanks for your response. But, this doesn't do the click-through part.
tic wrote:
Code:
WinSet, ExStyle, +0x00000020, ahk_id %hwnd%

That's right. You have to combine it with WinSet Transparent
Code:
; WinSet, Transparent, Off, ahk_id %hWnd%
WinSet, ExStyle, +0x00000020, ahk_id %hWnd%
WinSet, Transparent, 128, ahk_id %hWnd%
Back to top
View user's profile Send private message
GodlyMario



Joined: 02 Jul 2008
Posts: 35

PostPosted: Tue Jul 08, 2008 5:21 pm    Post subject: Reply with quote

can the same done to be normal windows like explorers instead of GUI?
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Tue Jul 08, 2008 5:39 pm    Post subject: Reply with quote

A window is a window. A window is also a GUI. Therefore, yes.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
tic



Joined: 22 Apr 2007
Posts: 1354

PostPosted: Tue Jul 08, 2008 5:42 pm    Post subject: Reply with quote

GodlyMario wrote:
can the same done to be normal windows like explorers instead of GUI?


Alright lazy pants...why not try it yourself? Wink

Code:
#SingleInstance, Force
DetectHiddenWindows, on
Hotkey, ~^LButton, ClickThrough, On
Return

ClickThrough:
MouseGetPos, x, y, hwnd
WinSet, AlwaysOnTop, On, ahk_id %hwnd%
WinSet, Transparent, 100, ahk_id %hwnd%
WinSet, ExStyle, +0x00000020, ahk_id %hwnd%
Return
Back to top
View user's profile Send private message
sam.reckoner



Joined: 11 Oct 2007
Posts: 10

PostPosted: Tue Jul 08, 2008 7:03 pm    Post subject: Reply with quote

This works great! Beware that if you accidentally do the Ctrl+LButton on the desktop, it will make the entire desktop transparent/click-through, which may require a re-login.

Thanks again for all the great help!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group