这个是从 Windows程序设计第五版 改来的;我还没完全理解;先初步看一下;
#include <windows.h>
#include "resource.h"
#define INIT_MENU_POS 0
#define HELLO_MENU_POS 2
#define IDM_FIRSTCHILD 50000
LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK CloseEnumProc(HWND, LPARAM);
LRESULT CALLBACK HelloWndProc(HWND, UINT, WPARAM, LPARAM);
typedef struct tagHELLODATA
{
UINT iColor;
COLORREF clrText;
}
HELLODATA, *PHELLODATA;
// global variables
TCHAR szAppName[] = TEXT("MDIDemo");
TCHAR szFrameClass[] = TEXT("MdiFrame");
TCHAR szHelloClass[] = TEXT("MdiHelloChild");
HINSTANCE hInst;
HMENU hMenuInit, hMenuHello;
HMENU hMenuInitWindow, hMenuHelloWindow;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
HACCEL hAccel;
HWND hwndFrame, hwndClient;
MSG msg;
WNDCLASS wndclass;
hInst = hInstanc