Breezydog99 Posted August 24, 2006 Posted August 24, 2006 I've been trying to make MS Word transparent so I can put images or a movie behind it while I type(I hate stareing at a white screen). This is what I've come up with but it doesnt work... anyone know why or what I'm doing wrong? #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 152,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $WinName = GUICtrlCreateInput("Window Name", 10, 10, 370, 20) $Slider_2 = GuiCtrlCreateSlider(10, 50, 370, 25) ;$Label_3 = GuiCtrlCreateLabel("Current transperency", 10, 80, 370, 20) $Button_4 = GuiCtrlCreateButton("Set", 10, 120, 370, 20) GuiCtrlSetLimit($Slider_2, 255, 0) GuiSetState() While 1 $slide = GuiCtrlRead($Slider_2) $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_4 WinSetTrans($WinName,"",$slide) Case Else ;;; EndSelect WEnd Exit
Paulie Posted August 24, 2006 Posted August 24, 2006 I've been trying to make MS Word transparent so I can put images or a movie behind it while I type(I hate stareing at a white screen).This is what I've come up with but it doesnt work... anyone know why or what I'm doing wrong?WinSetTrans?
Danny35d Posted August 24, 2006 Posted August 24, 2006 #include <GuiConstants.au3> Opt("WinTitleMatchMode", 2) ; Match substring GuiCreate("MyGUI", 392, 152,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $WinName = GUICtrlCreateInput("Window Name", 10, 10, 370, 20) $Slider_2 = GuiCtrlCreateSlider(10, 50, 370, 25) ;$Label_3 = GuiCtrlCreateLabel("Current transperency", 10, 80, 370, 20) $Button_4 = GuiCtrlCreateButton("Set", 10, 120, 370, 20) GuiCtrlSetLimit($Slider_2, 255, 0) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_4 $slide = Number(GuiCtrlRead($Slider_2)) $AppName = GUICtrlRead($WinName) $ret = WinSetTrans($AppName, "", $slide) Case Else ;;; EndSelect WEnd ExitThis should work better for you, also keep in mind that you have to match any substring of the title.Ex: Windows title = AutoIt Forms -> Replying in Making windows transparent - M$ Internet Explorerif you type replying won't work because in the windows title start with upper case.if you type Replying work because is an exact match of a substring in the windows title.Sorry if I confuse you but English is my second language... AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Richard Robertson Posted August 24, 2006 Posted August 24, 2006 Window titles are checked using case specific checks. You must have the title capitalized properly for it to work.
Danny35d Posted August 24, 2006 Posted August 24, 2006 Yeah!! easy for you to said.... Thanks you for explain it. AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Kickassjoe Posted August 25, 2006 Posted August 25, 2006 OMG so simple, yet so usefull! lol What goes around comes around... Payback's a bitch.
Breezydog99 Posted August 25, 2006 Author Posted August 25, 2006 (edited) This is sweet, thank you! sadly transperency doesnt work in front of Windows Media Player(at least for AVI) Edited August 25, 2006 by Breezydog99
Danny35d Posted August 26, 2006 Posted August 26, 2006 (edited) expandcollapse popup#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), '', Number(GuiCtrlRead($Slider1))) 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 EndFuncI just add another twist into the script. No need for typing, the script is always checking for active windows and adding the title into the combobox. If any of the active windows close the script will remove the title from the combobox. Edited August 26, 2006 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
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