void Nish(char* szBlog);

Nish’s thoughts on MFC, C++/CLI and .NET

void Nish(char* szBlog); header image 2

Avalon – The end of HWND voyeurism!

March 30th, 2006 · 3 Comments

One fundamental aspect about Avalon controls is that they are not native HWND based controls, such as the ones you have been used to with Win32 API programming or with Windows Forms (which merely wraps the API). So if you have an Avalon window with a bunch of controls on it (say a ListBox and a couple of Buttons), none of them will have an HWND , because an Avalon control does not map to a native Windows control. If you use Spy++, you’ll see just a single HWND based window (the top level window) which hosts the Avalon window. Of course, there are possible ways to enumerate the child controls in an Avalon window using the WPF API, but Spy++, which had been the Number-1 window spying tool for a decade will either have to be abandoned or re-written to handle Avalon controls. Can you imagine not being able to PostMessage whatever you wanted to a control in a window in some other application running on your desktop? Coding is going to change – in many more ways than I had imagined!

Tags: WPF (Avalon)

3 responses so far ↓

  • 1 Rainer // Mar 30, 2006 at 6:37 am

    In my opinion this is a good way to start over new with many crappy and hacky styles and ways of coding. The King is dead, long live the King!

    Cheers

  • 2 Tony Tanzillo // Oct 5, 2006 at 8:29 pm

    “but Spy++, which had been the Number-1 window spying tool for a decade will either have to be abandoned or re-written to handle Avalon controls”

    Well, that can only be a good thing, considering
    that I have never seen any Windows app that can
    completely hang a system like Spy++ can (no Ctrl+
    Alt+Delete or any other way out I know of, other
    than the power or reset switch), if you close the
    process that owns what its spying on.

  • 3 ajay // Nov 16, 2006 at 8:33 am

    Also the if one uses spy++ on the .net 2 datagridview control, you don’t notice the cell
    windows being highlited. Does it mean the datagridview of .net 2.0 is using the avalon
    architecture ?

Leave a Comment