0

I want to find the non child window that is highest in the z order that belongs to my process.

I can use EnumWindows to walk the window list, using GetWindowThreadProcessId to mask out windows that belong to other processes; but how do I know where each window is in the z order?

Alternatively, is there an easier way to do this?

Shane
  • 1

1 Answers1

1

Once you find one window, use GetWindow() with GW_HWNDFIRST to find the toplevel (non-child) window that's highest in the Z-order.

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