tags:

views:

38

answers:

1

i need the current opened applications(those that appear in the task bar) and NOT the currently running processes.

thanks

+3  A: 

You need to enumerate all the top level windows (with the EnumWindows function); you have to skip:

  • the invisible windows (check the return value of the IsWindowVisible function or directly check if the window has the WS_VISIBLE style);
  • the windows with the extended style WS_EX_TOOLWINDOW, unless they have also the WS_EX_APPWINDOW extended style.

All the others should be the ones shown in the taskbar (here's the full story).

Then, if you want to get the process/thread owning each of the window, you can use the GetWindowThreadProcessId function.

Matteo Italia