win32: improved Edit action of Lua console. it tries to open a script by other ways if there is no association with "edit" action.

This commit is contained in:
gocha 2009-10-19 04:39:19 +00:00
parent 2db8e74050
commit 651aa9e4a5
1 changed files with 7 additions and 5 deletions

View File

@ -8,10 +8,10 @@
#include "OpenArchive.h"
#ifdef WIN32
#include "common.h"
#include "main.h"
#include "driver.h"
#ifdef WIN32
#include "common.h"
#include "main.h"
#include "driver.h"
#endif
#include "..\lua-engine.h"
@ -598,7 +598,9 @@ LRESULT CALLBACK LuaScriptProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
{
// tell the OS to open the file with its associated editor,
// without blocking on it or leaving a command window open.
ShellExecute(NULL, "edit", PhysicalName, NULL, NULL, SW_SHOWNORMAL);
if((int)ShellExecute(NULL, "edit", PhysicalName, NULL, NULL, SW_SHOWNORMAL) == SE_ERR_NOASSOC)
if((int)ShellExecute(NULL, "open", PhysicalName, NULL, NULL, SW_SHOWNORMAL) == SE_ERR_NOASSOC)
ShellExecute(NULL, NULL, "notepad", PhysicalName, NULL, SW_SHOWNORMAL);
}
if(created)
{