AutoHotkey Community

It is currently May 25th, 2012, 6:46 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: May 26th, 2007, 10:42 am 
Offline

Joined: April 9th, 2007, 4:43 pm
Posts: 172
Sorry, there was a mistake: I forgot Gui, Submit
The new, better version is this:
Code:
Gosub, ReadPreprocs
Gosub, ReadVars
Gosub, ReadIni
Gosub, ReadLang
Gosub, CreateSettings
Gosub, CorrectSettings
Gosub, CreateTray
Gosub, TransparencyConvert
SetTimer, MakeTransparent, 1
Return

MakeTransparent:
If (ActiveMenus)
  WinSet, Trans, %TransparencyValueMenus%, ahk_class #32768 ; Menus, Right-click-menus, ...
If (ActiveMsgBoxes)
  WinSet, Trans, %TransparencyValueMsgBoxes%, ahk_class #32770 ; MsgBoxes, Warnings, ...
If (ActiveTrayTips)
  WinSet, Trans, %TransparencyValueTrayTips%, ahk_class tooltips_class32 ; TrayTips
If (ActiveStartMenu)
  {
  WinSet, Trans, %TransparencyValueStartMenu%, ahk_class DV2ControlHost ; Start menu
  WinSet, Trans, %TransparencyValueStartMenu%, ahk_class BaseBar ; All prgrams
  }
If (ActiveTaskbar)
  WinSet, Trans, %TransparencyValueTaskbar%, ahk_class Shell_TrayWnd ; Taskbar
Return

ReadPreprocs:
#Persistent
#SingleInstance, force
DetectHiddenWindows, On
Return

ReadVars:
AppName=TransMenu
Version=1.0.0.2
Transparency=50
Return

ReadIni:
IniRead, TransparencyMenus     , %AppName%.ini, Transparency        , Menus               , 50
IniRead, TransparencyMsgBoxes  , %AppName%.ini, Transparency        , MsgBoxes            , 50
IniRead, TransparencyTrayTips  , %AppName%.ini, Transparency        , TrayTips            , 50
IniRead, TransparencyStartMenu , %AppName%.ini, Transparency        , StartMenu           , 50
IniRead, TransparencyTaskbar   , %AppName%.ini, Transparency        , Taskbar             , 50
IniRead, ActiveMenus           , %AppName%.ini, Active              , Menus               , 1
IniRead, ActiveMsgBoxes        , %AppName%.ini, Active              , MsgBoxes            , 0
IniRead, ActiveTrayTips        , %AppName%.ini, Active              , TrayTips            , 0
IniRead, ActiveStartMenu       , %AppName%.ini, Active              , StartMenu           , 0
IniRead, ActiveTaskbar         , %AppName%.ini, Active              , Taskbar             , 0
Return

ReadLang:
If (Language = "EN")
  {
  LangShowGui=Show
  LangSettings=Settings
  LangExit=Exit
  LangMenus=Menus
  LangMsgBoxes=Message, Warnings
  LangTrayTips=TrayTips
  LangStartMenu=Start menu
  LangTaskbar=Task bar
  }
Else If (Language = "DE"||A_Language = 0407||A_Language = 0807||A_Language = 0c07||A_Language = 1007||A_Language = 1407)
  {
  LangShowGui=Öffnen
  LangSettings=Einstellungen
  LangExit=Beenden
  LangMenus=Menüs
  LangMsgBoxes=Nachrichten, Warnungen
  LangTrayTips=TrayTips
  LangStartMenu=Startmenü
  LangTaskbar=Taskleiste
  }
Else
  {
  IniRead, LangShowGui         , %AppName%.lng, %Language%, Show                , Show
  IniRead, LangSettings        , %AppName%.lng, %Language%, Settings            , Settings
  IniRead, LangExit            , %AppName%.lng, %Language%, Exit                , Exit
  IniRead, LangMenus           , %AppName%.lng, %Language%, Menus               , Menus
  IniRead, LangMsgBoxes        , %AppName%.lng, %Language%, MsgBoxes            , Message, Warnings
  IniRead, LangTrayTips        , %AppName%.lng, %Language%, TrayTips            , TrayTips
  IniRead, LangStartMenu       , %AppName%.lng, %Language%, StartMenu           , Start menu
  IniRead, LangTaskbar         , %AppName%.lng, %Language%, Taskbar             , Task bar
  }
Return

CreateSettings:
Gui, Add, Checkbox, w150 h20 vActiveMenus, %LangMenus%
Gui, Add, Checkbox, w150 h20 vActiveMsgBoxes, %LangMsgBoxes%
Gui, Add, Checkbox, w150 h20 vActiveTrayTips, %LangTrayTips%
Gui, Add, Checkbox, w150 h20 vActiveStartMenu, %LangStartMenu%
Gui, Add, Checkbox, w150 h20 vActiveTaskbar, %LangTaskbar%
Gui, Add, Button, gOK, OK!
Gui, Add, Edit, ym w50 r1 Number vTransparencyMenus, %TransparencyMenus%
Gui, Add, Edit, w50 r1 Number vTransparencyMsgBoxes, %TransparencyMsgBoxes%
Gui, Add, Edit, w50 r1 Number vTransparencyTrayTips, %TransparencyTrayTips%
Gui, Add, Edit, w50 r1 Number vTransparencyStartMenu, %TransparencyStartMenu%
Gui, Add, Edit, w50 r1 Number vTransparencyTaskbar, %TransparencyTaskbar%
Return

CreateTray:
Menu, Tray, NoStandard
Menu, Tray, Add, %LangSettings%, ShowSettings
Menu, Tray, Add,
Menu, Tray, Add, %LangExit%, Exit
Menu, Tray, Tip, %AppName%
Menu, Tray, Default, %LangSettings%
Return

ShowSettings:
Gui, Show, Center, %LangSettings%
Return

OK:
Gui, Submit, Hide
TransparencyConvert:
If (TransparencyMenus > 100||TransparencyMenus < 0)
  {
  GuiControl,, TransparencyMenus, 50
  Gosub, ShowSettings
  }
Else
  {
  TransparencyValueMenus := Round(TransparencyMenus*2.25)
  IniWrite, %TransparencyMenus%           , %AppName%.ini, Main                , TransparencyMenus
  }
If (TransparencyMsgBoxes > 100||TransparencyMsgBoxes < 0)
  {
  GuiControl,, TransparencyMsgBoxes, 50
  Gosub, ShowSettings
  }
Else
  {
  TransparencyValueMsgBoxes := Round(TransparencyMsgBoxes*2.25)
  IniWrite, %TransparencyMsgBoxes%           , %AppName%.ini, Main                , TransparencyMsgBoxes
  }
If (TransparencyTrayTips > 100||TransparencyTrayTips < 0)
  {
  GuiControl,, TransparencyTrayTips, 50
  Gosub, ShowSettings
  }
Else
  {
  TransparencyValueTrayTips := Round(TransparencyTrayTips*2.25)
  IniWrite, %TransparencyTrayTips%           , %AppName%.ini, Main                , TransparencyTrayTips
  }
If (TransparencyStartMenu > 100||TransparencyStartMenu < 0)
  {
  GuiControl,, TransparencyStartMenu, 50
  Gosub, ShowSettings
  }
Else
  {
  TransparencyValueStartMenu := Round(TransparencyStartMenu*2.25)
  IniWrite, %TransparencyStartMenu%           , %AppName%.ini, Main                , TransparencyStartMenu
  }
If (TransparencyTaskbar > 100||TransparencyTaskbar < 0)
  {
  GuiControl,, TransparencyTaskbar, 50
  Gosub, ShowSettings
  }
Else
  {
  TransparencyValueTaskbar := Round(TransparencyTaskbar*2.25)
  IniWrite, %TransparencyTaskbar%           , %AppName%.ini, Main                , TransparencyTaskbar
  }
If Not (ActiveMenus)
  {
  WinSet, Trans, 255, ahk_class #32768
  IniWrite, %ActiveMenus%, %AppName%.ini, Active, Menus
  }
If Not (ActiveMsgBoxes)
  {
  WinSet, Trans, 255, ahk_class #32770
  IniWrite, %ActiveMsgBoxes%, %AppName%.ini, Active, MsgBoxes
  }
If Not (ActiveTrayTips)
  {
  WinSet, Trans, 255, ahk_class tooltips_class32
  IniWrite, %ActiveTrayTips%, %AppName%.ini, Active, TrayTips
  }
If Not (ActiveStartMenu)
  {
  WinSet, Trans, 255, ahk_class DV2ControlHost
  WinSet, Trans, 255, ahk_class BaseBar
  IniWrite, %ActiveStartMenu%, %AppName%.ini, Active, StartMenu
  }
If Not (ActiveTaskbar)
  {
  WinSet, Trans, 255, ahk_class Shell_TrayWnd
  IniWrite, %ActiveTaskbar%, %AppName%.ini, Active, Taskbar
  }
Return

CorrectSettings:
If (ActiveMenus)
  GuiControl, , ActiveMenus, 1
Else
  GuiControl, , ActiveMenus, 0
If (ActiveMsgBoxes)
  GuiControl, , ActiveMsgBoxes, 1
Else
  GuiControl, , ActiveMsgBoxes, 0
If (ActiveTrayTips)
  GuiControl, , ActiveTrayTips, 1
Else
  GuiControl, , ActiveTrayTips, 0
If (ActiveStartMenu)
  GuiControl, , ActiveStartMenu, 1
Else
  GuiControl, , ActiveStartMenu, 0
If (ActiveTaskbar)
  GuiControl, , ActiveTaskbar, 1
Else
  GuiControl, , ActiveTaskbar, 0
Return

Exit:
ExitApp
Return

Now you can change the transparency of: the takbar, the start menu, other menus, message boxes and tooltips
(I´m working on tray tips now).
Every change is saved in an ini, and you can easily disable the transparency in the GUI (the transparency will be undone, too).

_________________
COMPLETELY INACTIVE - I do not use AHK anymore.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 3:21 pm 
Offline

Joined: November 26th, 2006, 8:10 pm
Posts: 77
Ok, GOT IT, the transparency works great, through there is a brief flicker where it seems to render at 100% which is kinda annoying, --- is that fixable you think? :-)

Also too, in this latest 0.2 code, is it possible to further modify the seperate menu items (While transparent?)

Have a wonderful weekend, thank you so much!

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 3:49 pm 
Offline

Joined: April 9th, 2007, 4:43 pm
Posts: 172
It flickers because of SetTimer. It also flickers when I use Loop (I use Set Timer because it doesn´t need much CPU).
I think it isn´t possible to stop the flickering.
Quote:
Is it possible to further modify the seperate menu items?

You can set the transparency as you´d like, for example you can set the tasbar to 20% and the start menü to 50% and menus to 60% if you like.
If you make changes in the options, every change will be taken over, for example:
You set the transparency of message boxes (while a message box is visible) from 20% to 80%. The message box will be shown with a transparency of 80% instead of 20% if you click the OK-button.

_________________
COMPLETELY INACTIVE - I do not use AHK anymore.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 4:53 pm 
Offline

Joined: November 26th, 2006, 8:10 pm
Posts: 77
Very cool, sometimes Windows makes it hard :(

Lastly, how about the integration of custom menus into the transparency? It may seem more obvious to you how to join them, I have not been successful yet.

You are a genius! Thanks for your insight and helpfullness so much. -- ANGIE

(AND just to clarify, for me, I am most interested in having the default desktop Context menu, that is the menu when you Right-Click on desktop. Your earlier code snippet addressed it perfectly, but I cannot get that to be transparent with my best effort, or your transparent code knocks it back to 100% non-transparent when I join them together :( either way doesn't work.... can you pls. help me with that?)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 5:09 pm 
Offline

Joined: November 26th, 2006, 8:10 pm
Posts: 77
Also hey too, if you can figure out how to change font sizes/style, I'll create a Ascii-Model Tribute to your programming pro-ness and post it online! 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 5:24 pm 
Offline

Joined: April 9th, 2007, 4:43 pm
Posts: 172
AngieX
Thanks for the roses, I get red...
Make sure you checked the boxes...

On my computer it works fine.

_________________
COMPLETELY INACTIVE - I do not use AHK anymore.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 5:37 pm 
Offline

Joined: November 26th, 2006, 8:10 pm
Posts: 77
Almost....

let's say how do you get 60% transparency with this routine


Code:
CreateMenu:
Menu, RunMenu, Add, Editor, RunEditor
Menu, RunMenu, Add, Explorer, RunExplorer
Menu, Menu1, Add, Run, :RunMenu
Menu, Menu1, Add, Switch between tasks, KeyAltTab
Menu, Menu1, Add, ,
Menu, Menu1, Add, Deactivate, Disable
Menu, Menu1, Add, ,
Menu, Menu1, Add, Exit, Exit
Return

:D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 5:57 pm 
Offline

Joined: April 9th, 2007, 4:43 pm
Posts: 172
I run both, because I don´t know a possibility to make a script makes its own menu transparent, but you could start TransMenu at the other scripts start.

I figured out how to change the background color: Menu, Menu1, Color, [Color]

_________________
COMPLETELY INACTIVE - I do not use AHK anymore.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 6:18 pm 
Offline

Joined: November 26th, 2006, 8:10 pm
Posts: 77
Ta-da! Thank you! I see how that can work. If you can think of any way to advance this further then please post it



""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""\\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""/_);"""".-"""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""\_/\"""/JOHNW"""\""""""""""""""""""""""""""""""""""""""""""""""""
""""\""\""\.---.""""|"""""""""""""""""""""""""""""""""""""""""""""""
"""""\""\"|'<"'"`D"/""""""""""""""""""""""""""""""""""""""""""""""""
""""""\""\"\"-""";'"""""""""""""""""""""""""""""""""""""""""""""""""
"""""""\""`\;---(__"""""""""""""""""""""""""""""""""""""""""""""""""
""""""""\""|`"""`/"`-._"""""""""""""""""""""""""""""""""""""""""""""
"""""""""\/"I"AM"\_""""'."""""""""""""""""""""""""""""""""""""""""""
""""""""""|"#1"""|`;-""/"""""""""""""""""""""""""""""""""""""""""""
""""""""""|"ON """.-\_.-'""""""""""""""""""""""""""""""""""""""""""""
""""""""""|EARTH!"/-)/""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""|-------|"""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""|""L""""|"""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""|""|""""|"""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""|"";""""|"""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""/""|\"""|"""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""\""T"\_"|"""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""|""|"|""|"""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""_|__|"|""|"""""""""""""""""""""""""""""""""""""""""""""""""
""""""""(__.-'"|__|"""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""(__/"""".'""`."""""""""""""""""""""""""""""""""""""""
"""""""""""""""""_.-'/""|""\/-."""""""""""""""""""""""""""""""""""""
"""""""""""""_.-""",|""/""a"`-._'-""""""""""""""""""""""""""""""""""
"""""""""".-"""ANGIEX"`--""-.__.'"'-._'-._""""""""""""""""""""""""""""
""""""`-'`ACE CODER__.--._)========'-._]"""""""""""""""""""""""""""
""""""."""""""""""".'"""""|"""""""""""""|"""""""""""""""""""""""""""
""""""|"""""/,_.-'""""""""|""PUSHING""|"""""""""""""""""""""""""""
""""_/"""_.'("""""""""""""|""AHK"BOX""""|"""""""""""""""""""""""""""
"""/"",-'"\""\""""""""""""|"""""""""""""|"""""""""""""""""""""""""""
"""\""\""""`-'""""""""""""|"""""""""""""|"""""""""""""""""""""""""""
""""`-'"""""""""""""""""""'-------------'"""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TRIBUTE TO HONORABLE JOHN W (!) AND ADVANCED PROGRAMMING, AND GOOD SPIRITS!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 6:52 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8647
Location: Salem, MA
AngieX wrote:
Code:
                                                                   
   \\                                                               
   /_);    .------.
   \_/\   /JOHNW   \                                               
    \  \  \.---.    |                                               
     \  \ |'< ' `D /                                               
      \  \ \ -   ;'                                                 
       \  `\;---(__                                                 
        \  |`   `/ `-._                                             
         \/ I AM \_    '.                                           
          | #1   |`;-  /                                           
          | ON    .-\_.-'                                           
          |EARTH! /-)/                                               
          |-------|                                                 
          |  L    |                                                 
          |  |    |                                                 
          |  ;    |                                                 
          /  |\   |                                                 
          \  T \_ |                                                 
          |  | |  |                                                 
         _|__| |  |                                                 
        (__.-' |__|                                                 
               (__/    .'  `.                                       
                 _.-'/  |  \/-.                                     
             _.-   ,|  /  a `-._'-                                 
          .-   ANGIEX `--  -.__.' '-._'-._                         
      `-'`ACE CODER__.--._)========'-._]                     
      .            .'     |             |                               
      |     /,_.-'        |  PUSHING    |                         
    _/   _.'(             |  AHK BOX    |                           
   /  ,-' \  \            |             |                           
   \  \    `-'            |             |                           
    `-'                   '-------------'                           
                                                                   

TRIBUTE TO HONORABLE JOHN W (!) AND ADVANCED PROGRAMMING, AND GOOD SPIRITS!


I put it in a code box to fix the alignment., and made it use spaces. hope you don't mind.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2007, 7:01 pm 
Offline

Joined: November 26th, 2006, 8:10 pm
Posts: 77
Ah Perfect :)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Cerberus, KenC, kwfine and 77 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group