Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Latest commit

 

History

History
15 lines (13 loc) · 501 Bytes

modal-dialog-on-new-thread.md

File metadata and controls

15 lines (13 loc) · 501 Bytes
layout title
page
Modal dialog on new thread
new Thread(() => {
    var excelWindowThatIsTheOwner = new NativeWindow();

    excelWindowThatIsTheOwner.AssignHandle(new IntPtr(Application.Hwnd));

    // Show modal dialog (here: a message box)
    MessageBox.Show(owner: excelWindowThatIsTheOwner,
                    text: "I am a modal MessageBox.\r\nNow bring another application to the foreground and then try to bring excel back via the windows taskbar...");
}).Start();