Here is a console application:
//------------------------
#include <windows.h>
#include <iostream>
#pragma hdrstop
using namespace std;
//------------------------
//Call Back Function For EnumWindows handle of every window unless you make it false after you get to a certain handle etc param is anything you want it to be so you can work with it inside the function
BOOL EnumWindowsProc(HWND hWnd, long lParam)
{
char Buff[255], NameOfClass[255];
GetWindowText(hWnd, Buff, 254);
GetClassName(hWnd, NameOfClass, 254);
cout << "Window Text: " << Buff << "\t" << "Class Name: "
<< NameOfClass << endl;
return TRUE;
}
#pragma argsused
int main(int argc, char* argv[])
{
EnumWindows((WNDENUMPROC)E
cin.ignore();
return 0;
}
I write the code for BOOL EnumWindowsProc(HWND hWnd, long lParam), so All you have to do is replace my code with your code.
Main Topics
Browse All Topics





by: Jase-CoderPosted on 2006-02-12 at 03:30:32ID: 15934304
Hi what you have to do is implement the function: BOOL CALLBACK EnumWindowsProc( HWND hwnd, LPARAM lParam); and then you pass the address of this function to EnumWindows. I'll write an example: