C
carlmanaster
My application has regular document windows and floating windows above
them. I want to iterate through all windows in z-order. I would have
thought this capability would be built-in to the .net framework, but
everything I can find on the archives says no - you need to use
GetWindow(), thus:
[DllImport("user32", EntryPoint="GetWindow")]
private static extern int GetWindow(int hwnd, int wFlag);
And the most logical thing seems to me to be to create a class that
implements the IEnumerator interface. I suspect I need an additional
external function - maybe GetTopWindow? to get a starting point; call
that in .Reset() and GetWindow() in .MoveNext(). Am I on the right
track? Can anyone provide examples of how to call these functions, eg
what arguments to pass to them, how to coerce their result types into
System.Windows.Forms, how to tell when I've reached the end? Thanks in
advance.
Peace,
--Carl
them. I want to iterate through all windows in z-order. I would have
thought this capability would be built-in to the .net framework, but
everything I can find on the archives says no - you need to use
GetWindow(), thus:
[DllImport("user32", EntryPoint="GetWindow")]
private static extern int GetWindow(int hwnd, int wFlag);
And the most logical thing seems to me to be to create a class that
implements the IEnumerator interface. I suspect I need an additional
external function - maybe GetTopWindow? to get a starting point; call
that in .Reset() and GetWindow() in .MoveNext(). Am I on the right
track? Can anyone provide examples of how to call these functions, eg
what arguments to pass to them, how to coerce their result types into
System.Windows.Forms, how to tell when I've reached the end? Thanks in
advance.
Peace,
--Carl