c - How do you indicate errors in handling messages in window procedures? -
i'm authoring library handle information raw input api , i'm handling cascading functions. has resulted in several, small, readable, , focused functions.
but, has hit me don't understand how properly indicate failure windows. have function:
/* oninput: handle data received windows via `wm_input` message. */ static lresult callback oninput(hwnd hwnd, uint msg, wparam wparam, lparam lparam) { bool dispatchrawinput(const prawinput); assert(msg == wm_input); return defwindowproc(hwnd, msg, wparam, lparam); }
and returns 0 as documentation states should; assumes success.
the actual text states:
"if application processes message, should return zero."
but do if can't handle it? assumed you'd call defwindowproc
, leave @ doesn't signal windows happened.
the message wm_create
seems instance can find returns other zero:
"if application processes message, should return 0 continue creation of window. if application returns –1, window destroyed , createwindowex or createwindow function returns null handle."
is error handling programmer/team , not necessity inform operating system? events wm_create
fail , need prevent creation of window?
you indicate errors according documentation each message. if message doesn't errors, can safely assume message has no error indicator. that's common notification messages, os telling has happened. doesn't need response you.
Comments
Post a Comment