Champak Posted May 26, 2007 Share Posted May 26, 2007 (edited) I know how to set the state of show and hide, but is there a way to detect if a window/gui is showing or hiding. I need to set up a function based on if the window is showing or not.....NOT active or not. Edited May 26, 2007 by Champak Link to comment Share on other sites More sharing options...
Generator Posted May 26, 2007 Share Posted May 26, 2007 You can think this way, if the windows is not acive and not visible, that means the windows is hidden. Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 26, 2007 Share Posted May 26, 2007 Hi, WinGetState So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
FreeFry Posted May 26, 2007 Share Posted May 26, 2007 (edited) If BitAND(WinGetState(WinGetTitle("Program Manager")), 2) Then MsgBox(0, "Visible", "Your desktop is visible!") Else MsgBox(0, "Hidden", "oh no!, your desktop is hidden!") EndIf Edited May 26, 2007 by FreeFry Link to comment Share on other sites More sharing options...
Champak Posted May 26, 2007 Author Share Posted May 26, 2007 Thanks, I didn't see that before. However, the values it shows in the manual are 1, 2, 4, 8, 16, 32. I'm getting a value of 15 and 5. Sometimes I am actually getting 7....I don't know why I'm getting that one. 15 shows up when the win is visible, and 5 shows up when the win is hidden. But the manual says 2 should be visible...it says nothing about hidden. 7 just seems to show up at random for no reason which throws everything off. What are the values of 5, 7, and 15 for? Link to comment Share on other sites More sharing options...
Generator Posted May 26, 2007 Share Posted May 26, 2007 Thanks, I didn't see that before. However, the values it shows in the manual are 1, 2, 4, 8, 16, 32. I'm getting a value of 15 and 5. Sometimes I am actually getting 7....I don't know why I'm getting that one.15 shows up when the win is visible, and 5 shows up when the win is hidden. But the manual says 2 should be visible...it says nothing about hidden. 7 just seems to show up at random for no reason which throws everything off.What are the values of 5, 7, and 15 for?They are the state number's sum. Link to comment Share on other sites More sharing options...
herewasplato Posted May 26, 2007 Share Posted May 26, 2007 (edited) 1 = Window exists 2 = Window is visible 4 = Window is enabled 8 = Window is active 15 = sum of the above1 = Window exists 2 = Window is visible 4 = Window is enabled 7 = sum of the above Edited May 26, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Champak Posted May 26, 2007 Author Share Posted May 26, 2007 Thanks FreeFry, that works nicely. One last question, I'll admit I didn't look for this yet, but I'll post the question while I'm looking anyway while I'm here; is there a way to prevent....I don't know the proper name for it....program box at the bottom of the screen from showing. The box at the bottom of the monitor that you click to activate the application, I don't want that to show at all for this program. Basically a function like the NoTrayIcon. Link to comment Share on other sites More sharing options...
Champak Posted May 26, 2007 Author Share Posted May 26, 2007 Wow, you guys move QUICK...I can't get a thought out. I love it. Link to comment Share on other sites More sharing options...
herewasplato Posted May 26, 2007 Share Posted May 26, 2007 (edited) ...Basically a function like the NoTrayIcon.http://www.autoitscript.com/forum/index.ph...ost&p=93536 Edited May 26, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
FreeFry Posted May 26, 2007 Share Posted May 26, 2007 (edited) put this in the top of your script to disable the tray icon from showing:#NoTrayIconEdit:Or refer to the link herewasplato posted if you want to hide another application's tray icon. Edited May 26, 2007 by FreeFry Link to comment Share on other sites More sharing options...
Champak Posted May 26, 2007 Author Share Posted May 26, 2007 OK, I've been searching since my last post and can't find what I'm looking for. I think you guys mixed up what I was saying, I have attached an image example. When I mentioned the tray icon, I meant I was hoping there was a simple way of hiding what I wanted like how the tray icon is hidden. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 26, 2007 Moderators Share Posted May 26, 2007 OK, I've been searching since my last post and can't find what I'm looking for. I think you guys mixed up what I was saying, I have attached an image example. When I mentioned the tray icon, I meant I was hoping there was a simple way of hiding what I wanted like how the tray icon is hidden.Look at WinGetState() + WinSetState() ... If Not WinActive() ... or If WinGetState()= Minimized ... WinSetState()+@SW_HIDEBe smart here and use WinGetHandle() to get the windows handles and store them so you can bring them back later if you want. 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...
herewasplato Posted May 26, 2007 Share Posted May 26, 2007 ...I think you guys mixed up what I was saying...I see now, the boxes on the taskbar... SmOke_N has sent you down the right path, let us know if you need help putting it all together. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
FreeFry Posted May 26, 2007 Share Posted May 26, 2007 (edited) oh lol, that's not the tray field, that's the taskbar and there you see all windows that are visible(if they're not a child window, or maybe a 'special' window lol) Basically to change the hidden/visible state of a window, you would want to store it's so called 'Handle' - so you can refer to it - after you've hidden it - easily. Basic example: $wHandle = WinGetHandle("Program Manager") WinMinimizeAll() MsgBox(0, "", "Hiding...", 1) WinSetState($wHandle, "", @SW_HIDE) MsgBox(0, "", "Showing...", 1) WinSetState($wHandle, "", @SW_SHOW) Edited May 26, 2007 by FreeFry 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