Reputation: 3020
Why is there such function CallWindowProc? We are supplying the address of the window procedure, so isn't it better to call the function instead of calling another function which calls the function?
Upvotes: 4
Views: 744
Reputation: 1727
The CallWindowProc function handles Unicode-to-ANSI conversion. You cannot take advantage of this conversion if you call the window procedure directly.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633571(v=vs.85).aspx
Upvotes: 1
Reputation: 129764
Because GetWindowLong
(or GetWindowLongPtr
) might return a value that is not a function pointer, which CallWindowProc
can recognise and translate into a proper call. [1]
Upvotes: 8