Sign in to follow this  
Followers 0
xStylezx

InputBox and WinSetTrans

5 posts in this topic

Just wanted to say first that i love autoit.At first glance it can seem a bit daunting,but im learning more every day.Now if i could just remember it all :)

Now for the problem.I imagine its fairly simple but ive had no luck getting it figured out so far.Im using an inputbox to set the level of transparency of firefox.It is working great ,but the issue is that if you decide to hit cancel inside the input box it seems to apply a value of 0 which makes firefox invisible.I then have to open inputbox again and set a value of 255 to be able to see the fox again.How would i stop it from altering the transparency if cancel is clicked?Here is a peak at what i have,which is working fine except for the problem i just mentioned

$transcust = InputBox ( "Enter Transparency Customization", "Use a number from 0-255." & @CRLF & "0 being invisible,and 255" & @CRLF & "being solid,or completely" & @CRLF & "visible.Canceling will set 0," & @CRLF & "or invisible", "255", " M")
             If WinActive("[CLASS:MozillaUIWindowClass]", "") Then
             WinSetTrans("[CLASS:MozillaUIWindowClass]", "", $transcust)
 Else
             WinActivate("[CLASS:MozillaUIWindowClass]", "")
             WinSetTrans("[CLASS:MozillaUIWindowClass]", "", $transcust)
 EndIf

Thanks for the help :)

:)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$transcust = InputBox("Enter Transparency Customization", "Use a number from 0-255." & @CRLF & "0 being invisible,and 255" & @CRLF & "being solid,or completely" & @CRLF & "visible.Canceling will set 0," & @CRLF & "or invisible", "255", " M")
If Not @error Then
    If WinActive("[CLASS:MozillaUIWindowClass]", "") Then
        WinSetTrans("[CLASS:MozillaUIWindowClass]", "", $transcust)
    Else
        WinActivate("[CLASS:MozillaUIWindowClass]", "")
        WinSetTrans("[CLASS:MozillaUIWindowClass]", "", $transcust)
    EndIf
EndIfoÝ÷ Ù±!?Û+))¢Íçoz»"¢v®¶­sbb33c·G&ç67W7BÒçWD&÷gV÷C´VçFW"G&ç7&Væ77W7FöÖ¦FöâgV÷C²ÂgV÷CµW6RçVÖ&W"g&öÒÓ#SRâgV÷C²fײ5$ÄbfײgV÷C³&Værçf6&ÆRÆæB#SRgV÷C²fײ5$ÄbfײgV÷C¶&Vær6öÆBÆ÷"6ö×ÆWFVÇgV÷C²fײ5$ÄbfײgV÷C·f6&ÆRä6æ6VÆærvÆÂ6WBÂgV÷C²fײ5$ÄbfײgV÷C¶÷"çf6&ÆRgV÷C²ÂgV÷C³#SRgV÷C²ÂgV÷C²ÒgV÷C²¤bæ÷BW'&÷"FVà bæ÷Bvä7FfRgV÷Cµ´4Ä53¤Ö÷¦ÆÆTvæF÷t6Æ75ÒgV÷C²ÂgV÷C²gV÷C²FVà vä7FfFRgV÷Cµ´4Ä53¤Ö÷¦ÆÆTvæF÷t6Æ75ÒgV÷C²ÂgV÷C²gV÷C² VæD` vå6WEG&ç2gV÷Cµ´4Ä53¤Ö÷¦ÆÆTvæF÷t6Æ75ÒgV÷C²ÂgV÷C²gV÷C²Âb33c·G&ç67W7B¤VæD`

Edited by Zedna

Share this post


Link to post
Share on other sites

Excellent,it works,and thanks for the quick response.Could you by chance elaborate on how/why yours is optimized?Im trying to learn as much as possible.Was scratching my head a couple hours about that :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Excellent,it works,and thanks for the quick response.Could you by chance elaborate on how/why yours is optimized?Im trying to learn as much as possible.Was scratching my head a couple hours about that :)

optimization:

WinSetTrans("[CLASS:MozillaUIWindowClass]", "", $transcust)

is only once in my code (smaller output EXE)

Edited by Zedna

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

optimization:

WinSetTrans("[CLASS:MozillaUIWindowClass]", "", $transcust)

is only once in my code (smaller output EXE)

Oh ok,thanks.I havent played with If Not yet,that was in your code,interesting. Edited by xStylezx

Share this post


Link to post
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
Sign in to follow this  
Followers 0