Fixed CMake error in case DiffusionCore is not build.
Added explicit cast to HWND.
Merge branch 'bug-18468-DiffusionCoreCMakeError'