计算机专业中英文翻译---Windows编程模式
《计算机专业中英文翻译---Windows编程模式》由会员分享,可在线阅读,更多相关《计算机专业中英文翻译---Windows编程模式(13页珍藏版)》请在毕设资料网上搜索。
1、附录 1 外文原文 8 The Windows Programming Model No matter which development tools you use, programming for Windows is different from old-style batch-oriented or transaction-oriented programming. To get started, you need to know some Windows fundamentals. As a frame of reference, well use the well-known MS
2、-DOS programming model. Even if you dont currently program for plain MS-DOS, youre probably familiar with it. Message Processing When you write an MS-DOS-based application in C, the only absolute requirement is a function named main. The operating system calls main when the user runs the program, an
3、d from that point on, you can use any programming structure you want. If your program needs to get user keystrokes or otherwise use operating system services, it calls an appropriate function, such as getchar, or perhaps uses a character-based windowing library. When the Windows operating system lau
4、nches a program, it calls the programs WinMain function. Somewhere your application must have WinMain, which performs some specific tasks. Its most important task is creating the applications main window, which must have its own code to process messages that Windows sends it. An essential difference
5、 between a program written for MS-DOS and a program written for Windows is that an MS-DOS-based program calls the operating system to get user input, but a Windows-based program processes user input via messages from the operating system. NOTE Many development environments for Windows, including Mic
6、rosoft Visual C+ version 6.0 with the Microsoft Foundation Class (MFC) Library version 6.0, simplify programming by hiding the WinMain function and structuring the message-handling process. When you use the MFC library, you need not write a WinMain function but it is essential that you understand th
7、e link between the operating system and your programs. Most messages in Windows are strictly defined and apply to all programs. For example, a WM_CREATE message is sent when a window is being created, a WM_LBUTTONDOWN message is sent when the user presses the left mouse button, a WM_CHAR message is
8、sent when the user types a character, and a WM_CLOSE message is sent when the user closes a window. All messages have two 32-bit parameters that convey information such as cursor coordinates, key code, and so forth. Windows sends WM_COMMAND messages to the appropriate window in response to user menu
9、 choices, dialog button clicks, and so on. Command message parameters vary depending on the windows menu layout. You can define your own messages, which your program can send to any window on the desktop. These user-defined messages actually make C+ look a little like Smalltalk. Dont worry yet about
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中设计图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机专业 中英文 翻译 windows 编程 模式
