Jump to content

InputBox and WinSetTrans


Recommended Posts

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 :)

:)

Link to comment
Share on other sites

$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
Link to comment
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 :)

optimization:

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

is only once in my code (smaller output EXE)

Edited by Zedna
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...