TK_Incorperate Posted August 26, 2007 Share Posted August 26, 2007 Whenever I call my function to set a transparency to a window, it will not do it. I've called this function over and over and nothing happens. I don't have the slightest clue what's wrong with it. I even have it search for the process ID, window name, and first word of the window name. Still no luck making it transparent. Help please? P.S. I know I use a GUI but it has nothing to do with my problem, so this doesn't go in GUI section. expandcollapse popup#include<misc.au3> #include<GUIConstants.au3> #include<string.au3> Global $Trans $Trans = 0 AutoItSetOption("PixelCoordMode", 2) $GUI1 = GUICreate("Chicken-Pix v1.4 -Lite-", 112, 40) GUISetState(@SW_SHOW, $GUI1) $Button1 = GUICtrlCreateButton("+", 90, 10, 12, 20) $Input1 = GUICtrlCreateInput("Transparent D2", 10, 10, 80, 20, $ES_AUTOhSCROLL+$ES_READONLY) While 1 $Msg = GUIGetMsg() If $Msg = $Button1 Then _Transparent() EndIf If ProcessExists("Diablo II.exe") = 0 Then ExitLoop EndIf Sleep(1000) WEnd Func _Transparent() $PID1 = ProcessExists("Diablo II.exe") If $Trans = 0 Then WinSetTrans($PID1, "", 100) Sleep(1) WinSetTrans("Diablo II", "", 100) Sleep(1) WinSetTrans("Diablo", "", 100) $Trans = 1 ElseIf $Trans = 1 Then WinSetTrans($PID1, "", 255) Sleep(1) WinSetTrans("Diablo II", "", 255) Sleep(1) WinSetTrans("Diablo", "", 255) $Trans = 0 EndIf Sleep(1) EndFunc Link to comment Share on other sites More sharing options...
Achilles Posted August 26, 2007 Share Posted August 26, 2007 (edited) Maybe try the AutoItWindow tool? Or make something (since your not getting the name right) use winlist to make tell you all the current windows and then one of those should be the one you want for the title. You could try this to: Opt("WinTitleMatchMode", 2) That will make is so that the title matches to any substring in the window title. Edited August 26, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
TK_Incorperate Posted August 26, 2007 Author Share Posted August 26, 2007 Well I tried your way, and it still didn't work. As far as making something to show me all current windows names, I have no clue how to do that, it is a good idea however. Link to comment Share on other sites More sharing options...
TK_Incorperate Posted August 26, 2007 Author Share Posted August 26, 2007 does anyone have a solution? this is a vita issue with my program, lol seeing as how its one of the main features Link to comment Share on other sites More sharing options...
Achilles Posted August 26, 2007 Share Posted August 26, 2007 (edited) does anyone have a solution? this is a vita issue with my program, lol seeing as how its one of the main featuresAlright, this is what I meant. Uncomment the commented code if you don't use Scite, that will it will right the windows to an .ini file which will be in the script directory. HotKeySet('1', '_ConsoleWriteList') While 1 Sleep(1000) WEnd Func _ConsoleWriteList() Local $temp = WinList() ;~ If FileExists(@ScriptDir & '\Open Windows.ini') then ;~ FileDelete(@ScriptDir & '\Open Windows.ini') ;~ EndIf ConsoleWrite(@CRLF & '+> Writing current windows in order of appearence' & @CRLF) For $a = 1 To $temp[0][0] If $temp[$a][0] <> "" And _IsVisible($temp[$a][1]) Then ;~ IniWrite(@ScriptDir & '\Open windows.ini', '_Current Windows', $a, $temp[$a][0]) ConsoleWrite('>Window name: ' & $temp[$a][0] & @CRLF) EndIf Next ConsoleWrite('+> Complete' & @CRLF) EndFunc ;==>_GetTopMost Func _IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>_IsVisible This way is should give you the actual name of the window which you be able to use in the WinSetTrans() Edited August 26, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
qazwsx Posted August 26, 2007 Share Posted August 26, 2007 isnt the max transparency 250? Link to comment Share on other sites More sharing options...
Achilles Posted August 26, 2007 Share Posted August 26, 2007 isnt the max transparency 250?255 = Solid, 0 = Invisible. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Siao Posted August 26, 2007 Share Posted August 26, 2007 (edited) Sleep() in the main GUIGetMsg loop always is a very bad thing to do. It's the reason why you don't see anything working - your GUI is unresponsive. And in any case, if you expect that the whole game window will become transparent, I think you'll be disappointed. I'm pretty sure only titlebar will become see-through. Edited August 26, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
TK_Incorperate Posted August 28, 2007 Author Share Posted August 28, 2007 Sleep() in the main GUIGetMsg loop always is a very bad thing to do.It's the reason why you don't see anything working - your GUI is unresponsive.And in any case, if you expect that the whole game window will become transparent, I think you'll be disappointed. I'm pretty sure only titlebar will become see-through.Sleep is used in every GUI ive ever created, it in absolutely no way makes GUI unresponsive. Ive been using it for as long as I've been using AutoItAs far as making the whole game screen transparent, I've done it before with AutoIt but deleted the script, WinSetTrans does work for the game, but I don't remember how I did it.~TK Link to comment Share on other sites More sharing options...
Siao Posted August 28, 2007 Share Posted August 28, 2007 Sleep is used in every GUI ive ever created, it in absolutely no way makes GUI unresponsive.Good for you "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 28, 2007 Moderators Share Posted August 28, 2007 (edited) Sleep is used in every GUI ive ever created, it in absolutely no way makes GUI unresponsive. Ive been using it for as long as I've been using AutoIt As far as making the whole game screen transparent, I've done it before with AutoIt but deleted the script, WinSetTrans does work for the game, but I don't remember how I did it. ~TKWhy in the world you use a sleep in a loop when you're already using GUIGetMsg() ? GUICreate("") GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch WEndYou're going to tell me you get the same response time? Edit: Holy mother of god, went to make the example include an Exit, and what a mess my edit ended up being. Edited August 28, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Achilles Posted August 28, 2007 Share Posted August 28, 2007 Edit:Holy mother of god, went to make the example include an Exit, and what a mess my edit ended up being.That's why I gave up on the AutoIt tags... I got sick of the 4!`!28$9d23^$sf57@#&8%43#9qp%fi*oas;djv*8%9f4ujvf9%#p8pjo@lsc My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Cyber Posted August 29, 2007 Share Posted August 29, 2007 i prefer use 254 and not 255 why? becouse from 254 to 255 the window do jump Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key 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