开发者

Why not calling window procedure instead of calling CallWindowProc?

开发者 https://www.devze.com 2023-04-11 18:42 出处:网络
Why is ther开发者_运维问答e 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

Why is ther开发者_运维问答e 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?


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]


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号