death pax Posted February 23, 2006 Share Posted February 23, 2006 (edited) Just a little Program I made earlier today ^.^ expandcollapse popup#include <GuiConstants.au3> Opt("TrayMenuMode", 1) HotKeySet("^+{NUMPADSUB}", "SetTrans") $Tray_Prefs = TrayCreateItem("Preferences") TrayCreateItem("") $Tray_About = TrayCreateItem("About") TrayCreateItem("") $Tray_Exit = TrayCreateItem("Exit") TraySetState() While 1 $Traymsg = TrayGetMsg() Select Case $Traymsg = $Tray_Prefs MsgBox(64, "Preferences:", "Preferences go Here") Case $Traymsg = $Tray_About MsgBox(64, "About:", "Transparent Windows was created by:" & @CRLF & "Death Pax of Disillusioned Designs") Case $Traymsg = $Tray_Exit ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit Func SetTrans() $Window = GetActiveWindow() $GUI_Main = GUICreate("Transparent Windows", 343, 142, 192, 125) GUICtrlCreateLabel("Currently Selected Window:", 8, 8, 135, 17) GUICtrlCreateLabel(WinGetTitle($Window), 24, 32, 295, 17, $SS_LEFTNOWORDWRAP) $Slider_Transparency = GUICtrlCreateSlider(8, 56, 329, 25) GUICtrlSetLimit($Slider_Transparency, 100, 0) GUICtrlSetData($Slider_Transparency, 100) $Label_TransPercent = GUICtrlCreateLabel("100 %", 146, 82, 50, 25, $SS_CENTER) GUICtrlCreateLabel("0", 15, 82, 15, 15) GUICtrlCreateLabel("100", 312, 82, 25, 15) $Button_SetTrans = GUICtrlCreateButton("Set Transparency", 8, 106, 161, 33) $Button_Cancel = GUICtrlCreateButton("Cancel", 176, 106, 161, 33) GUICtrlSetColor(-1, 0x0080C0) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_Cancel GUIDelete($GUI_Main) ExitLoop Case $msg = $Slider_Transparency GUICtrlSetData($Label_TransPercent, GUICtrlRead($Slider_Transparency) & " %") Case $msg = $Button_SetTrans WinSetTrans($Window, "", 255 * (GUICtrlRead($Slider_Transparency) / 100)) Case Else ;;;;;;; EndSelect WEnd EndFunc ;==>SetTrans Func GetActiveWindow() Dim $return $var = WinList() For $i = 1 To $var[0][0] If $var[$i][0] <> "" And IsVisible($var[$i][1]) And WinActive($var[$i][1]) Then Return $var[$i][1] EndIf Next EndFunc ;==>GetActiveWindow Func IsVisible($handle) If BitAND( WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible Later on i do plan on adding a preferences screen to change the hotkey, and add an ini file to store it in Any Comments/Suggestions are welcome, and if anyone knows how to retrieve current transparency of a window, plz tell me ^.^ Edited February 23, 2006 by death pax Link to comment Share on other sites More sharing options...
GaryFrost Posted February 23, 2006 Share Posted February 23, 2006 Everyone finds it sooner or later http://www.autoitscript.com/forum/index.ph...indpost&p=74823 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
death pax Posted February 24, 2006 Author Share Posted February 24, 2006 (edited) yeah i was bored,im running out of things to do >.> i assumed that others had done it already Edited February 24, 2006 by death pax Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now