Jump to content

Utility to show Z Order?


qwert
 Share

Recommended Posts

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

Check the ShellHookWindow by Siao.

Edited by MrCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: 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 Program

AutoIt_Icon_small.pngUDFs: 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
 
AutoIt_Icon_small.pngExamples: 
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 AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

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

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?

post-29172-1233675645_thumb.png

Link to comment
Share on other sites

Whipped together to tooltip the Z order... Winlist respects the Z order

Global $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

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Link to comment
Share on other sites

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

  • 3 weeks later...

I wonder what does GetClassName and why it is needed. I just cant understand this part

It'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 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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...