简体   繁体   English

为什么不调用窗口过程而不是调用CallWindowProc?

[英]Why not calling window procedure instead of calling CallWindowProc?

Why is there such function CallWindowProc? 为什么会有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. 因为GetWindowLong (或GetWindowLongPtr )可能返回一个不是函数指针的值, CallWindowProc可以识别并转换为正确的调用。 [1] [1]

The CallWindowProc function handles Unicode-to-ANSI conversion. CallWindowProc函数处理Unicode到ANSI的转换。 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 http://msdn.microsoft.com/en-us/library/windows/desktop/ms633571(v=vs.85).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查在调用CallwindowProc时window proc是否未损坏? - How to check if window proc is not corrupted in call to CallwindowProc? Delphi XE2中从dll调用程序 - Calling procedure from dll in Delphi XE2 在C,多线程,多窗口调用一个窗口过程,每个调用将使用新的局部变量或我需要一个互斥? - In C, multithreaded, multiple windows calling one Window Procedure, will each call use new local variables or do I need a mutex? 为什么在类对象数组上调用delete而不是delete []会导致堆损坏? - Why does calling delete instead of delete[] on an array of class objects cause heap corruption? 为什么调用 SetConsoleCtrlHandler() 会触发警告? - Why calling SetConsoleCtrlHandler() triggers a warning? 在程序集中调用过程时是否需要使用括号? - Do I need to use brackets when calling a procedure in Assembly? 调用更新过程时,TStatusBar闪烁。 轻松解决此问题的方法 - TStatusBar flickers when calling Update procedure. Ways to painlessly fix this 为什么在循环中调用ReadConsole会破坏堆栈? - Why is calling ReadConsole in a loop corrupting the stack? Jenkins curl命令返回XML而不是调用job - Jenkins curl command returns XML instead of calling job 批处理文件调用控制台应用程序 - 使 CMD 窗口保持打开状态 - Batch File calling Console Application - Leaves CMD window open
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM