Question 1
Which of the following statements is correct?
- Windows is a callback programming model.
- In windows the end user controls the flow of program execution after the basic initialization is done.
- Windows is event driven and is non-linear model.
- All of the above
Question 2
Which of the following statements is correct?
- A windows application terminates only when there is WM_END message in message queue.
- A windows application terminates only when there is WM_QUIT message in message queue.
- A windows application terminates only when there is WM_CLOSE message in message queue.
- A windows application terminates only when there is WM_DESTROY message in message queue.
Question 3
Which of the following statements is correct about EndPaint function?
- It marks the end of painting in the specified window.
- It is required for each call to BeginPaint function.
- It should be called only after painting is complete.
- All of the above.
Question 4
Significance of GetMessage function is
- Convert WM_KEYDOWN message into WM_CHAR
- Terminate when the message in calling thread's message queue is WM_END
- Retrieve a message from the calling thread’s message queue and places it in the specified structure
- Dispatch the message to the window procedure
Question 5
The lparam of WM_TIMER procedure is
- Timer ID
- Pointer to an application-defined callback function that was passed to the SetTimer function when the timer was installed
- Time Interval
- None of the above
Question 6
For the following code segment, select the correct statement.
CBrush MyBrush(HS_CROSS, RGB(0, 255, 0));
dc.SelectObject(&MyBrush);
dc.Rectangle(100, 100, 300, 250);
- Draws a rectangle of width 200, height 150 whose interior is filled with cross hatch style, green in color
- Draws a rectangle of width 200, height 150 and the interior is filled with solid green color
- Draws a rectangle of width 200, height 250 whose interior is filled with cross hatch style, green in color
- Draws a rectangle of width 200, height 150 whose interior is filled with cross hatch style, green in color
Question 7
What is the base class of CWinApp?
- CAPP
- CCmdTarget
- CWinThread
- CObject
Question 8
Which of the following is correct with respect to Select object?
- It selects the object into the specified device context. The new object replaces the previous object of the same type.
- It's return type is void.
- Information about the old object is not available for future use.
- It is used to select only pens and brushes into device context.
Question 9
Which of the following is correct for DestroyWindow function?
- It destroys the specified window and terminates the application.
- It destroys the specified window and sends a WM_DESTROY message.
- It destroys modeless dialog boxes created by the CreateDialog function.
- Both B and C
Question 10
To count the number of buttons on mouse, we use the following function
- GetSystemMetrics(SM_MOUSEPRESENT)
- GetSystemMetrics(SM_CMOUSEBUTTONS)
- GetFontMetrics()
- None of the above
Question 11
To get information of the font we use the following statement?
- GetFontMetrics()
- GetTextMetrics()
- GetSystemMetrics(SM_FONTDATA)
- GetSystemMetrics(SM_FONTMETRICS)
Question 12
The 3rd parameter of SetTimer function is?
- Time Interval
- Timer ID
- Long pointer to the function to be notified when the time-out value elapses
- Pointer to the OnTimer function
Question 13
Given a child window control object, how do you get the ID of the control?
- GetID function
- GetDlgItem
- GetChildWndID
- GetDlgCtrlID
Question 14
Which of the following statements is correct if the user clicks child window scrollbar?
- OnVScroll method's 3rd argument is NULL
- OnVScroll method's 3rd argument is a pointer to the control
- OnVScroll method's 1st argument refers to the current position of thumb track
- OnVScroll method's 2nd argument specifies a scroll-bar code that indicates a scrolling request by the user
Question 15
When we execute the following code what does it result in, assuming rect is size of the window?
- DrawText(hdc, "Genesis", -1, &rect, DT_CENTER | DT_VCENTER);
- Displays the last character of text "Genesis" in the center of the window horizontally
- Displays the last character of text "Genesis" in the center of the window both horizontally and vertically
- Displays the text "Genesis" in the center of the window both horizontally and vertically
- Displays the text "Genesis" in the center of the window horizontally
Question 16
When we execute the following code what does it result in?
TextOut(hdc, 100, 125, "Genesis InSoft", -1);
- Displays the text "Genesis InSoft" at logical x and y coordinates
- Displays the text "Genesis" at logical x and y coordinates
- Displays the text "Genesis" at device x and y coordinates
- No text is displayed
Question 17
Which of the following is correct about resources?
- They are stored with a file extension .rs
- They are stored with a file extension .rc
- The resource file when compiled results in .res
- Both B and C
Question 18
The mapping mode MM_TEXT relates to
- X increases horizontally right and Y increases vertically down
- Each unit is one twips
- X increases horizontally right and Y increases vertically up
- Each unit is one cm
Question 19
Invalidate(TRUE) does what?
- The background is erased when the BeginPaint function is called.
- The background is erased when the EndPaint function is called.
- The background is not erased when the BeginPaint function is called.
- The background is not erased when the EndPaint function is called.
Question 20
CWnd::InvalidateRect(&rect) does what?
- Erases "rect" area and its child windows if any
- Erases entire client area and its child windows if any
- Erases "rect" area and does not repaint its child windows if any
- Erases entire client area and does not repaint its child windows if any
Answers
Answer 1 - D
Answer 2 - B
Answer 3 - D
Answer 4 - C
Answer 5 - B
Answer 6 - A
Answer 7 - C
Answer 8 - A
Answer 9 - D
Answer 10 - B
Answer 11 - B
Answer 12 - C
Answer 13 - D
Answer 14 - B
Answer 15 - D
Answer 16 - D
Answer 17 - D
Answer 18 - A
Answer 19 - A
Answer 20 - C
No comments:
Post a Comment