You can't turn a capturing C++ lambda into a WNDPROC, which is an ordinary function pointer. You'd still have to ferry the lambda via a context pointer, which is what this blog post and the other solutions in the comments are all about.
I guess I need to prove a point on my Github during next week.
C++ lambdas are basically old style C++ functors that are compiled generated, with the calling address being the operator().
https://github.com/pjmlp/LambdaWndProc/blob/main/LambdaWndPr...
https://github.com/pjmlp/LambdaWndProc/blob/main/LambdaWndPr...