-
November 27th, 1999, 02:48 AM
#1
LRESULT CALLBACK
What is meant by "LRESULT CALLBACK" in windows procedure. thanks in advance
LRESULT CALLBACK WindProc(....)
Tuf
-
November 27th, 1999, 05:10 AM
#2
Re: LRESULT CALLBACK
LRESULT & CALLBACK are two macros to hide platform specifics.
LRESULT is the return value - actually a long.
CALLBACK is the calling convention for functions that will be called from inside a windows functions (calling convention is in which order parameters are put on stack, how your function name is "beautified", and who cleans up the stack)
I Might guess that under Win32, CALLBACK evaluates to __stdcall, but this is but a guess.
The reason in: in a build for e.g. an Alpha platform, these macros might evaluate to something different (this is handled in the windows headers), but you don't have to modify your code
Use:
declare & implement your func using
LRESULT CALLBACK WndProc(...)
Peter
-
November 28th, 1999, 03:53 AM
#3
Re: LRESULT CALLBACK
what windows do when windproc returns 0 or 1, I mean what is the differnence between returning 0 and 1, thanks
-
November 29th, 1999, 01:19 PM
#4
Re: WndProc Return value
The return value depends on the message you handle. Check the online documentation for the message. With many messages, the return value is ignored; others require a true/false; (e.g. WM_NOTIFY/LVN_ENDLABELEDIT: return true if you accept the change, or false to restore the previous value) Other messages require a HWND, or a count to be returned.
In general, pass unhandled messages to the default window procedure. (DefWindowProc(..))In most cases, you should also pass Messages to the default handler, where you "added" some behavior.
MyWndProc
{
switch (uMsg) {
case WM_FOO : /* your msg handling here */; break;
case WM_BAR : return barActive ? 1 : 0; // msg that requires return value, not passed to default handler
}
return DefWndProc(uMsg, ...);
}
Peter
-
January 23rd, 2013, 02:50 PM
#5
Re: LRESULT CALLBACK
How does LRESULT CALLBACK work in an windows application? What does it do? It's job?
-
January 23rd, 2013, 04:36 PM
#6
Re: LRESULT CALLBACK
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|