Sign in to follow this  
Kranar

Getting list of all windows.

Recommended Posts

Is there a way to get the list of every single window running or atleast visible on the desktop? Just a list of their names, so for example right now I would have something along the lines of a list with: "Post a New Message - GameDev.Net Discussion Forums - Microsoft Internet Explorer" "Someguy - Conversation" "Windows Explorer" "Notepad" Since all of those windows are running as I type this message? Thank you.

Share this post


Link to post
Share on other sites
EnumWindows will enumerate all windows on your system. Usage:


BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
// only list visible windows.
if(IsWindowVisible(hwnd))
{
char szWindowText[MAX_PATH];
memset(szWindowText,0,MAX_PATH);

GetWindowText(hwnd,szWindowText,MAX_PATH);

printf("%s\r\n",szWindowText);
}
return true;
}

// ...
EnumWindows(&EnumWindowsProc,0);


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this