In need of a synopsis...
I have a few questions, comments.
Comment #1: Programming Windows Sucks!(Sorry, had to say it)
Anyway, here is my current pradicament:
I decided that in order to have a program with many different screens, I should take this approach:
1) As usual, in WinMain, register and create a window called "hwnd".
2) In "hwnd"s window procedure, create as many "screens" as needed, deriving them from "hwnd" as the parent. Hide all of them except for the Starting Screen.
3) Derive button and other controls from these respective sub-parents.
3) In say, the Starting Screens window procedure, depending on the users whim, (for the sake of illustration, let's say they pushed a button labeled "Next Screen"), and then:
a) intercept the buttons message
b) send a SendMessage() to the interested window (a WM_CREATE? a WM_PAINT? not sure which is better.)
and hide the current window.
c) The message is intercepted in the chosen screens window procedure and a ShowWindow() is called
4) The process continues like this.
In theory it sounds o.k., but my attempt is not functioning this way!
It won't let me create the windows ahead of time and show them later.
Anyway, Just some theory will do just fine. thanks
Look up MDI (multiple document interface) in the help for creating multi screen win32 apps.
Or just create all the windows at start and hide the ones you don't need. When the user selects to change windows hide the current ans show the new. Use ShowWindow().
Don't send WM_CREATE or WM_PAINT, Create is closer but the code contained in the callback under create should execute when the dlg is created and your CreateWindows[Ex]() is called. WM_PAINT is right out of the question, will only draw to the screen.
Do all your windows share the same CALLBACK. (probably do if you created them from the same class, I would change this). As you are going to have problems you will have to switch/case in each msg switch/case for the child window that sent the msg
A window needs repainting
in the WM_PAINT you will have to find WHICH window needs the paint from the HWND returned. So you will need a global/static array of all the windows HWNDs. Only then can you sent the right HDC to be drawn on to the paint function
Remember KISS (keep it simple stupid)