[MPlayer-dev-eng] [PATCH] windows gui about box

Stephen Sheldon sfsheldo at gmail.com
Sun Aug 28 21:42:51 CEST 2011


The windows gui does not have an about box.  The messages are defined, but not
handled.  There is even code to draw the about box.  I wanted to see the
mplayer version, so I changed the string to be displayed from COPYRIGHT to
MP_TITLE, which has a more generic and up-to-date copyright statement.


Index: gui/win32/gui.c
===================================================================
--- gui/win32/gui.c	(revision 34026)
+++ gui/win32/gui.c	(working copy)
@@ -46,6 +46,7 @@
 #include "gui/util/mem.h"
 #include "gui.h"
 #include "dialogs.h"
+#include "version.h"
 
 // HACK around bug in old mingw
 #undef INVALID_FILE_ATTRIBUTES
@@ -128,6 +129,12 @@
             filename[i] = tolower(filename[i]);
     }
 }
+static void display_about_box(HWND hWnd)
+{
+    char about_msg[512];
+    sprintf (about_msg, MP_TITLE, "MPlayer");
+    MessageBox(hWnd, about_msg, "About", MB_OK);
+}
 
 static image *get_drawground(HWND hwnd)
 {
@@ -202,7 +209,7 @@
             display_eqwindow(gui);
             break;
         case evAbout:
-            MessageBox(hWnd, COPYRIGHT, "About", MB_OK);
+	    display_about_box(hWnd);
             break;
         case evIconify:
             ShowWindow(hWnd, SW_MINIMIZE);
@@ -989,6 +996,9 @@
                 case ID_ONLINEHELP:
                     ShellExecute(NULL, "open", ONLINE_HELP_URL, NULL, NULL,
SW_SHOWNORMAL);
                     break;
+		case IDHELP_ABOUT:
+		    handlemsg(hWnd, evAbout);
+		    break;
             }
             if((IDPLAYDISK <= LOWORD(wParam)) && (LOWORD(wParam) < (IDPLAYDISK
+ 100)))
             {
@@ -1158,6 +1168,7 @@
     AppendMenu(gui->menu, MF_STRING, ID_PREFS, "Preferences");
     AppendMenu(gui->menu, MF_STRING, ID_CONSOLE, "Debug Console");
     AppendMenu(gui->menu, MF_STRING, ID_ONLINEHELP, "Online Help");
+    AppendMenu(gui->menu, MF_STRING, IDHELP_ABOUT, "About");
     AppendMenu(gui->menu, MF_SEPARATOR, 0, 0);
     AppendMenu(gui->menu, MF_STRING, IDEXIT, "&Exit");
 }
@@ -1186,6 +1197,7 @@
     AppendMenu(gui->traymenu, MF_STRING, ID_PREFS, "Preferences");
     AppendMenu(gui->traymenu, MF_STRING, ID_CONSOLE, "Debug Console");
     AppendMenu(gui->traymenu, MF_STRING, ID_ONLINEHELP, "Online Help");
+    AppendMenu(gui->traymenu, MF_STRING, IDHELP_ABOUT, "About");
     AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0);
     AppendMenu(gui->traymenu, MF_STRING, IDEXIT, "&Exit");
 }



More information about the MPlayer-dev-eng mailing list