property sheet kinda not working
I'm trying to create tabbed dialogs within the main window. Originally I just had dialogs be the window itself, but then it eliminated the minimize, maximize and close button in the corner. So I would like to transfer them all to a tabbed dialogs using property sheets. But the problem is when the program is compiled, the program doesn't run, even though it compiles with no errors. I don't know what is happening with the program since there's no errors, or no program for that matter. Here is the code containing the property sheets.
Code:
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_CREATE:
PROPSHEETPAGE std;
std.dwSize = sizeof(PROPSHEETPAGE);
std.dwFlags = PSP_DEFAULT;
std.pszTemplate = MAKEINTRESOURCE(IDD_MAIN);
std.pfnDlgProc = DlgProc;
HPROPSHEETPAGE ahstd = CreatePropertySheetPage(&std);
PROPSHEETHEADER hstd;
hstd.dwSize = sizeof(PROPSHEETHEADER);
hstd.dwFlags = PSP_DEFAULT|PSH_MODELESS;
hstd.hwndParent = hwnd;
hstd.pszCaption = "Standard";
hstd.phpage = &ahstd;
PropertySheet(&hstd);
break;
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}