Try the DialogBox instead, just declare a template for the window (not necessary the inside controls) and a procedure for that window. Something like that, first setup the template on the resource file:
Notice that 'MYSAMPLEWINDOW' will be the window identifyer, so define it on your definitions file:
MYSAMPLEWINDOW DIALOG DISCARDABLE 0, 0, 100, 100
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
Declare a procedure for that window:
#define MYSAMPLEWINDOW 1000
In the window's procedure you'll have to check the WM_ messages to respond to the window's events. Finally create the dialog:
BOOL CALLBACK MySampleWindowProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
default: return 0;
Take a look to the win32 prog reference, or in the msdn to see more about that function, and check oput also the function DialogBoxParam.
Still another way to do it is creating your own window class, you can find more about that on catch22 (I'm not sure the section's name, but was something like custom controls from scratch).
Hope that helps