changeset 9943:047436ae7143

load icon from executable
author faust3
date Sun, 20 Apr 2003 12:31:23 +0000
parents 2efe706408f3
children 08608b5bb39a
files libvo/vo_directx.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directx.c	Sun Apr 20 11:51:04 2003 +0000
+++ b/libvo/vo_directx.c	Sun Apr 20 12:31:23 2003 +0000
@@ -809,6 +809,8 @@
 static uint32_t preinit(const char *arg)
 {
     HINSTANCE hInstance = GetModuleHandle(NULL);
+	HICON mplayericon=NULL;
+    char exedir[MAX_PATH];
     WNDCLASS   wc;
 	if(arg)
 	{
@@ -835,13 +837,19 @@
        	mp_msg(MSGT_VO, MSGL_V ,"<vo_directx><INFO>using backpuffer\n");
 		nooverlay = 1;
 	}
+    /*load icon from the main app*/
+    if(GetModuleFileName(NULL,exedir,MAX_PATH))
+    {
+         mplayericon = ExtractIcon( hInstance, exedir, 0 );
+  	}
+    if(!mplayericon)mplayericon=LoadIcon(NULL,IDI_APPLICATION);
     wc.style         =  CS_HREDRAW | CS_VREDRAW;
     wc.lpfnWndProc   =  WndProc;
     wc.cbClsExtra    =  0;
     wc.cbWndExtra    =  0;
     wc.hInstance     =  hInstance;
     wc.hCursor       =  LoadCursor(NULL,IDC_ARROW);
-    wc.hIcon         =  LoadIcon(NULL,IDI_APPLICATION);
+    wc.hIcon         =  mplayericon;
     wc.hbrBackground =  CreateSolidBrush(windowcolor);
     wc.lpszClassName =  "Mplayer - Movieplayer for Linux";
     wc.lpszMenuName  =  NULL;