I can't really tell what you're trying to do here, but I would assume it would be trying to use a modeless dialog box as the main window of your app?

in your WindowProcedure you are handling WM_INITDIALOG. I doubt you'll ever recieve this message, since the callback is related to a generic window (you create g_hwnd with CreateWindowEx). I'd think you should probably be creating the dialog when WindowProcedure recieves the WM_CREATE message (the equivalent of WM_INITDIALOG for a generic window).

as for your ShowWindow code, it looks like you are quite confused with it. after calling CreateWindowEx, try hiding the g_hwnd window (you want to display the dialog as your program's main window, not this one). don't use nShow to pass the second argument to ShowWindow, remember you initialized it with SW_SHOW earlier (note this is unnecessary, by default WinMain will recieve a value in nShow equivalent to SW_SHOW). then after creating your dialog in WM_CREATE from WindowProcedure, show your dialog window (hAboutDialog), since unlike DialogBox, CreateDialog does not do this for you.