It just occurred to me...

has anyone ever tried replacing the DefWindowProc? I mean, the whole thing so you don't have to call it from the application defined Window Proc. I figure, if anyones tried it, it must have been an ASM person.

--Chorus
Posted on 2002-05-24 11:01:08 by chorus
The answer is yes, it just depends on how you look at it.

all DefWindowProc does is define some default behaviour for control X so a typical loop looks like so.



WinProc
.if msg == WM_PAINT
;do_paint
xor eax, eax
inc eax
ret
.endif

invoke DefWindowProc (blah blah blah)
ret


You will notice that in the paint event, we did not call DefWindowProc. There was no need as we handled the paint event completely ourselves. In effect, we redefined what the default behaviour for this control was.

I do not believe anyone would willingly replace every single message that there is just to do it hehe. Egads what a lot of work that would take.
Posted on 2002-05-24 12:12:25 by Graebel
hehe..
I meant *every* message :)
I know that you don't have to call the DefWindowProc if you handle the message completely yourself (although there are instances where I find I must call it even if I do intercept a message). Personally, I like to try and find ways *not* to call APIs or DefWindowProc (basically anything that I don't have control over). So, I just thought I'd ask :)

cya

--Chorus
Posted on 2002-05-24 23:32:39 by chorus

Personally, I like to try and find ways *not* to call APIs or DefWindowProc (basically anything that I don't have control over).


Yes, you could dig into the User32.dll where DefWindowProc resides. :tongue:
Posted on 2002-05-25 06:03:06 by C.Z.