What is difference between win32 API SetParent function and createwindow with passed parent hwnd paramter?

In win32 API, we can set SetParent with one parent window , and CreateWindow with an "hWndParent" parameter. What is the difference between the two functions?
One of them creates a window ( CreateWindow ). One of them does not create a window ( SetParent ). That's a pretty big difference.
The whole ancestry thing with windows is really important. Depending on how you look at it, you can have parents, grand parents, great grand parents, great great grand parents, siblings, etc!
I think the second one is much more complex and this complexity might lead your code to suffer from bugs and errors. There are programs that might help with it, such as checkmarx but my recommendation is to try and detect those errors on the go and fix them.
Good luck anyway.
Registered users can post here. Sign in or register to post.