AdmiralAlkex Posted October 15, 2007 Share Posted October 15, 2007 (edited) Hi! I noticed today while running Vista that if you put the Sidebar on "Always on top" and then maximize a window (anyone) it gets opaque instead of transparent and that got me wondering..... Would that effect be possible to get with AutoIt?? My first thought was I needed to trap some windows message but i dont have a clue where to start I also gave "Winspector Spy" a try but couldn't really understand it by myself and the help wouldn't open and on top of that it didn't seem to work as supposed Vista.... I would be really happy if someone could give me some help with this!! Edited October 15, 2007 by TzarAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
weaponx Posted October 15, 2007 Share Posted October 15, 2007 I'm confused are you saying that when you have the sidebar set to "Always on top", a maximized window will override this? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 15, 2007 Author Share Posted October 15, 2007 (edited) I'm confused are you saying that when you have the sidebar set to "Always on top", a maximized window will override this?Maybe I could have explained in a better way... in Windows Vista you have a app called Windows Sidebar which is basically a Appbar(application desktop toolbar). It works in the same manner of the Taskbar (can work as a normal window or be there permanently)It would be much easier if you could google or just try for yourself cause i am not really good at explaining things......Oh and also plz excuse me for a late reply but something is not rigth on my internet (it first worls a few secs and then doesn't for a much longer time making anything on the internet really hard to do) Edited October 15, 2007 by TzarAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
weaponx Posted October 15, 2007 Share Posted October 15, 2007 (edited) I am clear on what the Sidebar is; however, I cannot visualize what is happening without running Vista myself.I noticed today while running Vista that if you put the Sidebar on "Always on top" and then maximize a window (anyone) it gets opaque instead of transparentIn this line you say "it gets opaque", are you referring to the Sidebar or to the newly maximized window?And just for clarity, when you say "opaque" you mean NOT transparent whatsoever. Edited October 15, 2007 by weaponx Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 15, 2007 Author Share Posted October 15, 2007 (edited) In the settings for the Sidebar you have a checkbox with the text "Sidebar is always on top of other windows". When that is on but no window are maximized the Sidebar is transparent, i. e. you can for example see your wallpaper through it. When it is on but you have something maximized(but not also minimized!!) the Sidebar gets opaque, i. e. nothing gets through it, you only see a solid color Edited October 15, 2007 by TzarAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Uten Posted October 15, 2007 Share Posted October 15, 2007 When a window is maximized use WinSetTrans ( "title", "text", transparency ) to make it opaque and back again when restored? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 15, 2007 Author Share Posted October 15, 2007 (edited) When a window is maximized use WinSetTrans ( "title", "text", transparency ) to make it opaque and back again when restored?Two things about that.... 1. How the heck would i do that, and even if i found out a way wouldn't it require large loops that consume much CPU?? 2. That would confine me to Win 2000 or later (i like to have as few restraints as possible) In my opinion SetBitmap would be better in my case and I am experimenting with it right now, the real problem I think would be to know when it exists a maximized window..... (hopefully avoiding large loops and such that eat all our cpu) Edited October 15, 2007 by TzarAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Nathan89 Posted October 15, 2007 Share Posted October 15, 2007 Let me see if I understand. You are trying to create a program similar to the Windows Sidebar so when you open it, the program will be "Always on top"? Link to comment Share on other sites More sharing options...
Uten Posted October 15, 2007 Share Posted October 15, 2007 (edited) Two things about that....1. How the heck would i do that, and even if i found out a way wouldn't it require large loops that consume much CPU??Just do a check against a window when it gets focus, take a look at WinWaitNotActive.2. That would confine me to Win 2000 or later (i like to have as few restraints as possible)Why not mention that in your first post?In my opinion SetBitmap would be better in my case and I am experimenting with it right now, the real problem I think would be to know when it exists a maximized window..... (hopefully avoiding large loops and such that eat all our cpu)WinWaitNotActive and a simple check when it changes.EDIT: WinWaitActive//WinWaitNotActive Edited October 15, 2007 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 15, 2007 Author Share Posted October 15, 2007 Hi again!! I just had to post some answers to Uten and show you a TEMPORARY solution i maneged to code, it works but could probably be improved a lot AdlibEnable("Adlib", 2500) Func Adlib() $WinList = WinList() $Maximized = 0 For $List3 = 1 To $WinList[0][0] $State = WinGetState($WinList[$List3][1]) If BitAnd($State, 32) Then $Maximized = 1 Next If $Maximized = 1 Then WinSetTrans("SomeApp", "", 255) Else WinSetTrans("SomeApp", "", 230) EndIf EndFunc Just do a check against a window when it gets focus, take a look at WinWaitNotActive.I really dont understand what this has to do with anything, i believe one of us have missunderstood the other Why not mention that in your first post?You like restraints?? WinWaitNotActive and a simple check when it changes.Same as two steps above..... .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
therks Posted October 15, 2007 Share Posted October 15, 2007 2. That would confine me to Win 2000 or later (i like to have as few restraints as possible)If you want transparency you're gonna be stuck with that restraint anyway. IIRC nothing before Win2k allowed for transparent windows (except for some 3rd party software). Unless you want to go from HIDDEN to VISIBLE? But I interpreted your post to mean you wanted to go from semi-transparent to fully opaque. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
SadBunny Posted October 15, 2007 Share Posted October 15, 2007 If you want transparency you're gonna be stuck with that restraint anyway. IIRC nothing before Win2k allowed for transparent windows (except for some 3rd party software). Unless you want to go from HIDDEN to VISIBLE? But I interpreted your post to mean you wanted to go from semi-transparent to fully opaque.As far as I know, the WinSetTrans only works on systems that support it, but give no problem when tried on a system that doesn't support it. So you can just fire the command anyway, and it will just not work when in pre-trans-age OS. But then again, since you only need it in Vista, why not first check @OSVersion and only do the command if you have Vista?Just my 2 ct. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 15, 2007 Author Share Posted October 15, 2007 If you want transparency you're gonna be stuck with that restraint anyway. IIRC nothing before Win2k allowed for transparent windows (except for some 3rd party software). Unless you want to go from HIDDEN to VISIBLE? But I interpreted your post to mean you wanted to go from semi-transparent to fully opaque.My idea was to try the method lod3n used here since that method uses the GDI+ dll which is available to Win98 and upwards I was hoping that would work, but I have neither converted my guis to .png or installed Win98 so that will have to wait cause i must get some sleep now...... (time is 1 am here and I am almost sleeping on the keyboard) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 15, 2007 Author Share Posted October 15, 2007 But then again, since you only need it in Vista, why not first check @OSVersion and only do the command if you have Vista?When did I say that?? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
therks Posted October 15, 2007 Share Posted October 15, 2007 expandcollapse popup#include <GUIConstants.au3> Dim $hActive, $hMaximized, $bIsOpaque = False $gui = GUICreate('', 200, 200) WinSetOnTop($gui, '', 1) WinSetTrans($gui, '', 128) GUISetState() While 1 $hCheckActive = WinGetHandle('[ACTIVE]'); Get handle of active window If $hActive <> $hCheckActive Then; If active window has changed... $hMaximized = _FindMaximized(); Look for maximized windows, store in $hMaximized for later reference If $hMaximized Then; If a max'd window is found... _SetOpaque(True, $bIsOpaque) Else; If not... _SetOpaque(False, $bIsOpaque) EndIf $hActive = $hCheckActive Else; If active window has NOT changed... $iState = WinGetState($hActive); Get the state of the active window If BitAND($iState, 32) Then; If active window is maximized, go opaque $hMaximized = $hActive _SetOpaque(True, $bIsOpaque) ElseIf $hMaximized = $hActive Then; If active window is NOT maximized, but WAS maximized before... $hMaximized = _FindMaximized(); Look for any other maximized windows, store in $hMaximized for later reference If Not $hMaximized Then; If no max'd window is found... _SetOpaque(False, $bIsOpaque) EndIf EndIf EndIf $gm = GUIGetMsg() Switch $gm Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _SetOpaque($bGoOpaque, ByRef $bIsOpaque, $i = @ScriptLineNumber) If Not $bGoOpaque And $bIsOpaque Then WinSetTrans($gui, '', 128) ElseIf $bGoOpaque And Not $bIsOpaque Then WinSetTrans($gui, '', 255) EndIf $bIsOpaque = $bGoOpaque EndFunc Func _FindMaximized() Local $aWinList, $iState $aWinList = WinList() For $i = 1 to $aWinList[0][0] $iState = WinGetState($aWinList[$i][1]) If BitAND($iState, 32) And BitAND($iState, 2) Then Return $aWinList[$i][1] Next Return False EndFunc My AutoIt Stuff | My Github 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