Anyone know if there is a way to enumerate all available window classes that were registered with RegisterClass, RegisterClassEx, or GlobalAddAtom?
Printable View
Anyone know if there is a way to enumerate all available window classes that were registered with RegisterClass, RegisterClassEx, or GlobalAddAtom?
Quote:
Originally posted by Sebastiani
Anyone know if there is a way to enumerate all available window classes that were registered with RegisterClass, RegisterClassEx, or GlobalAddAtom?
Code:#include <iostream>
#include <set>
#include <algorithm>
#include <windows.h>
typedef std::set<std::string> MYSET;
const int BUFF_LEN = 255;
BOOL CALLBACK EnumWindowsProc(HWND hWnd,LPARAM lParam){
MYSET* lpSet = reinterpret_cast<MYSET*>(lParam);
static char szClass[BUFF_LEN];
if(GetClassName(hWnd,szClass,BUFF_LEN))
lpSet->insert(szClass);
return TRUE;
}
int main()
{
MYSET setClasses;
EnumWindows(EnumWindowsProc,
reinterpret_cast<LPARAM>(&setClasses));
std::copy(setClasses.begin(),setClasses.end(),
std::ostream_iterator<std::string>(std::cout,"\n"));
}
:D I take it then there is. :D
Thank you Fordy, I owe you a beer for that one. :)
this is kinda off-topic, but if I declare a window class in one module, can I use it in another one?
noQuote:
Originally posted by frenchfry164
this is kinda off-topic, but if I declare a window class in one module, can I use it in another one?