资源描述:
《实现字体的飘动》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、//Move.cpp:定¡§义°?应®
2、用®?程¨¬序¨°的Ì?入¨?口¨²点Ì?。¡ê//#include"stdafx.h"#include"Move.h"//#if!defined(__GRAPHICS_H)#define__GRAPHICS_H#defineMAX_LOADSTRING100//全¨?局?变À?量¢?:HINSTANCEhInst;//当Ì¡À前¡ã实º¦Ì例¤yTCHARszTitle[MAX_LOADSTRING];//标À¨º题¬a栏¤?文?本À?TCHARszWindowClass[MAX_LOADSTRING];//主¡Â窗ä¡ã口¨²类
3、¤¨¤名?//此ä?代䨲码?模¡ê块¨¦中D包㨹含?的Ì?函¡¥数ºy的Ì?前¡ã向¨°声¦¨´明¡Â:ATOMMyRegisterClass(HINSTANCEhInstance);BOOLInitInstance(HINSTANCE,int);LRESULTCALLBACKWndProc(HWND,UINT,WPARAM,LPARAM);INT_PTRCALLBACKAbout(HWND,UINT,WPARAM,LPARAM);intAPIENTRY_tWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,LPTS
4、TRlpCmdLine,intnCmdShow){UNREFERENCED_PARAMETER(hPrevInstance);UNREFERENCED_PARAMETER(lpCmdLine);//TODO:在¨²此ä?放¤?置?代䨲码?。¡êMSGmsg;HACCELhAccelTable;//初?始º?化¡¥全¨?局?字Á?符¤?串ä?LoadString(hInstance,IDS_APP_TITLE,szTitle,MAX_LOADSTRING);LoadString(hInstance,IDC_MOVE,szWindowClass,MAX_LOADSTRIN
5、G);MyRegisterClass(hInstance);//执¡ä行D应®
6、用®?程¨¬序¨°初?始º?化¡¥:if(!InitInstance(hInstance,nCmdShow)){returnFALSE;}hAccelTable=LoadAccelerators(hInstance,MAKEINTRESOURCE(IDC_MOVE));//主¡Â消?息¡é循-环¡¤:while(GetMessage(&msg,NULL,0,0)){if(!TranslateAccelerator(msg.hwnd,hAccelTable,&msg)){TranslateMes
7、sage(&msg);DispatchMessage(&msg);}}return(int)msg.wParam;}////函¡¥数ºy:MyRegisterClass()////目?的Ì?:注Á¡é册¨¢窗ä¡ã口¨²类¤¨¤。¡ê////注Á¡é释º¨ª:////仅?当Ì¡À希¡ê望ª?//此ä?代䨲码?与®?添¬¨ª加¨®到Ì?Windows95中D的Ì?“¡ãRegisterClassEx”¡À//函¡¥数ºy之?前¡ã的Ì?Win32系¦Ì统ª3兼?容¨Y时º¡À,ê?才?需¨¨要°a此ä?函¡¥数ºy及¡ã其?用®?法¤¡§。¡ê调Ì¡Â用®?此ä?函¡¥
8、数ºy十º?分¤?重?要°a,ê?//这a样¨´应®
9、用®?程¨¬序¨°就¨ª可¨¦以°?获?得Ì?关?联¢a的Ì?//“¡ã格?式º?正y确¨¡¤的Ì?”¡À小?图ª?标À¨º。¡ê//ATOMMyRegisterClass(HINSTANCEhInstance){WNDCLASSEXwcex;wcex.cbSize=sizeof(WNDCLASSEX);wcex.style=CS_HREDRAW
10、CS_VREDRAW;wcex.lpfnWndProc=WndProc;wcex.cbClsExtra=0;wcex.cbWndExtra=0;wcex.hInstance=
11、hInstance;wcex.hIcon=LoadIcon(hInstance,MAKEINTRESOURCE(IDI_MOVE));wcex.hCursor=LoadCursor(NULL,IDC_ARROW);wcex.hbrBackground=(HBRUSH)(COLOR_WINDOW+1);wcex.lpszMenuName=MAKEINTRESOURCE(IDC_MOVE);wcex.lpszClassName=szWindowClass;wcex.hIconSm=LoadIcon(wcex.hInstance,M