order of events when a window starts in Visual C++ MFC -
suppose have class derived cwnd have event handler functions onpaint
,oncreate
, onsize
. know of them occured when window starts want see order between them.
when set breakpoint in 1 of them, after ending function, control not passed , goes 1 of mfc's built-in .cpp files example wincore.cpp
?
how can understand order? links or teach me way prevent control going mfc built-in classes?
the order in messages arrive not defined , documented. however, messages ordered respect others. msdn explicitly states wm_nccreate
sent prior wm_create
. documentation wm_create
has few more hints far order concerned (emphasis mine):
sent when application requests window created calling
createwindowex
orcreatewindow
function. (the message sent before function returns.) window procedure of new window receives message after window created, before window becomes visible.
it should clear, window has exist receive additional messages. consequently, first wm_size
sent after wm_create
. wm_paint
requires window visible. plus, low priority message generated if message queue empty.
during window creation order wm_create
, wm_size
, wm_paint
.
if interested in observing messages can use tool spy++ (spyxx.exe) comes visual studio. can log arbitrary messages , gives detailed information. if educational purposes (as opposed deducing behavior) helpful tool.
note downvoters: if feel answer inaccurate or needs improvement please leave note future visitors.
Comments
Post a Comment