qwert Posted February 3, 2009 Share Posted February 3, 2009 Does anyone know of a utility that can display a list of all current windows and show their Z Order setting?I'm troubleshooting an instance where the taskbar is disappearing behind an application window. It's a fairly rare occurrence, but I'd like to get to the bottom of it. Among other things, I've tried forcing the taskbar on top with WinSetOnTop("[class:Shell_TrayWnd]", "", 1) in the script I use to start the application. But nothing has had any effect. A certain mouse click combination causes the taskbar to occasionally disappear. So I need to be able to detect any change in the Z Order to help isolate the cause.Thanks in advance for any assistance. Link to comment Share on other sites More sharing options...
NerdFencer Posted February 3, 2009 Share Posted February 3, 2009 you can see the top with the WinActive function.... _________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell Link to comment Share on other sites More sharing options...
qwert Posted February 3, 2009 Author Share Posted February 3, 2009 ... display a list of all current windowsI need to be able to monitor all current windows so I can detect changes in their relative order. Link to comment Share on other sites More sharing options...
MrCreatoR Posted February 3, 2009 Share Posted February 3, 2009 (edited) Check the ShellHookWindow by Siao. Edited February 3, 2009 by MrCreatoR  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
qwert Posted February 3, 2009 Author Share Posted February 3, 2009 Check the ShellHookWindow by Siao.Thanks for the suggestion. I'll try to figure it out, but the following makes me think it only monitors a window that I've created with AutoIt3:First we have to register unique message - RegisterWindowMessage("SHELLHOOK")Then GuiRegisterMsg() the message with a handler function, and of course hook up our GUI with RegisterShellHookWindow (and unregister when not needed anymore).And that's pretty much it.The window I'm having the problem with is a third-party application (that I'm using AutoIt3 to resize and position). I still believe the underlying cause is something altering the Z order, which is why I'd like to be able to monitor it for all current windows. Link to comment Share on other sites More sharing options...
qwert Posted February 3, 2009 Author Share Posted February 3, 2009 This is an update to what I just posted.I was able to compile run ShellHookWindow and monitor my problem of the disappearing taskbar. The Capture below shows what occurred as I switched from my Application to Notepad and back. After the switch, I double-clicked rapidly in an unused area of the Application's window and caused the taskbar to disappear (behind the application window). Yet, nothing changed in the ShellHook monitoring window.Any suggestions? Link to comment Share on other sites More sharing options...
LarryDalooza Posted February 3, 2009 Share Posted February 3, 2009 Whipped together to tooltip the Z order... Winlist respects the Z order expandcollapse popupGlobal $buffer = "" While 1 ToolTip("") $list = WinList() If $list[0][0] = 0 Then Exit $i = 0 For $n = 1 to $list[0][0] If Not IsVisible($list[$n][1]) Then ContinueLoop $i += 1 If Not StringLen($list[$n][0]) Then $buffer &= $i & ": " & GetClassName($list[$n][1]) & @LF Else $buffer &= $i & ": " & $list[$n][0] & @LF EndIf Next ToolTip($buffer) $buffer = "" Sleep(1000) WEnd Func GetClassName(ByRef $hWnd) Local $ret = DLLCall("user32.dll","int","GetClassName","hwnd",$hWnd,"str","","int",5000) If IsArray($ret) Then Return $ret[2] Else Return "" EndIf EndFunc Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
qwert Posted February 3, 2009 Author Share Posted February 3, 2009 EXCELLENT! That's the tool I was hoping for.I was able to capture the circumstance exactly. Shell_TrayWnd is normally at the top -- with my application second. But the double-action I described above sends Shell_TrayWnd almost to the very bottom, just above Program Manager. I ran my test with 20 different windows open and Taskbar went from #1 to #19. So Z order management IS the problem. Now I only have to fashion a solution in the form of some preventive measure.Thanks very much for your help. Link to comment Share on other sites More sharing options...
E1M1 Posted February 19, 2009 Share Posted February 19, 2009 I wonder what does GetClassName and why it is needed. I just cant understand this part edited Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 19, 2009 Share Posted February 19, 2009 (edited) I wonder what does GetClassName and why it is needed. I just cant understand this partIt's not required, it was just put in to provide some useful info (each window's class name) where the title was blank. The function that performs it is right there in Larry's example. If you are not interested in the class name, don't use it. Edited February 19, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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