suppose that I have a class derived from CWnd that have the event handler functions OnPaint
,OnCreate
and OnSize
. As you know all of them are occured when the window starts but I want to see what is the order between them.
when I set a breakpoint in one of them, after ending the function, the control is not passed to another and goes to one of the MFC's built-in .cpp files for example wincore.cpp
?
How can I understand the order? any links or teach me a way to prevent the control from going to MFC built-in classes?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to call a C++ dll from C# windows application
- Visual Studio 2010 randomly says the command line
- how to get running process information in java?
- efficiently calling unmanaged method taking unmana
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- How to show location of errors, references to memb
- Warning : HTML 1300 Navigation occured?
- Log4Net Multiple Projects
- What does it means in C# : using -= operator by ev
- Bundling the Windows Mono runtime with an applicat
- Compiling error in C++ project with C and C++ code
The order in which messages arrive is not fully defined and documented. However, some messages are ordered with respect to others. The MSDN explicitly states that
WM_NCCREATE
is sent prior toWM_CREATE
. The documentation forWM_CREATE
has a few more hints as far as the order is concerned (emphasis mine):It should be immediately clear, that a window has to exist to receive additional messages. Consequently, the first
WM_SIZE
will be sent afterWM_CREATE
. As forWM_PAINT
it requires that a window is visible. Plus, it is a low priority message that is only generated if the message queue is empty.During window creation the order is
WM_CREATE
,WM_SIZE
,WM_PAINT
.If you are only interested in observing messages you can use a tool like Spy++ (spyxx.exe) that comes with Visual Studio. It can log arbitrary messages and gives you detailed information. If this is for educational purposes (as opposed to deducing behavior) it is a very helpful tool.
Note to downvoters: If you feel this answer is inaccurate or needs improvement please leave a note to help future visitors.