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:
Code:
MYSAMPLEWINDOW DIALOG DISCARDABLE 0, 0, 100, 100
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION NOMAPP
FONT 8, "MS Sans Serif"
BEGIN
END
Notice that 'MYSAMPLEWINDOW' will be the window identifyer, so define it on your definitions file:
Code:
#define MYSAMPLEWINDOW 1000
Declare a procedure for that window:
Code:
BOOL CALLBACK MySampleWindowProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
default: return 0;
}
return 1;
}
In the window's procedure you'll have to check the WM_ messages to respond to the window's events. Finally create the dialog:
Code:
DialogBox(GetModuleHandle(0),MAKEINTRESOURCE(MYSAMPLEWINDOW),hwnd,MySampleWindowProc);
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
Niara