views:

59

answers:

1

Is there any function, or I'll have to iterate through all windows that are in front of mine and detect if they overlap my window?

Thanks

+1  A: 

Did you try comparing the HWND returned by GetForegroundWindow() with the HWND of your application? (http://msdn.microsoft.com/en-us/library/ms633505%28VS.85%29.aspx)

To be more clear:

hwndForeground = GetForegroundWindow();
if (hwndForeground != myapp)
  //Compare if rect of (hwndForeground) is overlapping rect of (myapp)
Marcelo
I am now looping through all the windows above mine to see if they intersect.
devoured elysium