C++程序窗体程序 高手帮忙解析1

来源:百度知道 编辑:UC知道 时间:2024/09/22 07:20:29
/*-----------------------------------------
MENUDEMO.C -- Menu Demonstration
(c) Charles Petzold, 1998
-----------------------------------------*/
#include <windows.h>
#include "resource.h"
#define ID_TIMER 1
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
BOOL CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM) ;
int iCurrentColor = IDC_WHITE,
iCurrentFigure = IDC_RECT ;
TCHAR szAppName[] = TEXT ("MenuDemo") ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;

wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
w

WndProc (HWND, UINT, WPARAM, LPARAM) ;
这个为回调函数,用来处理收到的消息.

AboutDlgProc (HWND, UINT, WPARAM, LPARAM) ;
这个也是回调函数, 用来处理传给对话框的消息.就是about菜单弹出的那个.

WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
为主函数, 程序入口点.

WNDCLASS wndclass 为窗口注册信息. 你可以查看MSDN. CreateWindow里就有.

程序没写完整