I believe you haven't added a message loop, by calling the function
GetMessage
. Just try to add the following right after that code:
mainForm = CreateWindowEx (.....);
ShowWindow(mainForm,SW_SHOWNORMAL) ;
UpdateWindow(mainForm);
MSG msg;
while( GetMessage(&msg, 0, 0, 0) > 0 ) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
For further reading:
GetMessage function |
Understanding the Message Loop.