I have a CDialog derived class. Its interface definition has several picture boxes and some buttons after, defined in resource file as:
IDD_SELECT_ITEMS DIALOGEX
The solution was right in front of my eyes in a comment, and I was completely blind, not seeing it!
After seeing the end of the "The WM_INITDIALOG
Message" section on Dialog Box Programming Considerations, I understood I had to return FALSE.
I eliminated all the trashy lines I added, changed the return value to FALSE
, and everything began to work fine as expected :)