From 15c980ff10355df9567335dbf7045d210aa09097 Mon Sep 17 00:00:00 2001 From: gocha Date: Mon, 19 Oct 2009 04:34:48 +0000 Subject: [PATCH] win32: improved Edit action of Lua console. it tries to open a script by other ways if there is no association with "edit" action. --- src/drivers/win/luaconsole.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/drivers/win/luaconsole.cpp b/src/drivers/win/luaconsole.cpp index 062f14db..31a6a70f 100644 --- a/src/drivers/win/luaconsole.cpp +++ b/src/drivers/win/luaconsole.cpp @@ -141,7 +141,9 @@ INT_PTR CALLBACK DlgLuaScriptDialog(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l SendDlgItemMessage(hDlg,IDC_EDIT_LUAPATH,WM_GETTEXT,(WPARAM)512,(LPARAM)Str_Tmp); // tell the OS to open the file with its associated editor, // without blocking on it or leaving a command window open. - ShellExecute(NULL, "edit", Str_Tmp, NULL, NULL, SW_SHOWNORMAL); + if((int)ShellExecute(NULL, "edit", Str_Tmp, NULL, NULL, SW_SHOWNORMAL) == SE_ERR_NOASSOC) + if((int)ShellExecute(NULL, "open", Str_Tmp, NULL, NULL, SW_SHOWNORMAL) == SE_ERR_NOASSOC) + ShellExecute(NULL, NULL, "notepad", Str_Tmp, NULL, SW_SHOWNORMAL); } break; case IDC_BUTTON_LUABROWSE: