2

What is the difference between WindowProc and CallWindowProc ?

I can imagine when registering a new window class I can specify my own WindowProc for it.
This leaves the question: When and what for do I use CallWindowProc ?

Bitterblue
  • 13,162
  • 17
  • 86
  • 124

2 Answers2

4

When you subclass a window using SetWindowLong/Ptr(GWL_WNDPROC) to assign a new WindowProc() to the window, the replacement WindowProc() uses CallWindowProc() when it needs to call the window's original WindowProc():

Subclassing a window

The preferred way to subclass a window is to use SetWindowSubClass() instead:

Safer subclassing

ChrisW
  • 54,973
  • 13
  • 116
  • 224
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
-1

See msdn. CallWindowProc is used for subclassing.

ikh
  • 10,119
  • 1
  • 31
  • 70