MFC program process

zhaozj2021-02-16  50

1: Application Object Production

2: AFXWINMAIN Execute AFXWININIT, call AFXINITTHRED

3: AFXWINMAIN Execute INITAPPLICATION, InitInstance (is the number of cwinapp virtuality, change!)

4: CMYWINAPP :: InitInstance New A CMYFRAMEWND

5: CMYFRAMEWND constructor call CREATE generating main window

6: InitInstance Execute ShowWindow, UpdateWindow, issue WM_PAINT

7: AFXWINMAIN Execute Run

8 ::: getMessage, WM_PAINT by :: DISPATCHMESSAGE CWND :: DefWindowProc -> MessageMap

9: Call the corresponding function (begen-message-map, end_message_map is established)

10: Click File / Close, issue WM-CLOSE

11: CMYFRAMEWND DRC

12: Call: DestroyWindow issued WM_DESTROY

13: Default Processing Call: PostquitMessage issued WM_QUIT

14: CWINAPP :: Run Received WM-Quit End Internal Circulation, calling EXITINSANCE (if CMYWINAPP rewriting

CMYWINAPPP :: EXITINSTANCE;

15: Back to AFXWINMAIN, execute AFXWINTERM, the end of the program! !

转载请注明原文地址:https://www.9cbs.com/read-28166.html

New Post(0)