Buttons created as child windows using CreateWindow do not send BN_CLICKED messages to the message processing function. Instead they send a WM_COMMAND message to the message processing function, and when that message is trapped you must get the child window ID from the LOWORD of the message wParam, and the Button Notification Code ID, which is what BN_CLICKED actually is, from the HIWORD of the message wParam. See a good Windows programming book (Petzold).
We created a button with a parent Page window that sent its WM_COMMAND message to our WGUserPageProc routine in one of the hook files.
HWND pagewindow;
HWND buttonwindow;
pagewindow = WGGetPageWindow(pPageDesc);
buttonwindow = CreateWindow("button", "XXXX",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
0, 0, 50, 50,
pagewindow, 0, hInst, NULL);
BringWindowToTop(buttonwindow);