Capture selected text fix for CPP sample
WPF Sample : End capture session when window closes