Hi All,
Using the following code, the entire IE browser gets closed and if any other tabs are open, it asks for confirmation.
privatevoid button1_Click(object sender, RoutedEventArgs e) { WindowInteropHelper wih = new WindowInteropHelper(Application.Current.MainWindow); IntPtr ieHwnd = GetAncestor(wih.Handle, 2 /*GA_ROOT*/); PostMessage(ieHwnd, 0x10/*WM_CLOSE*/, IntPtr.Zero, IntPtr.Zero); } [DllImport("user32", ExactSpelling = true, CharSet = CharSet.Auto)]privatestaticextern IntPtr GetAncestor(IntPtr hwnd, int flags); [DllImport("user32", CharSet = CharSet.Auto)]privatestaticexternbool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
Is there any way to close only the Tab which is running XBAP Application in IE? Any help will be greatly appreciated.
Regards,
Binaya