[PATCH] msinfo32: Display an About dialog when the program is run.

Alex Henrie alexhenrie24 at gmail.com
Mon Oct 3 01:14:37 CDT 2016


Cc: Austin English <austinenglish at gmail.com>

Fixes https://bugs.winehq.org/show_bug.cgi?id=41430

An About dialog displays the most important piece of information (the
Wine version), and we were going to have to add one to this program
eventually anyway.

msinfo32 does not take any command line arguments, so I changed
WINE_FIXME to WINE_TRACE.
---
 programs/msinfo32/Makefile.in |  3 +++
 programs/msinfo32/main.c      | 15 ++++++++++++---
 programs/msinfo32/msinfo32.rc | 24 ++++++++++++++++++++++++
 programs/msinfo32/resource.h  | 19 +++++++++++++++++++
 4 files changed, 58 insertions(+), 3 deletions(-)
 create mode 100644 programs/msinfo32/msinfo32.rc
 create mode 100644 programs/msinfo32/resource.h

diff --git a/programs/msinfo32/Makefile.in b/programs/msinfo32/Makefile.in
index e958c27..d752c91 100644
--- a/programs/msinfo32/Makefile.in
+++ b/programs/msinfo32/Makefile.in
@@ -1,5 +1,8 @@
 MODULE    = msinfo32.exe
 APPMODE   = -mwindows -municode
+IMPORTS   = shell32 user32
 
 C_SRCS = \
 	main.c
+
+RC_SRCS = msinfo32.rc
diff --git a/programs/msinfo32/main.c b/programs/msinfo32/main.c
index 77bb927..f63095c 100644
--- a/programs/msinfo32/main.c
+++ b/programs/msinfo32/main.c
@@ -16,18 +16,27 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <shlwapi.h>
+
+#include "resource.h"
+#include "shellapi.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msinfo);
 
 int wmain(int argc, WCHAR *argv[])
 {
+    static const WCHAR wineSystemInfoW[] =
+        {'W','i','n','e',' ','S','y','s','t','e','m',' ','I','n','f','o','r','m','a','t','i','o','n',0};
+    WCHAR systemInfo[64];
     int i;
 
-    WINE_FIXME("stub:");
     for (i = 0; i < argc; i++)
-        WINE_FIXME(" %s", wine_dbgstr_w(argv[i]));
-    WINE_FIXME("\n");
+        WINE_TRACE(" %s", wine_dbgstr_w(argv[i]));
+    WINE_TRACE("\n");
+
+    LoadStringW(GetModuleHandleW(NULL), STRING_SYSTEM_INFO, systemInfo, sizeof(systemInfo)/sizeof(WCHAR));
+    ShellAboutW(NULL, systemInfo, wineSystemInfoW, NULL);
 
     return 0;
 }
diff --git a/programs/msinfo32/msinfo32.rc b/programs/msinfo32/msinfo32.rc
new file mode 100644
index 0000000..ce4ab62
--- /dev/null
+++ b/programs/msinfo32/msinfo32.rc
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2016 Alex Henrie
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "resource.h"
+
+STRINGTABLE
+{
+    STRING_SYSTEM_INFO, "System Information"
+}
diff --git a/programs/msinfo32/resource.h b/programs/msinfo32/resource.h
new file mode 100644
index 0000000..953a00d
--- /dev/null
+++ b/programs/msinfo32/resource.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2016 Alex Henrie
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define STRING_SYSTEM_INFO 0x170
-- 
2.10.0




More information about the wine-patches mailing list