I create library that allows creating dialog boxes dynamically by DialogBoxIndirectParam. And provides any messages from DlgProc and to controls. Now I have task to show a lot of controls by this library, so they should be placed on any scrollable area.
I searched simple decision from standart controls and controls, available by InitCommonControlsEx, but didn't found.
I create test application with scrollable area by CreateWindow and RegisterClass. It works well.
Then I try to repeate creating such window in my library.
I call RegisterClass and CreateWindow inside WM_INITDIALOG, but CreateWindow returns NULL and GetLastError returns 0.
Upd: add code of registerclass
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC) DlgProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = GetModuleHandle(NULL);
wcex.hIcon = NULL;
wcex.hCursor = NULL;
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = "XMYSCROLL";
wcex.hIconSm = NULL;
if (! RegisterClassEx(&wcex) ){
// message box with error
}