IanN1990 Posted December 27, 2012 Posted December 27, 2012 (edited) ; Check if a new notepad window is Visible Local $state = WinGetState("[CLASS:Notepad]", "") ; Is the "Visible" value set? If BitAND($state, 2) Then MsgBox(0, "Example", "Window is Visible") endif but it seams to run even if the window is minimized ? Is this intended? Edited December 27, 2012 by IanN1990
KaFu Posted December 27, 2012 Posted December 27, 2012 (edited) Minimized <> Visible. A window can be visible and minimized or visible and not minimized or hidden and minimized or hidden and not minimized... ; Check if a new notepad window is Visible Local $state = WinGetState("[CLASS:Notepad]", "") ; Is the "minimized" value set? If BitAND($state, 2) and not BitAND($state, 16) Then MsgBox(0, "Example", "Window is Visible and NOT minimized.") endif Edited December 27, 2012 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
IanN1990 Posted December 27, 2012 Author Posted December 27, 2012 (edited) I consider "visible" as something you can see. I wouldn't of expected minimized to also count as visible . If i need two bitand statements, would the following be better ? ; Check if a new notepad window is Visible Local $state = WinGetState("[CLASS:Notepad]", "") ; Is the "Visible" value set? If $state = 7 or $state = 15 Then MsgBox(0, "Example", "Window is Visible") EndIf 7 = visible 15 = active Edited December 27, 2012 by IanN1990
Developers Jos Posted December 27, 2012 Developers Posted December 27, 2012 That would consider Maximized Notepad windows as "Not Visible". SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
IanN1990 Posted December 27, 2012 Author Posted December 27, 2012 Seams your right i never considered Maximized would make the code above fail.
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