Hi,
As part of research for a project I'm working on, I need to be able to locate hidden windows on my screen.

Ideally I would do something like draw a colored recangle on the sreen at the location where each hidden window is.

I've done some research and I know that DrawRectangle is available. As a pure guess, I created the code below.

Code:
        public void drawRectangle(int x, int y, int width, int height )
        {

            // get desktop window
            IntPtr desktopHwnd = GetDesktopWindow();
            // Create a new pen.
            Pen skyBluePen = new Pen(Brushes.DeepSkyBlue);
            // Set the pen's width.
            skyBluePen.Width = 8.0F;
            // Set the LineJoin property.
            skyBluePen.LineJoin = System.Drawing.Drawing2D.LineJoin.Bevel;
            Graphics.FromHwnd(desktopHwnd).DrawRectangle(skyBluePen, x, y, width, height);
            skyBluePen.Dispose();

        }
But when I call the function with valid coordinates, it does not draw a rectangle.

Thanks,
Steve