Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a program in which I need to get a list of all open windows be that my computer one or a notepad one or a VLC one.

I can access the processes but the problem is that, explorer has only one open process and if I have two drives open, how do I access them both?
Posted

1 solution

You can enumerate all the windows using the API

BOOL WINAPI EnumWindows(
  __in  WNDENUMPROC lpEnumFunc,
  __in  LPARAM lParam
);


The above function will callback

BOOL CALLBACK EnumWindowsProc(
  __in  HWND hwnd,
  __in  LPARAM lParam
);


function for each Window with all the necessary information that you can use.

You can also use EnumDesktopWindows API
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900