Detect which hWnd a taskbar button position is for?

19 views Asked by At

Say we have three windows open: Calc, Notepad, and Word; and assume they're in that order in the taskbar. Is there a way to know that taskbar button #2 relates to Notepad's window? And say we close Notepad so that Word's taskbar button now becomes the #2 position, how can we know that taskbar button #2 is now for Word's window? Thanks!

I can evaluate all taskbar buttons with the EnumWindows API, but the returned results aren't in the taskbar buttons order, so I don't know how to marry them up to their open windows. Any tips? Even just the theory would help, if you can't provide an example.

0

There are 0 answers