12. To get the last error encountered in any application, which API can we use ?
a. GetError
b. GetWindowError
c. GetLastError
d. None of the above
13. WM_CREATE message is generated when we call
a. ShowWindow
b. UpdateWindow
c. CreateWindow
d. RegisterClass
14. GetMessages last 3 parameters are set to NULL or zero
a. Because we are interested in all the messages for all the windows that we
have constructed.
b. Because we are interested in messages only from client area
c. Because we wish to TranslateMessage
d. None of the above.
15. SendMessage is a blocking call ? True / False
16. PostMessage directly send messages to windows procedure. True/False
17. First WM_PAINT message it given to windows proc when we call
a. UpdateWindow
b. CreateWindow
c. ShowWindow
d. RegisterClass
18. How many WM_PAINT messages can be there in MessageQueue of a program ?
a. 1
b. 2
c. Infinite
d. 0
19. Can we write a code like this ?
case WM_PAINT:
return 0;
a. Yes
b. No, because we wont get WM_PAINT messages out of message queue
c. No, because we wont be validating the invalidate region
d. Yes, because we have already processed the message.
20. When we close an application using X on the right hand top corner, windows
sends the following messages in sequence
a. WM_SYSCOMMAND / WM_DESTROY / WM_CLOSE / WM_QUIT
b. WM_SYSCOMMAND / WM_CLOSE / WM_DESTROY / WM_QUIT
c. WM_LBUTTONDOWN / WM_SYSCOMMAND / WM_CLOSE /
WM_DESTROY / WM_QUIT
d. WM_SYSCLOSE / WM_CLOSE / WM_DESTROY / WM_QUIT
21. There are two major types of messages in Windows. What are these two types ?
Queued and Non-Queued
22. To force an application to generate WM_PAINT message, we have to fire
a. WM_PAINT using sendmessage
modeless dialog box to search for any word within the buffer. If you find that
word, make some identification such as change background color or change
alignment etc.
2. Create 2 edit boxes with 1 add button. 1 more edit box for the result. Make a call
to add function from a library. The result should be displayed with help of a
thread which does the task of sending data to edit box. ( HINT: Thread should
block on Event object and when library returns, you should notify the thread to
display the data )