Page 47 - DCAP408_WEB_PROGRAMMING
P. 47
Unit 3: Windows Programming
used by Windows programmers, and all the data types utilized by the different functions Notes
and subsystems.
WINMAIN (also written as MAIN) is a user-defined function called by Windows to start
execution of an application.
The return value allocated to WINMAIN is optional, but by convention, the return value
is derived from the wParam& parameter of a %WM_QUIT message.
There are two chief things you must perform in order to generate even the simplest
window: you must create the middle point of the program, and you must tell the operating
system how to react when the user does what.
The Win32 library offers two classes for generating the main window and you can use any
one of them. They are WNDCLASS and WNDCLASSEX.
Message loop is utilized to catch messages and pass them onto our WndProc function.
To discover out what the last message obtained was, we can use the GetMessage function.
The WNDLCLASS and the WNDCLASSEX classes are utilized to initialize the application
window class.
To permit Windows to converse with your application, we’ll generate a great little function
known as a Windows procedure.
3.9 Keywords
Return: The return value allocated to WINMAIN is optional, but by convention, the return value
is derived from the wParam& parameter of a %WM_QUIT message.
Windows Procedure: To permit Windows to converse with your application, we’ll generate a
great little function known as a Windows procedure.
Windows.h: The Windows.h is a Windows-specific header file for the C programming language
which comprises declarations for all of the functions in the Windows API.
WINMAIN: WINMAIN (also written as MAIN) is a user-defined function called by Windows to
start execution of an application.
3.10 Review Questions
1. Illustrate the function of Windows.h.
2. What is WINMAIN? Write its syntax and illustrate the parameters.
3. Explain the use of return value allocated to WINMAIN.
4. Explain the process of creating the Programs Window.
5. Define the classes used in WNDCLASS and the WNDCLASSEX.
6. Illustrate the concept of WNDCLASSEX variable with example.
7. What are the parameters of GetMessage function? Illustrate.
8. How to create a new window class? Illustrate with example.
9. What is Message Processing Function WndProc()? Illustrate its parameters.
10. Describe the steps for adding and compiling custom resource data.
LOVELY PROFESSIONAL UNIVERSITY 41