shell32: add a message for opening files with no association

Vincent Povirk madewokherd+8cd9 at gmail.com
Wed Feb 25 19:20:28 CST 2009


Fixes bug 17485.

Vincent Povirk
-------------- next part --------------
From 6a17a61b2f591ee968d5287265276656290479e1 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <madewokherd at gmail.com>
Date: Wed, 25 Feb 2009 19:14:30 -0600
Subject: [PATCH] shell32: add a message for opening files with no association

---
 dlls/shell32/shell32_En.rc |    2 ++
 dlls/shell32/shlexec.c     |    6 +++++-
 dlls/shell32/shresdef.h    |    2 ++
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/dlls/shell32/shell32_En.rc b/dlls/shell32/shell32_En.rc
index f752e6d..d7fa7c3 100644
--- a/dlls/shell32/shell32_En.rc
+++ b/dlls/shell32/shell32_En.rc
@@ -282,6 +282,8 @@ STRINGTABLE
 	IDS_CPANEL_TITLE            "Wine Control Panel"
 	IDS_CPANEL_NAME             "Name"
 	IDS_CPANEL_DESCRIPTION      "Description"
+
+        IDS_SHLEXEC_NOASSOC         "There is no Windows program configured to open this type of file."
 }
 
 STRINGTABLE
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 1fbaabb..67815ca 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -45,6 +45,7 @@
 #include "wine/winbase16.h"
 #include "shell32_main.h"
 #include "pidl.h"
+#include "shresdef.h"
 
 #include "wine/debug.h"
 
@@ -1454,7 +1455,10 @@ static void do_error_dialog( UINT_PTR retval, HWND hwnd )
     WCHAR msg[2048];
     int error_code=GetLastError();
 
-    FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code, 0, msg, sizeof(msg)/sizeof(WCHAR), NULL);
+    if (retval == SE_ERR_NOASSOC)
+        LoadStringW(shell32_hInstance, IDS_SHLEXEC_NOASSOC, msg, sizeof(msg)/sizeof(WCHAR));
+    else
+        FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code, 0, msg, sizeof(msg)/sizeof(WCHAR), NULL);
 
     MessageBoxW(hwnd, msg, NULL, MB_ICONERROR);
 }
diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h
index 6353623..01ec977 100644
--- a/dlls/shell32/shresdef.h
+++ b/dlls/shell32/shresdef.h
@@ -106,6 +106,8 @@
 #define IDS_RUNDLG_BROWSE_CAPTION   162
 #define IDS_RUNDLG_BROWSE_FILTER    163
 
+#define IDS_SHLEXEC_NOASSOC         164
+
 #define IDS_LICENSE                 256
 #define IDS_LICENSE_CAPTION         257
 
-- 
1.5.4.3


More information about the wine-patches mailing list