Bitterblue
Bitterblue

Reputation: 14075

Difference between WindowProc and CallWindowProc?

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 ?

Upvotes: 2

Views: 3686

Answers (2)

Remy Lebeau
Remy Lebeau

Reputation: 596256

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

Upvotes: 4

ikh
ikh

Reputation: 10417

See msdn. CallWindowProc is used for subclassing.

Upvotes: -1

Related Questions