Hi everyone,
I have a program which creates a dialog box initially, and I want to be able to press a button on the dialog box to create a window which DirectX will then render to. I think I could do this if my program wasn't dialog based (i.e. if I already had a win32 window) but I can't figure out how to do it when my main program is simply a dialog box. Here's my WinMain function:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAINMENU), NULL, MainDlgProc);
}
As you can see, I don't create a message loop in the main program because it's only a dialog box. This is where my issue is raised. My DirectX window needs a message loop in order to work, and I'm not sure how I'd create one outside of WinMain. How could I create a separate window to render to by pressing a button on a dialog box? If anyone has any example code, that would be great :)
Thanks!