EnumProps (user32)
Last changed: GeekTieGuy-15.203.233.79

.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern int EnumPropsEx(IntPtr hWnd, EnumPropsExDelegate lpEnumFunc,
   IntPtr lParam);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

   internal class Program
    {
    [DllImport("user32.dll")]
    static extern int EnumPropsEx(IntPtr hWnd, EnumPropsExDelegate lpEnumFunc, IntPtr lParam);

//author: roishabtai@hotmail.com

    private delegate int EnumPropsExDelegate(IntPtr hwnd, IntPtr lpszString, IntPtr hData, IntPtr dwData);

    private static void Main(string[] args)
    {

//author: roishabtai@hotmail.com

        IntPtr hWnd = new IntPtr(XXXXXX); //Enter handle value here. use UI Spy/Inspect to get it
        EnumPropsExDelegate enumPropsExDel = new EnumPropsExDelegate(PropEnumProcEx);
        var i = EnumPropsEx(hWnd, enumPropsExDel, new IntPtr());

        Console.WriteLine("Press any key to continue...");
        Console.Read();
    }

    //the actual delegate for the WinApi function
    public static int PropEnumProcEx(IntPtr hwnd, IntPtr lpszString, IntPtr hData, IntPtr dwData)
    {
        //Window's property name
        string propName;

        //Copy the string pointed to by lpString into a "real" string.
        propName = Marshal.PtrToStringAnsi(lpszString);
        Console.WriteLine("Property name: " + propName); // Output values

        //Continue
        return 1;
    }
    }

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
EnumPropsEx on MSDN