How WM_PAINT message gets called in MFC,please explain it .
a)Who calls the WM_PAINT message?
b)When it gets called?
c)how it comes to message queue?

Please Explain it

Answers were Sorted based on User's Feedback



How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)Wh..

Answer / vijay

WM_Paint Message will be invoked by the system and not by
any application.

This message is sent when updatewindow or RedrawWindow
Function is called.

Dispactch Message Function dispatches the message , it gets
the message from the GetMessage() or PeekMessage()
Functions.

Is This Answer Correct ?    18 Yes 2 No

How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)Wh..

Answer / sai

a)The framework calls this member function

b)This function get called, when Windows or an application
makes a request to repaint a portion of an application's
window.

c)

Is This Answer Correct ?    12 Yes 5 No

How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)Wh..

Answer / imtiaz

2.System sends this message to a window procedure when
changes to the window have altered the content of the
client area.
1 & 3 .he message is sent when the UpdateWindow or
RedrawWindow function is called, or by the DispatchMessage
function when the application obtains a WM_PAINT message by
using the GetMessage or PeekMessage function

Is This Answer Correct ?    2 Yes 0 No

How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)Wh..

Answer / aditya

The WM_PAINT message is sent when the system or another
application makes a request to paint a portion of an
application's window. The message is sent when the
UpdateWindow or RedrawWindow function is called, or by the
DispatchMessage function when the application obtains a
WM_PAINT message by using the GetMessage or PeekMessage
function.

A window receives this message through its WindowProc
function.

Is This Answer Correct ?    1 Yes 0 No

How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)Wh..

Answer / saurabh shakya

n the preceding two examples, a CClientDC object was used to draw in the client area. This approach has the shortcoming that when the window is resized, the graphics are not repainted; in the preceding examples, they must be restored by again choosing the menu item. Using a CPaintDC object and putting the graphics calls into the OnPaint() function changes this behavior, so that the graphics are redrawn each time a WM_PAINT message is sent. This is done in all subsequent examples.

Windows OS sets the paint flag whenever a window gains one or more pixels. Windows OS sends a WM_PAINT message to the window whenever the client area needs to be repainted. When there are no higher-priority messages to be processed, the WM_PAINT message is processed and the window is repainted. The WM_PAINT message will be sent whenever any of the following events occur:

• The window has one or more invalid regions. (This is caused by one or more previously hidden areas of the window being brought back into view. Your window is brought back into view when a window that was above your window is closed or moved. Windows OS keeps track of all the invalid regions since the last repainting occurred and will repaint the invalid rectangle that encloses all invalid regions.)
• The user resizes the window.
• Part of the client area is scrolled.
• The application invalidates the client area, using one of the function calls: CWnd::Invalidate(), CWnd::InvalidateRect(), or CWnd::InvalidateRgn().

Is This Answer Correct ?    2 Yes 1 No

How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)Wh..

Answer / vasudha

Then what is the right answer

Is This Answer Correct ?    0 Yes 0 No

How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)Wh..

Answer / jli

When pWnd->Invalidate() get call.
then your pWnd will WM_APINT messages

Is This Answer Correct ?    0 Yes 1 No

How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)Wh..

Answer / manjula

Both the answers are wrong.

Is This Answer Correct ?    2 Yes 12 No

Post New Answer

More MFC Interview Questions

what is the use of Mutex and critical section

2 Answers  


In SDI how many view's are attached to document object and in MDI how many view's are attached to Document object?

2 Answers   Wipro,


Hi can anyone explain about the synchronization objects types and where we are using in the code.

1 Answers  


Have you ever used win32 APIs ?

4 Answers   Microsoft,


is it possible to display a window .without using windowclass

1 Answers   E Logic,






1) create ToolTip in MFC?

2 Answers   HCL,


What?s the difference between Modal and Modeless Dialog?

12 Answers   Jekson, Usl India,


Can you explaing the relashionship between document,frame and view ?

2 Answers  


Name the Synchronization objects?

2 Answers  


What is stack size in win32 program?

1 Answers   HCL,


what is the component of CLR ?

8 Answers   AZTEC, Symphony,


Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A. Explain how a pointer to function can be declared in C++? B. List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header ("Include") Files.

3 Answers   ABC, HCL, Infosys,


Categories