function OnInit(initData) { initData.name = "CloseConfirm"; initData.version = "1.0"; initData.copyright = "(c) 2020 Leo Davidson"; initData.url = "https://resource.dopus.com/t/confirm-before-closing-lister-window/34600"; initData.desc = ""; initData.default_enable = true; initData.min_version = "12.0"; } function OnCloseLister(closeListerData) { // Is Opus, or Windows, being shutdown completely? if (closeListerData.shutdown) { return false; // Don't block closing the window. } // Are any qualifier keys held down? if (closeListerData.qualifiers != "none") { return false; // Don't block closing the window. } var dlg = closeListerData.lister.Dlg(); var choice = dlg.Request("Are you sure you want to close the window?", "Close|Cancel", "Close Lister"); if (choice == 1) { return false; // Don't block closing the window. } return true; // Block closing the window. }