Sign in to follow this  
Followers 0
Champak

Detect show hide

15 posts in this topic

#1 ·  Posted (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 by Champak

Share this post


Link to post
Share on other sites



You can think this way, if the windows is not acive and not visible, that means the windows is hidden.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

1 = Window exists

2 = Window is visible

4 = Window is enabled

8 = Window is active

15 = sum of the above

1 = Window exists

2 = Window is visible

4 = Window is enabled

7 = sum of the above

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Wow, you guys move QUICK...I can't get a thought out. :) I love it.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

put this in the top of your script to disable the tray icon from showing:

#NoTrayIcon

Edit:

Or refer to the link herewasplato posted if you want to hide another application's tray icon. :)

Edited by FreeFry

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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_HIDE

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#15 ·  Posted (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 by FreeFry

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