How to run cocos2d-x inside a c++ Winform

I hope you can understand what i’m trying to say because my English sucks.

I have 2 projects inside my Solution.
If i run them seperately, here’s what they look like:

But i want to do something like this:

Here’s an example: https://github.com/fjz13/Cocos2d-x-ParticleEditor-for-Windows
//I looked at fjz13’s source code didn’t understand how he was able to run cocos inside a win panel.
//Can you explain to me how he did it in c# or just simply show me how to do it in c++?
//(his method only work for cocos2d-x 2.x)
Thank you for your help.
(PS: i’m using the newest cocos 3.8.1)

EDIT: after an hour of googling in many languages i found a trick (but the memory leaks though): http://www.cnblogs.com/GuyaWeiren/p/4600937.html