Jump to content

Vista type transparency


James
 Share

Recommended Posts

Wow Secure_ICT you sure did outpost me in no time at all... Maybe it's the fact I hate free post topics and try my hardest to avoid them at all costs, therefore only posting where it is necessary? (I have made some useless posts that don't help anyone such as this one).

- Dan [Website]

Link to comment
Share on other sites

After having Vista for a while I got obsessed with the windows media player transparency. Then my computer broke and XP came back.

Secure

Hey, I thought I'd try to improve your code(hope you don't mind :P )... I added a combo box that shows all the current windows... However it has lots of bugs and I need to get to bed...

; Name: Windows Media Player Transparency
; Author: Secure_ICT ;Edited for multiple windows by Piano_Man
; Version: 1.2
; Credit given to: Helge and ThatsGreat2345

#include <GUIConstants.au3>

$currentTrans = ''
$nowShown = ''
$reset = False

GUICreate("Set Transparency",320,170, 100,200) 
GuiCtrlCreateLabel('Choose a wdow...', 10, 10, 300, 20)
$window = GuiCtrlCreateCombo('', 10, 30, 300, 20)
$slider = GUICtrlCreateSlider (10,60,300,20)
GUICtrlSetLimit(-1,250,0)
GuiCtrlSetData(-1, 250)
$set = GUICtrlCreateButton ("Set State",60,110,90,30)
$reset = GUICtrlCreateButton ("Reset",170,110,90,30)
AdLibEnable('_UpDate', 250)
GUISetState()

Do
  $n = GUIGetMsg ()
       If $n = $set Then           
           $selected = GuiCtrlRead($window)
           If $currentTrans <> $selected and $reset = False then
                WinSetTrans($currentTrans, "", 250) 
                $reset = False
            Endif
            WinSetTrans($selected, "", GUICtrlRead($slider)) 
            $currentTrans = $selected
       Endif
       If $n = $reset Then 
           $reset = True
           WinSetTrans($selected, "", 250) 
           GUICtrlSetData($slider,250)
       EndIf
Until $n = $GUI_EVENT_CLOSE
   
If WinExists($currentTrans) then WinSetTrans($currentTrans, "", 250) 

 Func _UpDate()
    $shown = ''
    $list = WinList()
    If IsArray($list) Then 
        For $a = 1 to $list[0][0]
            If $list[$a][0] <> '' and IsVisible($list[$a][1]) then $shown = $shown & $list[$a][0] & "|" 
        Next
    Endif
    If $nowShown <> $shown then GuiCtrlSetData($window, $shown)
    $nowShown = $shown
Endfunc

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf
EndFunc

Example of bugs: List doesn't compile correctly if the windows change and there's this weird flashing black thing that happens to the window for some reason.. that might just be my computer... Let me know what you think!

Edit: It also lags when you try to drag the box.. I don't know why, the 250 Adlib shouldn't be confusing it (once again, my computer isn't the greatest... :"> )

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Making windows transparent

#include <GUIConstants.au3>
#Include <GuiCombo.au3>

; == GUI generated with Koda ==
$Form1 = GUICreate("Making Windows Transparent", 550, 24, 0, 0, BitOr($WS_CAPTION, $WS_SYSMENU))
$Combo1 = GUICtrlCreateCombo("", 0, 0, 281, 21, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL, $CBS_DROPDOWNLIST))
$Slider1 = GUICtrlCreateSlider(280, 0, 270, 21)
GuiCtrlSetLimit(-1, 255, 0)
GUISetState(@SW_SHOW)

AdlibEnable('RebuildComboBox')
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
     Case $msg = $Slider1
        If GUICtrlRead($Combo1) == '' Then ContinueLoop
        WinSetTrans(GUICtrlRead($Combo1), '', Abs(Number(GuiCtrlRead($Slider1) - 255)))    
    Case Else
        ;;;;;;;
    EndSelect
WEnd
Exit

Func RebuildComboBox()
   Local $listItems
   Dim $var = WinList()

   For $i = 1 to $var[0][0]
      ; Only display visble windows that have a title
      If $var[$i][0] <> "" AND IsVisible($var[$i][1]) And $var[$i][0] <> "Program Manager" And $var[$i][1] <> $Form1 Then
         If _GUICtrlComboFindString($Combo1, $var[$i][0]) == $CB_ERR Then
            _GUICtrlComboAddString($Combo1, $var[$i][0])
         EndIf
      EndIf
   Next

   $listItems = StringSplit(_GUICtrlComboGetList($Combo1, '|'), '|')
   For $x = 1 To $listItems[0]
      If Not WinExists($listItems[$x]) Then
         _GUICtrlComboDeleteString($Combo1, _GUICtrlComboFindString($Combo1, $listItems[$x]))
      EndIf
   Next
EndFunc

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf
EndFunc
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

Agh! I Set my desktop's transparency and now the desktop won't re-paint itself! What should i do?

How'd you pull that off? I don't see where there's a window title for desktop.... but anwyays, Just make a one line code:

WinSetTrans('Desktop' '', 250)

Seems kind of simple, let me know if I misunderstood the problem

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Making windows transparent

#include <GUIConstants.au3>
#Include <GuiCombo.au3>

; == GUI generated with Koda ==
$Form1 = GUICreate("Making Windows Transparent", 550, 24, 0, 0, BitOr($WS_CAPTION, $WS_SYSMENU))
$Combo1 = GUICtrlCreateCombo("", 0, 0, 281, 21, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL, $CBS_DROPDOWNLIST))
$Slider1 = GUICtrlCreateSlider(280, 0, 270, 21)
GuiCtrlSetLimit(-1, 255, 0)
GUISetState(@SW_SHOW)

AdlibEnable('RebuildComboBox')
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
     Case $msg = $Slider1
        If GUICtrlRead($Combo1) == '' Then ContinueLoop
        WinSetTrans(GUICtrlRead($Combo1), '', Abs(Number(GuiCtrlRead($Slider1) - 255)))    
    Case Else
        ;;;;;;;
    EndSelect
WEnd
Exit

Func RebuildComboBox()
   Local $listItems
   Dim $var = WinList()

   For $i = 1 to $var[0][0]
      ; Only display visble windows that have a title
      If $var[$i][0] <> "" AND IsVisible($var[$i][1]) And $var[$i][0] <> "Program Manager" And $var[$i][1] <> $Form1 Then
         If _GUICtrlComboFindString($Combo1, $var[$i][0]) == $CB_ERR Then
            _GUICtrlComboAddString($Combo1, $var[$i][0])
         EndIf
      EndIf
   Next

   $listItems = StringSplit(_GUICtrlComboGetList($Combo1, '|'), '|')
   For $x = 1 To $listItems[0]
      If Not WinExists($listItems[$x]) Then
         _GUICtrlComboDeleteString($Combo1, _GUICtrlComboFindString($Combo1, $listItems[$x]))
      EndIf
   Next
EndFunc

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf
EndFunc
That's cool... sort of what I was aiming (and missing) to do
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 3 weeks later...
  • 5 weeks later...

TRASPARENCE.au3 for Media player 11 and Mycomputer and other folders. OS Windows XP with theme Longhorn and icolorforder.

Posted Image

CODE:

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.2.0

Author: HAL9000

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <Misc.au3>

opt("WinTitleMatchMode", 4)

TraySetToolTip("TRASPARENCE")

$dll = DllOpen("user32.dll")

while 1

select

case _IsPressed("04", $dll) AND ControlGetFocus ("classname=CabinetWClass")

WinSetTrans("classname=CabinetWClass", "", 175) ;04 Middle mouse button

case _IsPressed("1B", $dll) AND ControlGetFocus ("classname=CabinetWClass")

WinSetTrans("classname=CabinetWClass", "", 255); 1B ESC key

case _IsPressed("04", $dll) AND ControlGetFocus ("classname=WMPlayerApp")

WinSetTrans("classname=WMPlayerApp", "", 175)

case _IsPressed("1B", $dll) AND ControlGetFocus ("classname=WMPlayerApp")

WinSetTrans("classname=WMPlayerApp", "", 255)

Endselect

WEnd

DllClose($dll)

Link to comment
Share on other sites

Thats looking nice. Well done Hal

Maybe this code is better :

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.2.0

Author: Hal9000

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <Misc.au3>

opt("WinTitleMatchMode", 4)

TraySetToolTip("TRASPARENCE")

$dll = DllOpen("user32.dll")

while 1

Sleep (1) ;reduce cpu usage

select

; more windows and no problems with desktop

case _IsPressed("04", $dll) and ControlGetFocus ("active") <> "SysListview321"

WinSetTrans("active", "", 175)

case _IsPressed("1B", $dll) AND ControlGetFocus ("active") <> "SysListview321"

WinSetTrans("active", "", 255)

;My computer and other folders

case _IsPressed("04", $dll) AND ControlGetFocus ("classname=CabinetWClass")

WinSetTrans("classname=CabinetWClass", "", 175)

case _IsPressed("1B", $dll) AND ControlGetFocus ("classname=CabinetWClass")

WinSetTrans("classname=CabinetWClass", "", 255)

; WMP

case _IsPressed("04", $dll) AND ControlGetFocus ("Windows Media Player")

WinSetTrans("Windows Media Player", "", 175)

case _IsPressed("1B", $dll) AND ControlGetFocus ("Windows Media Player")

WinSetTrans("Windows Media Player", "", 255)

Endselect

WEnd

DllClose($dll)

; end code

Link to comment
Share on other sites

Hi,

havn't test it yet but i saw this:

HotKeySet("0", "urgeerbestingenprotest")
HotKeySet("1", "urgeerbestingenprotest")
HotKeySet("2", "urgeerbestingenprotest")
HotKeySet("3", "urgeerbestingenprotest")
HotKeySet("4", "urgeerbestingenprotest")
HotKeySet("5", "urgeerbestingenprotest")
HotKeySet("6", "urgeerbestingenprotest")
HotKeySet("7", "urgeerbestingenprotest")
HotKeySet("8", "urgeerbestingenprotest")
HotKeySet("9", "urgeerbestingenprotest")
oÝ÷ Ù©ÝØhºm¶­Ê¢é]­êeiÇ¢·­Øb±«­¢+Ø)½ÈÀÌØí¡½Ñ­åÍÑ­äôÀѼä(%!½Ñ-åMÐ ÀÌØí¡½Ñ­åÍÑ­ä°ÅÕ½ÐíÕÉÉÍÑ¥¹¹ÁɽÑÍÐÅÕ½Ðì¤)¹áÐ

It's a bit shorter :">

Arjan

P.S. you might want to look at this, i made it a vew months ago: http://www.autoitscript.com/forum/index.ph...=0&p=252907

Edited by arjan staring
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...