Regarding the empty title - this is because the name of the HwndSource
window doesn't have anything to do with the window title. The HwndSource
window that the code creates above is a child of the window represented by InParentWindowHandle
. It is this window whose text is used for the title bar. You should call SetWindowText()
using that HWND
in order to set the title of the window.
As for the typing issue, are you sure that you need to add a hook? I've only created small test apps with WPF/Win32 integration, but I don't recall having to do anything special to ensure that the WPF controls received all keyboard input.