unixstuff.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 4k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. /* Unix specific function prototypes */
  2. #include <mainwin.h>
  3. #include "../shdocvw/unixstuff.h"
  4. #include "shbrows2.h"
  5. #include "shalias.h"
  6. #define MAIL_ACTION_SEND 1
  7. #define MAIL_ACTION_READ 2
  8. #define UNIX_TITLE_SUFFIX TEXT("")
  9. EXTERN_C MwPaintSpecialEOBorder( HWND hWnd, HDC hDC );
  10. BOOL CheckForInvalidOptions( LPCTSTR inCmdLine );
  11. void PrintIEHelp();
  12. void PrintIEVersion();
  13. // IE Thread Info stuff
  14. void UnixStuffInit();
  15. void StoreIEWindowInfo( HWND hwnd );
  16. HWND GetIEWindowOnThread();
  17. // Marshalling stuff
  18. #define CoMarshalInterface CoMarshalInterfaceDummy
  19. STDAPI CoMarshalInterfaceDummy( IStream *, REFIID, IUnknown *, DWORD, void *, DWORD );
  20. struct THREADWINDOWINFO
  21. {
  22.     int cWindowCount;
  23.     CShellBrowser2** rgpsb;
  24. };
  25. EXTERN_C THREADWINDOWINFO * InitializeThreadInfoStructs();
  26. EXTERN_C HRESULT TranslateModelessAccelerator(MSG* msg, HWND hwnd);
  27. EXTERN_C void FreeThreadInfoStructs();
  28. EXTERN_C void AddFirstBrowserToList( CShellBrowser2 *psb );
  29. EXTERN_C void RemoveBrowserFromList( CShellBrowser2 *psb );
  30. EXTERN_C void IEFrameNewWindowSameThread(IETHREADPARAM* piei);
  31. STDAPI_(BOOL) FileHasProperAssociation (LPCTSTR path);
  32. BOOL IsNamedWindow(HWND hwnd, LPCTSTR pszClass);
  33. LRESULT HandleCopyDataUnix(CShellBrowser2* psb, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  34. #define DM_THREADWINDOWINFO          0
  35. inline CShellBrowser2 * CheckAndForwardMessage( 
  36.        THREADWINDOWINFO * lpThreadWindowInfo ,
  37.        CShellBrowser2 * psb, 
  38.        MSG msg
  39.        )
  40. {
  41.     // get psb for msg.hwnd. (Note psb inside scope may != psb outside)
  42.     if (lpThreadWindowInfo->cWindowCount)
  43.     {
  44.         CShellBrowser2* psb, *psbActive = NULL;
  45.         int i;
  46.         BOOL fFoundSB = FALSE, fDelayClosed = FALSE;
  47.         for (i = 0; i < lpThreadWindowInfo->cWindowCount; i++)
  48.         {
  49.             psb = lpThreadWindowInfo->rgpsb[i];
  50.             // Save the active window here so that  we don't have to 
  51.             // loop again.
  52.             if(psb->_fActivated) 
  53.             {
  54.                 psbActive = psb;
  55.             }
  56.             if(psb->_fDelayedClose)
  57.             {
  58.                 fDelayClosed = TRUE;
  59.             }
  60.             if (psb->_pbbd->_hwnd == msg.hwnd || IsChild(psb->_pbbd->_hwnd, msg.hwnd))
  61.             {
  62.                 fFoundSB = TRUE;
  63.                 break;
  64.             }
  65.        }
  66. #ifdef DEBUG
  67.        if (!fFoundSB)
  68.        {
  69.            TraceMsg(DM_THREADWINDOWINFO, "IE_TP ThreadWindowInfo didnt find psb for hwnd = %X, reusing hwnd = %X", msg.hwnd, psb->_pbbd->_hwnd);
  70.        }
  71. #endif //DEBUG                            
  72.        if( fDelayClosed || (i<lpThreadWindowInfo->cWindowCount) )
  73.        {
  74.            // Post WM_CLOSE messages for all the windows which are delayClosed.
  75.            for (i = 0; i < lpThreadWindowInfo->cWindowCount; i++)
  76.            {
  77.                CShellBrowser2* psbDel = lpThreadWindowInfo->rgpsb[i];
  78.                if( psbDel->_fDelayedClose )
  79.                {
  80.                    psbDel->_fDelayedClose = FALSE;
  81.                    PostMessage( psbDel->_pbbd->_hwnd, WM_CLOSE, 0, 0 );
  82.                }
  83.            }
  84.        }
  85.        // Pass message to the current active window, because we fail to find the
  86.        // appropriate parent. This happens in case of favorites window and msgs
  87.        // get diverted to the last window on the array, which may be wrong.
  88.        if( !fFoundSB && psbActive )
  89.        {
  90.            psb = psbActive;
  91.        }
  92.   
  93.        return psb;
  94.     }
  95.     return NULL;
  96. }
  97. #undef KEYBOARDCUES