winefile - program launching by double click

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog
Implemented program launching by double click

Index: programs/winefile/winefile.c
===================================================================
RCS file: /home/wine/wine/programs/winefile/winefile.c,v
retrieving revision 1.5
diff -u -r1.5 winefile.c
--- programs/winefile/winefile.c	15 Oct 2002 02:21:08 -0000	1.5
+++ programs/winefile/winefile.c	15 Oct 2002 21:21:17 -0000
@@ -125,7 +125,7 @@
 	HWND	hwnd;
 	Pane	left;
 	Pane	right;
-        int		focus_pane;		/* 0: left  1: right */
+	int		focus_pane;		/* 0: left  1: right */
 	WINDOWPLACEMENT pos;
 	int		split_pos;
 	BOOL	header_wdths_ok;
@@ -1139,8 +1139,12 @@
 
 				case ID_EXECUTE: {
 					struct ExecuteDialog dlg = {{0}};
-					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);
+					if (DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_EXECUTE), hwnd, ExecuteDialogWndProg, (LPARAM)&dlg) == IDOK) {
+						HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
+
+						if ((int)hinst <= 32)
+							display_error(hwnd, GetLastError());
+					}
 					break;}
 
 				case ID_HELP:
@@ -1222,7 +1226,7 @@
 
 
 const static LPTSTR g_pos_names[COLUMNS] = {
-        _T(""),			/* symbol */
+	_T(""),			/* symbol */
 	_T("Name"),
 	_T("Size"),
 	_T("CDate"),
@@ -2387,9 +2394,16 @@
 #endif
 		}
 	} else {
+		TCHAR cmd[MAX_PATH];
+		HINSTANCE hinst;
+
+		get_path(entry, cmd);
 
-	        /*TODO: start program, open document... */
+		 /* 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());
 	}
 }
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux