Programming with Microsoft Visual C++.NET 6ed [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Programming with Microsoft Visual C++.NET 6ed [Electronic resources] - نسخه متنی

George Shepherd, David Kruglinski

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید








Chapter 5: Windows Message Mapping



Overview


Chapter 3, you saw how the MFC library application framework calls the view class's virtual OnDraw function. In the online help for the MFC library, where it documents the CView class and its base class, CWnd, you'll see several hundred member functions. Functions whose names begin with On—such as OnKeyDown and OnLButtonUp—are member functions that the application framework calls in response to various Windows "events" such as keystrokes and mouse clicks.

Most of these functions that are called by the application framework aren't virtual functions and thus require more programming steps. This chapter explains how to use the Microsoft Visual C++ .NET Class View's Properties window to set up the message map structure necessary for connecting the application framework to your functions' code.

This chapter includes sample applications of message map functions. The first two applications use an ordinary CView class. The Ex05a example shows the interaction between user-driven events and the OnDraw function. The Ex05b example shows the effects of different Windows mapping modes.

More often than not, however, you'll want a scrolling view. The last example, Ex05c, uses CScrollView in place of the CView base class. This allows the MFC library application framework to insert scroll bars and connect them to the view.


/ 319