002
26.04.2004, 15:22 Uhr
Tommix
|
Hallo,
C++: |
#include <windows.h>
#ifdef _MSC_VER #pragma warning(disable:4786) #endif
#include <iostream> #include <list> #include <string>
typedef std::list<std::string> stringlist;
stringlist winList; static int unnamed = 0;
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM) { const int MaxLen = 80; char title[MaxLen]; if (GetWindowText(hWnd, title, MaxLen)) winList.push_back(title); else ++unnamed;
return TRUE; }
int main() { EnumWindows(EnumWindowsProc, NULL); winList.sort();
for(stringlist::iterator i = winList.begin(); i != winList.end(); ++i) std::cout << *i << std::endl;
std::cout << winList.size() << " windows found (+" << unnamed << " without title)." << std::endl;
return 0; }
|
Gruss, Tommix |