TAILIEUCHUNG - Lecture Visual programming: Chapter 26 - Muhammad Bilal Zafar

The following will be discussed in this chapter: Construction of syntax trees, the structure of a type, syntax-directed translation schemes, postfix translation schemes, parser-stack implementation of postfix SDT's, SDT's with actions inside productions, eliminating left recursion from SDT's. | LESSON 26 Overview of Previous Lesson(s) Over View Windows Programming WinMain() Where execution of the program begins and basic program initialization is carried out. WndProc() Called by Windows to process messages for the application. Contains the larger portion of code deals in responding to messages caused by user input of one kind or another. 3 Over View 1st we have to define the type of window we want to create. Windows defines a special struct type WNDCLASSEX It contains the data specified by a window. 4 WNDCLASSEX struct WNDCLASSEX { UINT cbSize; // Size of this object in bytes UINT style; // Window style WNDPROC lpfnWndProc; // Pointer to message processing function int cbClsExtra; // Extra bytes after the window class int cbWndExtra; // Extra bytes after the window instance HINSTANCE hInstance; // The application instance handle HICON hIcon; // The application icon HCURSOR hCursor; // The window cursor HBRUSH hbrBackground; // The brush defining the background color LPCTSTR lpszMenuName; // A pointer to the name of the menu LPCTSTR lpszClassName; // A pointer to the class name HICON hIconSm; // A small icon associated with the window }; 5 Over View 2nd step is to tell Windows about our defined structure. This is done using the Windows API function RegisterClassEx() RegisterClassEx(&WindowClass); 6 Over View Each instance of the application must make sure that it registers the window classes that it needs. CreateWindow() function is now used for creating a window whom characteristics are already known. 7 Over View The last task that WinMain() needs to do is dealing with the messages that Windows may have queued for our application. 2 kinds of Win messages Queued Messages Windows places in a queue and WinMain() function extract these messages from the queue for processing. The code in WinMain() that does this is called the message loop. 8 Over View Non - Queued Messages There are non - queued messages that result in the WndProc() function being called

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.