#include<windows.h>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE PreInstance,LPSTR lpCmdline,int nCmdShow)
{
HWND hwnd1;
HWND hwnd2;
HWND hwnd3;
MSG msg;
char lpszClassName1[]="窗口1";
WNDCLASS wc1;
wc1.style =0;
wc1.lpfnWndProc =WndProc;
wc1.cbClsExtra =0;
wc1.cbWndExtra =0;
wc1.hInstance =hInstance;
wc1.hIcon =LoadIcon(NULL,IDI_APPLICATION);
wc1.hCursor =LoadCursor(NULL,IDC_ARROW);
wc1.hbrBackground =(HBRUSH)GetStockObject(WHITE_BRUSH);
wc1.lpszClassName =NULL;
wc1.lpszClassName =lpszClassName1; RegisterClass(&wc1);
char lpszClassName2[]="窗口2";
WNDCLASS wc2;
wc2.style =0;
wc2.lpfnWndProc =WndProc;
wc2.cbClsExtra =0;
wc2.cbWndExtra =0;
wc2.hInstance =hInstance;
wc2.hIcon =LoadIcon(NULL,IDI_APPLICATION);
wc2.hCursor =LoadCursor(NULL,IDC_ARROW);
wc2.hbrBackground =(HBRUSH)GetStockObject(GRAY_BRUSH);
wc2.lpszClassName =NULL;
wc2.lpszClassName =lpszClassName1; RegisterClass(&wc2); hwnd1=CreateWindow(lpszClassName1,"windows1",WS_OVERLAPPEDWINDOW,120,50,700,500,NULL,NULL,hInstance,NULL);
hwnd2=CreateWindow(lpszClassName2,"windows2",WS_OVERLAPPEDWINDOW,150,80,750,550,NULL,NULL,hInstance,NULL);
hwnd3=CreateWindow(lpszClassName1,"windows3",WS_OVERLAPPEDWINDOW,200,130,500,300,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd1,nCmdShow);
UpdateWindow(hwnd1); ShowWindow(hwnd2,nCmdShow);
UpdateWindow(hwnd2); ShowWindow(hwnd3,nCmdShow);
UpdateWindow(hwnd3);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{case WM_LBUTTONDOWN:{MessageBeep(0);}break;
case WM_DESTROY:PostQuitMessage(0);break;
default:return DefWindowProc(hwnd,message,wParam,lParam);
}
return 0;
}
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE PreInstance,LPSTR lpCmdline,int nCmdShow)
{
HWND hwnd1;
HWND hwnd2;
HWND hwnd3;
MSG msg;
char lpszClassName1[]="窗口1";
WNDCLASS wc1;
wc1.style =0;
wc1.lpfnWndProc =WndProc;
wc1.cbClsExtra =0;
wc1.cbWndExtra =0;
wc1.hInstance =hInstance;
wc1.hIcon =LoadIcon(NULL,IDI_APPLICATION);
wc1.hCursor =LoadCursor(NULL,IDC_ARROW);
wc1.hbrBackground =(HBRUSH)GetStockObject(WHITE_BRUSH);
wc1.lpszClassName =NULL;
wc1.lpszClassName =lpszClassName1; RegisterClass(&wc1);
char lpszClassName2[]="窗口2";
WNDCLASS wc2;
wc2.style =0;
wc2.lpfnWndProc =WndProc;
wc2.cbClsExtra =0;
wc2.cbWndExtra =0;
wc2.hInstance =hInstance;
wc2.hIcon =LoadIcon(NULL,IDI_APPLICATION);
wc2.hCursor =LoadCursor(NULL,IDC_ARROW);
wc2.hbrBackground =(HBRUSH)GetStockObject(GRAY_BRUSH);
wc2.lpszClassName =NULL;
wc2.lpszClassName =lpszClassName1; RegisterClass(&wc2); hwnd1=CreateWindow(lpszClassName1,"windows1",WS_OVERLAPPEDWINDOW,120,50,700,500,NULL,NULL,hInstance,NULL);
hwnd2=CreateWindow(lpszClassName2,"windows2",WS_OVERLAPPEDWINDOW,150,80,750,550,NULL,NULL,hInstance,NULL);
hwnd3=CreateWindow(lpszClassName1,"windows3",WS_OVERLAPPEDWINDOW,200,130,500,300,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd1,nCmdShow);
UpdateWindow(hwnd1); ShowWindow(hwnd2,nCmdShow);
UpdateWindow(hwnd2); ShowWindow(hwnd3,nCmdShow);
UpdateWindow(hwnd3);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{case WM_LBUTTONDOWN:{MessageBeep(0);}break;
case WM_DESTROY:PostQuitMessage(0);break;
default:return DefWindowProc(hwnd,message,wParam,lParam);
}
return 0;
}
wc1.style =0;
wc1.lpfnWndProc =WndProc;
wc1.cbClsExtra =0;
wc1.cbWndExtra =0;
wc1.hInstance =hInstance;
wc1.hIcon =LoadIcon(NULL,IDI_APPLICATION);
wc1.hCursor =LoadCursor(NULL,IDC_ARROW);
wc1.hbrBackground =(HBRUSH)GetStockObject(WHITE_BRUSH);
wc1.lpszClassName =NULL;
wc1.lpszClassName =lpszClassName1;
wc1.lpszMenuName = NULL;
wc2.style =0;
wc2.lpfnWndProc =WndProc;
wc2.cbClsExtra =0;
wc2.cbWndExtra =0;
wc2.hInstance =hInstance;
wc2.hIcon =LoadIcon(NULL,IDI_APPLICATION);
wc2.hCursor =LoadCursor(NULL,IDC_ARROW);
wc2.hbrBackground =(HBRUSH)GetStockObject(GRAY_BRUSH);
wc2.lpszClassName =NULL;
wc2.lpszClassName =lpszClassName1;
wc2.lpszMenuName = NULL;