Question 1
Which of the following is a correct prototype for WinMain function?
- int FAR PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int).
- void FAR PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int).
- FAR PASCAL WinMain(HINSTANCE, HINSTANCE, int, char**)
- None of the above
Question 2
Which is the first message generated when ShowWindow method is executed?
- WM_SIZE
- WM_PAINT
- WM_DRAW
- WM_CREATE
Question 3
What is the functionality of UpdateWindow method?
- Updates the client area of the specified window by sending a WM_PAINT message to the message queue.
- Updates the client area by sending a WM_PAINT message directly to the window procedure of the specified window, bypassing the application queue.
- Updates the client area of the specified window by using Paint method of CWindow class.
- None of the above
Question 4
Which of the following is not a Device Context class?
- CWindowDC
- CClientDC
- CPaintDC
- CFrameDC
Question 5
When a key is pressed, which of the following message handler is invoked first?
- OnChar
- OnKeyDown
- OnKeyUp
- OnKeyPressed
Question 6
For the following code segment, select the correct statement.
CPen MyPen(PS_DASH, 3, RGB(255, 255, 0));
dc.SelectObject(&MyPen);
dc.LineTo(100, 100);
- Draws a 3 pixel width red dashed line.
- Draws a 3 pixel width yellow dashed line.
- Draws a 3 pixel width yellow dotted line.
- Draws a 1 pixel width yellow dashed line.
Question 7
Which of the following statements, creates a push button.
- m_btn.Create(" Ok ", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, CRect(170, 10, 260, 35), this, ID_BTN_OK);
- m_btn.Create(" Ok ", CRect(170, 10, 260, 35), BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, this, ID_BTN_OK);
- m_btn.Create(" Ok ", CRect(170, 10, 260, 35), BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, ID_BTN_OK, this);
- None of the above
Question 8
What are the header files required for a simple windows application with basic child window controls?
- afxwin.h and afxbasic.h
- afxwin.h and afxwindows.h
- afxbasic.h
- afxwin.h
Question 9
What is the return value from MessageBox function, when user clicks "Yes" button?
- ID_YES
- IDYES
- ID_OK
- IDOK
Question 10
What is the message generated when user clicks close button at the right top of a window's title bar?
- WM_CLOSE
- WM_DESTROY
- WM_QUIT
- None of the above
Question 11
What styles are included with LBS_STANDARD for a list box?
- LBS_HASSTRINGS, LBS_NOTIFY, LBS_SORT
- LBS_HASSTRINGS, LBS_MULTIPLESEL, LBS_SORT
- LBS_NOTIFY, LBS_SORT
- LBS_HASSTRINGS, LBS_SORT
Question 12
What is the use of the following statement?
myListBox.FindString(-1, "Hello");
- Searches entire list box contents, for the string "Hello".
- Searches the list box contents, for the string "Hello", in the reverse direction, starting from the current selection index.
- Generates a compiler error.
- Generates a run-time error.
Question 13
Choose the correct statement with respect to messages for CScrollBar object?
1. SB_PAGE_LEFT and SB_PAGE_UP function the same way.
2. SB_LINE_RIGHT and SB_LINE_DOWN function the same way.
3. When user is dragging scroll box, message generated is SB_THUMBTRACK.
4. When user is dragging scroll box, message generated is SB_THUMBPOSITION.
- 1 and 2
- 1, 2 and 4
- 1, 2 and 3
- All of the above
Question 14
What are the ways of getting a handle to device context?
- Use GetDC function
- Use CreateDC function
- Use BeginPaint function
- Both A and C
Question 15
What is the base class of CDialog?
- CWnd
- CWindow
- CFrameWindow
- CModalDialog
Question 16
Select the correct sequence of method calls, when the user clicks Ok (IDOK) button of a dialog box.
- UpdateData(FALSE), EndDialog
- UpdateData(TRUE), EndDialog
- EndDialog, UpdateData(FALSE)
- UpdateData(TRUE)
Question 17
If you have added the OK (IDOK) button in a modeless dialog box, and you want to terminate dialog box when it is clicked, what approach you should follow?
- Override the OnOK member function and call the base-class OnOk() member function.
- Override the OnOK member function and call DestroyWindow from within it.
- Just override the OnOK member function.
- Do not override the OnOK member function.
Question 18
CSpinButtonCtrl is derived from
- CScrollBar
- CWnd
- CWindow
- None of the above
Question 19
How does a property page indicate property sheet, that its contents have been updated and the button "Apply" should be activated.
- Invoke SetUpdated(TRUE)
- Invoke SetUpdated(FALSE)
- Invoke SetModified(FALSE)
- Invoke SetModified(TRUE)
Question 20
If the number of property pages are more, how do you set the property page to display scrolling property sheets?
- EnableStackedTabs(TRUE)
- EnableStackedTabs(FALSE)
- It is the default behaviour
- EnableScroll(TRUE)
Answers
Answer 1 - A
Answer 2 - A
Answer 3 - B
Answer 4 - D
Answer 5 - B
Answer 6 - D
Answer 7 - A
Answer 8 - D
Answer 9 - B
Answer 10 - A
Answer 11 - A
Answer 12 - A
Answer 13 - C
Answer 14 - C
Answer 15 - A
Answer 16 - B
Answer 17 - B
Answer 18 - B
Answer 19 - D
Answer 20 - B
No comments:
Post a Comment