0

I want to make a jing like screen capture but customized for what i need and I'm stuck.

i want to take the handle of open windows that are behind my 30 alpha form if that is possible.

the handle is taken from cursor.position on global MouseMove so i can highlight with proper border windows and i like something like if(currentHandle==this.handle) currentHandle="behind window handle". i home i make my self understandably and excuse my English. Thanks

andySF
  • 556
  • 7
  • 30

1 Answers1

2

You'll need to P/Invoke GetWindow() in a loop, using GW_HWNDNEXT. Keep looping until you find a window whose GetWindowRect() contains the cursor position or you hit the desktop window. Watch out for Aero lying about window rectangles.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536