Hi,

I want to write a program that listens for a window action (creates a window or closes a window) and when a window is created i get new window handle in an HWND array and remove it when i close the window.
By now i'm able to retrieve the main window handle and i guess i have to use the GetMessage() function, something like this;

HWND parent = FindWindow(NULL,"Main Window Name");
MSG msg;

while (GetMessage(&msg, parent, 0, 0))
{
if (msg.message == WM_CREATE )
MessageBox(NULL,"new window","Message:",MB_OK);

TranslateMessage(&msg);
DispatchMessage(&msg);
}

Please give me some suggestions or at least point me to some good tutorials.
PS: i'm really new with win32 programming ...

Thank you.