1

The effect that I want is:

enter image description here

Yeah.. it is similar effect in spy.. It works perfectly when I am doing this on controls inside the WindowForm or WindowForm that does not have a borderstyle.

However, when it comes to a WindowForm that has a FormBorder, it FAILS! The rectangle forms inside the form:

enter image description here

For drawing the rectangle, I used the source from CodeProject.

Spectre87
  • 2,374
  • 1
  • 24
  • 37
mik4n
  • 63
  • 7
  • There may be some help for you here: http://stackoverflow.com/questions/5634743/non-client-painting-on-aero-glass-window – Monroe Thomas Jul 16 '12 at 23:59
  • possible duplicate of [How to determine ACTUAL windows form size (with all nonclient elements) when running Aero?](http://stackoverflow.com/questions/8838621/how-to-determine-actual-windows-form-size-with-all-nonclient-elements-when-run) – Hans Passant Jul 17 '12 at 02:18
  • I found that it is very difficult to draw on the form border with the window handle so, I just chose to draw on the desktop! I simply used GetDestktopWindow() API. Thanks for everybody's comment! – mik4n Jul 17 '12 at 03:42

1 Answers1

0

As mentioned in an earlier comment, you can just draw on the desktop using the GetDesktopWindow() API.

Ryan Kohn
  • 13,079
  • 14
  • 56
  • 81