Manipulating window from a dialog box
If I have a program with a dialog box as the main interface, is it possible to use buttons on the dialog box to create, update and destroy a window? For example, if my dialog box has a button on it with 'create window', how would I go about creating a window when I press it? Would I still need to register and create the window/message loop in the WINAPI WinMain() section, or would I need to do something else? Is it possible to close a window if I press a 'close window' button on my dialog box, and can I update the contents of the window (with WM_PAINT) if I have an 'update' button on the dialog box?
Right now, I have a BOOL CALLBACK DlgProc() section for handling the dialog box, an LRESULT CALLBACK WndProc() section for handling the window, and all that I have in the int WINAPI WinMain() section is the following code:
...this creates the main menu dialog box with the buttons on it, but I am not really sure what to put where to accomplish my task :)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_MENUWINDOW), NULL, DlgProc);