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 

Transparent menus?

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



Joined: 07 Nov 2004
Posts: 1270

PostPosted: Wed Nov 10, 2004 7:19 pm    Post subject: Transparent menus? Reply with quote

Is it possible to make AHK menus transparent?
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10474

PostPosted: Wed Nov 10, 2004 10:28 pm    Post subject: Reply with quote

Not directly, but keeping the following script running seems to make all menus on the system transparent:
Code:
DetectHiddenWindows On  ; Might allow detection of menu sooner.
Loop
{
   WinWait, ahk_class #32768
   WinSet, Transparent, 150
}

This will work only on 2k/XP. In addition, if it doesn't work right, you might have to adjust your menu settings in Control Panel > Display > Appearance > Effects > Use the following transition effect for menus and tooltips

The above could be made more selective as follows:
Code:
DetectHiddenWindows On
Loop
{
   WinWait, ahk_class #32768
   WinGet, ProcessName, ProcessName
   if ProcessName = AutoHotkey.exe
      WinSet, Transparent, 150
}

Note: A script cannot make its own menus transparent because timers and other threads cannot be launched while the script is displaying its own menu. Therefore, you would need a separate script.
Back to top
View user's profile Send private message Send e-mail
Serenity



Joined: 07 Nov 2004
Posts: 1270

PostPosted: Fri Nov 12, 2004 6:16 pm    Post subject: Reply with quote

Thanks Chris.

The first script makes all windows menus transparent, which is really cool. I've always wanted slightly transparent menus all round. Unfortunately its a bit slow on detecting. Is there any way to speed up detection?

In hoping to make the start menu transparent, I used AU3_Spy to find out its ahk_class. It says its ahk_class is Shell_TrayWnd, but this actually makes the taskbar transparent! And I found that it remained transparent when I exited the script. This is fantastic!

I'd still like to make the start menu transparent, is it possible it has a different class # to the taskbar?
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10474

PostPosted: Sat Nov 13, 2004 12:06 am    Post subject: Reply with quote

Quote:
its a bit slow on detecting. Is there any way to speed up detection?
There are at least two ways. The first way is good except for the fact that it only works when a menu has been clicked on. If you open a menu any other way, it won't be transparent:
Code:
~LButton::
DetectHiddenWindows, on
IfWinExist, ahk_class #32768
   WinSet, Transparent, 150
return

The second way works more often but it uses about 50% of your CPU's remaining idle power. You could have it "Sleep 10" every 1000 iterations or so, but then there would be times when it isn't quite as responsive:
Code:
DetectHiddenWindows, on
Loop
{
   IfWinExist, ahk_class #32768
      WinSet, Transparent, 150
}

Quote:
In hoping to make the start menu transparent
It looks like the following makes the change, and maybe it only needs to be done once per reboot/logon:
DetectHiddenWindows, on
WinSet, Transparent, 150, ahk_class BaseBar
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10474

PostPosted: Sat Nov 13, 2004 3:41 pm    Post subject: Reply with quote

I did a little more testing and the following loop seems like the best compromise. It responds much faster than the WinWait method, while using hardly any CPU time:
Code:
DetectHiddenWindows, on  ; Might allow detection of menu sooner.
SetBatchLines -1
Loop
{
   IfWinExist, ahk_class #32768
      WinSet, Transparent, 150
   Sleep, 5  ; Prevents large consumption of CPU time.
}
return

I've also added the following info to the help file, so thanks for your research:
Quote:
To make the task bar transparent, use WinSet, Transparent, 150, ahk_class Shell_TrayWnd. Similarly, to make the Start Menu transparent, follow this example:
DetectHiddenWindows, on
WinSet, Transparent, 150, ahk_class BaseBar

Note that although such a script cannot make its own menus transparent, it can make those of other scripts transparent.
Back to top
View user's profile Send private message Send e-mail
Serenity



Joined: 07 Nov 2004
Posts: 1270

PostPosted: Sun Nov 14, 2004 2:18 am    Post subject: Reply with quote

Thanks again Chris. Smile
Back to top
View user's profile Send private message Visit poster's website
Serenity



Joined: 07 Nov 2004
Posts: 1270

PostPosted: Tue Nov 16, 2004 4:24 am    Post subject: Reply with quote

I found I can disable the desktop and hide icons with the following:

WinSet, Transparent, 0, ahk_class Progman

To restore:

WinSet, Transparent, off, ahk_class Progman
Back to top
View user's profile Send private message Visit poster's website
SanskritFritz



Joined: 17 Feb 2005
Posts: 283
Location: Hungary, Budapest

PostPosted: Thu Apr 21, 2005 12:29 pm    Post subject: Reply with quote

I encountered a nice side effect of hiding the BaseBar class:
Create an empty folder with the name sf_EmptyBar. Drag the folder from the explorer to the edge of the desktop, XP will create an empty toolbar. Right click it and set it 'Always on Top'. Now run this:
Code:
WinSet Transparent, 0, ahk_class BaseBar, sf_EmptyBar
The toolbar disappears, but maximized windows will not occupy the area, so you can put little metering apps like Samurize, Miranda floating contacts, WinAmp, etc there.
This is basically the same what the DesktopCoral utility does.
_________________
Is there another word for synonym?
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Thu Apr 21, 2005 1:13 pm    Post subject: Reply with quote

Using transparency usually takes up unnecessary memory, so in this case it might be better to just WinHide it. (Assuming that doesn't cancel the workspace-altering effect)
Back to top
View user's profile Send private message
SanskritFritz



Joined: 17 Feb 2005
Posts: 283
Location: Hungary, Budapest

PostPosted: Thu Apr 21, 2005 1:24 pm    Post subject: Reply with quote

jonny wrote:
Using transparency usually takes up unnecessary memory, so in this case it might be better to just WinHide it. (Assuming that doesn't cancel the workspace-altering effect)
Tried it, works, thanks for the hint!
_________________
Is there another word for synonym?
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1270

PostPosted: Thu Apr 21, 2005 3:57 pm    Post subject: Reply with quote

Nice find. Smile You can call the folder what you want btw.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
SanskritFritz



Joined: 17 Feb 2005
Posts: 283
Location: Hungary, Budapest

PostPosted: Thu Apr 21, 2005 8:00 pm    Post subject: Reply with quote

Serenity wrote:
Nice find. Smile You can call the folder what you want btw.
Laughing of course! sf_... stands for SanskritFritz Wink
_________________
Is there another word for synonym?
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