[svn] / branches / release-1_3-branch / xvidcore / dshow / src / CXvidDecoder.cpp Repository:
ViewVC logotype

Diff of /branches/release-1_3-branch/xvidcore/dshow/src/CXvidDecoder.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2006, Thu May 19 12:48:59 2011 UTC revision 2059, Wed Feb 22 19:00:26 2012 UTC
# Line 4  Line 4 
4   *  - Xvid Decoder part of the DShow Filter  -   *  - Xvid Decoder part of the DShow Filter  -
5   *   *
6   *  Copyright(C) 2002-2011 Peter Ross <pross@xvid.org>   *  Copyright(C) 2002-2011 Peter Ross <pross@xvid.org>
7   *               2003-2011 Michael Militzer <michael@xvid.org>   *               2003-2012 Michael Militzer <michael@xvid.org>
8   *   *
9   *  This program is free software ; you can redistribute it and/or modify   *  This program is free software ; you can redistribute it and/or modify
10   *  it under the terms of the GNU General Public License as published by   *  it under the terms of the GNU General Public License as published by
# Line 40  Line 40 
40  #define XVID_USE_MFT  #define XVID_USE_MFT
41  #endif  #endif
42    
 #define XVID_USE_TRAYICON  
   
43  #include <windows.h>  #include <windows.h>
44    
45  #include <streams.h>  #include <streams.h>
# Line 177  Line 175 
175  /* note: g_cTemplates must be global; used by strmbase.lib(dllentry.cpp,dllsetup.cpp) */  /* note: g_cTemplates must be global; used by strmbase.lib(dllentry.cpp,dllsetup.cpp) */
176  int g_cTemplates = sizeof(g_Templates) / sizeof(CFactoryTemplate);  int g_cTemplates = sizeof(g_Templates) / sizeof(CFactoryTemplate);
177    
 #ifdef XVID_USE_TRAYICON  
178  extern HINSTANCE g_xvid_hInst;  extern HINSTANCE g_xvid_hInst;
179    
180  static int GUI_Page = 0;  static int GUI_Page = 0;
# Line 219  Line 216 
216    
217          return TRUE; /* ok */          return TRUE; /* ok */
218  }  }
 #endif  
219    
220  STDAPI DllRegisterServer()  STDAPI DllRegisterServer()
221  {  {
# Line 335  Line 331 
331      LoadRegistryInfo();      LoadRegistryInfo();
332    
333      *phr = OpenLib();      *phr = OpenLib();
334    
335            {
336                    TCHAR lpFilename[MAX_PATH];
337                    int sLen = GetModuleFileName(NULL, lpFilename, MAX_PATH);
338    #ifdef _UNICODE
339                    if ((sLen >= 11) && (_wcsnicmp(&(lpFilename[sLen - 11]), TEXT("dllhost.exe"), 11) == 0)) {
340    #else
341                    if ((sLen >= 11) && (_strnicmp(&(lpFilename[sLen - 11]), TEXT("dllhost.exe"), 11) == 0)) {
342    #endif
343                            if (Tray_Icon == 0) Tray_Icon = -1; // create no tray icon upon thumbnail generation
344                    }
345                    else
346                            if (Tray_Icon == -1) Tray_Icon = 0; // can show tray icon
347            }
348    
349  }  }
350    
351  HRESULT CXvidDecoder::OpenLib()  HRESULT CXvidDecoder::OpenLib()
# Line 496  Line 507 
507  {  {
508      DPRINTF("Destructor");      DPRINTF("Destructor");
509    
510  #ifdef XVID_USE_TRAYICON          if (Tray_Icon > 0) { /* Destroy tray icon */
         if (Tray_Icon) { /* Destroy tray icon */  
511                  NOTIFYICONDATA nid;                  NOTIFYICONDATA nid;
512                  ZeroMemory(&nid,sizeof(NOTIFYICONDATA));                  ZeroMemory(&nid,sizeof(NOTIFYICONDATA));
513    
# Line 508  Line 518 
518                  Shell_NotifyIcon(NIM_DELETE, &nid);                  Shell_NotifyIcon(NIM_DELETE, &nid);
519                  Tray_Icon = 0;                  Tray_Icon = 0;
520          }          }
 #endif  
521    
522          /* Close xvidcore library */          /* Close xvidcore library */
523          CloseLib();          CloseLib();
# Line 935  Line 944 
944  {  {
945          DPRINTF("CompleteConnect");          DPRINTF("CompleteConnect");
946    
947  #ifdef XVID_USE_TRAYICON          if ((direction == PINDIR_OUTPUT) && (Tray_Icon == 0)&& (g_config.bTrayIcon != 0))
         if ((direction == PINDIR_OUTPUT) && (Tray_Icon == 0))  
948          {          {
949                  WNDCLASSEX wc;                  WNDCLASSEX wc;
950    
# Line 974  Line 982 
982                  DestroyIcon(nid.hIcon);                  DestroyIcon(nid.hIcon);
983                  Tray_Icon = 1;                  Tray_Icon = 1;
984          }          }
 #endif  
985    
986          return S_OK;          return S_OK;
987  }  }
# Line 1647  Line 1654 
1654                          hr = OnSetOutputType(pType);                          hr = OnSetOutputType(pType);
1655                  }                  }
1656          }          }
1657  #ifdef XVID_USE_TRAYICON  
1658          if (SUCCEEDED(hr) && Tray_Icon == 0) /* Create message passing window */          if (SUCCEEDED(hr) && (Tray_Icon == 0) && (g_config.bTrayIcon != 0))  /* Create message passing window */
1659          {          {
1660                  WNDCLASSEX wc;                  WNDCLASSEX wc;
1661    
# Line 1686  Line 1693 
1693                  DestroyIcon(nid.hIcon);                  DestroyIcon(nid.hIcon);
1694                  Tray_Icon = 1;                  Tray_Icon = 1;
1695          }          }
 #endif  
1696    
1697          LeaveCriticalSection(&m_mft_lock);          LeaveCriticalSection(&m_mft_lock);
1698          return hr;          return hr;

Legend:
Removed from v.2006  
changed lines
  Added in v.2059

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4