Jump to content
Sign in to follow this  
qwert

Utility to show Z Order?

Recommended Posts

qwert

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.

Share this post


Link to post
Share on other sites
qwert

... display a list of all current windows

I need to be able to monitor all current windows so I can detect changes in their relative order.

Share this post


Link to post
Share on other sites
MrCreatoR

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

Share this post


Link to post
Share on other sites
qwert

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.

Share this post


Link to post
Share on other sites
qwert

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

Share this post


Link to post
Share on other sites
LarryDalooza

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

Share this post


Link to post
Share on other sites
qwert

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.

Share this post


Link to post
Share on other sites
E1M1

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


edited

Share this post


Link to post
Share on other sites
PsaltyDS

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.