Page 237 - DCAP408_WEB_PROGRAMMING
P. 237
Unit 14: Text and Graphics Output
{ Notes
// Translate the message and dispatch it to WindowProc()
TranslateMessage(&msg);
DispatchMessage(&msg);
}
// If the message is WM_QUIT, exit the while loop
if(msg.message == WM_QUIT)
break;
// Run game code here
// ...
// ...
}
Now our program can handle things as timely as we please, without having to worry about
Windows and its tedious messages.
Self Assessment
Fill in the blanks:
14. We use ......................... to create a loop that handled all the Windows message sent.
15. ......................... looks into the message queue and checks to see if any messages are waiting.
14.10 Summary
In character mode, the display screen is treated as an array of blocks, each of which can
hold one ASCII character.
In graphics mode, the display screen is treated as an array of pixels, with characters and
other shapes formed by turning on combinations of pixels.
A device context is a Windows data structure containing information about the drawing
attributes of a device such as a display or a printer.
The WM_PAINT message is sent when the system or another application makes a request
to paint a portion of an application’s window.
Graphics is a very important part of visual basic programming as an attractive interface
will be appealing to the users.
To draw a straight line, just click on the line control and then use your mouse to draw the
line on the form.
Similarly, to draw a shape, just click on the shape control and draw the shape on the form.
An animated GIF (Graphics Interchange Format) file is defined as a graphic image on a
Web page that moves.
We use GetMessage() to create a loop that handled all the Windows message sent.
PeekMessage() looks into the message queue and checks to see if any messages are waiting.
LOVELY PROFESSIONAL UNIVERSITY 231