Implemented program launching by double click.
This commit is contained in:
parent
db14dbf12b
commit
b5960a175f
|
@ -1139,8 +1139,12 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
|
||||||
|
|
||||||
case ID_EXECUTE: {
|
case ID_EXECUTE: {
|
||||||
struct ExecuteDialog dlg = {{0}};
|
struct ExecuteDialog dlg = {{0}};
|
||||||
if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_EXECUTE), hwnd, ExecuteDialogWndProg, (LPARAM)&dlg) == IDOK)
|
if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_EXECUTE), hwnd, ExecuteDialogWndProg, (LPARAM)&dlg) == IDOK) {
|
||||||
ShellExecute(hwnd, _T("open")/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
|
HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
|
||||||
|
|
||||||
|
if ((int)hinst <= 32)
|
||||||
|
display_error(hwnd, GetLastError());
|
||||||
|
}
|
||||||
break;}
|
break;}
|
||||||
|
|
||||||
case ID_HELP:
|
case ID_HELP:
|
||||||
|
@ -2387,9 +2391,16 @@ static void activate_entry(ChildWnd* child, Pane* pane)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
TCHAR cmd[MAX_PATH];
|
||||||
|
HINSTANCE hinst;
|
||||||
|
|
||||||
/*TODO: start program, open document... */
|
get_path(entry, cmd);
|
||||||
|
|
||||||
|
/* start program, open document... */
|
||||||
|
hinst = ShellExecute(child->hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, SW_SHOWNORMAL);
|
||||||
|
|
||||||
|
if ((int)hinst <= 32)
|
||||||
|
display_error(child->hwnd, GetLastError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue