Jump to content

How The Heck Do I Get This Window Transparent?


Recommended Posts

I don't know why but this script doesn't set istelf transparent, it only does that when there is two of them open :) how can I set the window to be transparent on start?

Opt("wintitlematchmode",4)
$trans = WinSetTrans("My GUI", "", 220)
#include <GUIConstants.au3>
GUICreate ("My GUI") 
GUISetState ($trans)      
_settrancs()
    
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
    
Func _settrancs()
WinSetState("My GUI","",$trans)
EndFunc
Link to comment
Share on other sites

You might want to try creating the window before u set the transparency

Opt("wintitlematchmode",4)

#include <GUIConstants.au3>
GUICreate ("My GUI")    
$trans = WinSetTrans("My GUI", "", 220)
GuiSetState()
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

That works for me...

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Try this effect.

#include <GUIConstants.au3>
GUICreate ("My GUI")
GUISetState(@SW_HIDE)
WinSetTrans("My GUI", "", 220)
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Link to comment
Share on other sites

  • Moderators

FYI... Just because you have it stored in a variable, doesn't mean it isn't called... what is stored in the variable with WinSetTrans() the way you have it,

Success: Returns Non-zero.

Failure: Returns 0, @error will be set to 1 if the function isn't supported on an OS.

So when you are calling $trans you are returning the number it was originally called, not the function....

An alternative could be:

Opt("wintitlematchmode",4)
#include <GUIConstants.au3>
$Main = GUICreate("My GUI")
_settrancs($Main, 100)
GUISetState ()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
    
Func _settrancs($window, $trans)
    WinSetTrans($window, '', $trans)
EndFunc

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

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...