Exemplo n.º 1
0
 private IEnumerator CaptureWindowProc()
 {
     while (this.hMainWindow == IntPtr.Zero)
     {
         this.hMainWindow = SoundLibWndProc.FindWindow((string)null, Application.productName);
         if (this.hMainWindow != IntPtr.Zero)
         {
             this.newWndProc    = new WndProcDelegate(this.WndProc);
             this.newWndProcPtr = Marshal.GetFunctionPointerForDelegate(this.newWndProc);
             if (this.Is64Bit())
             {
                 this.oldWndProcPtr = SoundLibWndProc.SetWindowLongPtr(this.hMainWindow, -4, this.newWndProcPtr);
             }
             else
             {
                 this.oldWndProcPtr = SoundLibWndProc.SetWindowLong(this.hMainWindow, -4, this.newWndProcPtr);
             }
         }
         else
         {
             yield return(new WaitForEndOfFrame());
         }
     }
     yield break;
 }
Exemplo n.º 2
0
 private IntPtr WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
 {
     if (msg == 161u && (Int64)wParam.ToInt32() == 2L)
     {
         ISdLibAPIProxy.Instance.SdSoundSystem_Suspend();
         this.isSEADSuspendedByTitleBar = true;
     }
     if (msg == 260u && (Int64)wParam.ToInt32() == 13L)
     {
         msg = 0u;
     }
     return(SoundLibWndProc.CallWindowProc(this.oldWndProcPtr, hWnd, msg, wParam, lParam));
 }
Exemplo n.º 3
0
 private void OnDisable()
 {
     if (this.Is64Bit())
     {
         SoundLibWndProc.SetWindowLongPtr(this.hMainWindow, -4, this.oldWndProcPtr);
     }
     else
     {
         SoundLibWndProc.SetWindowLong(this.hMainWindow, -4, this.oldWndProcPtr);
     }
     this.hMainWindow   = IntPtr.Zero;
     this.oldWndProcPtr = IntPtr.Zero;
     this.newWndProcPtr = IntPtr.Zero;
     this.newWndProc    = (WndProcDelegate)null;
 }
Exemplo n.º 4
0
    private Boolean InitializePlugin()
    {
        if (this.m_isInitialized)
        {
            return(true);
        }
        SoundLib.Log("InitializePlugin()");
        Int32 num = ISdLibAPIProxy.Instance.SdSoundSystem_Create(String.Empty);

        if (num < 0)
        {
            return(false);
        }
        this.m_isInitialized = true;
        GameObject      gameObject      = new GameObject("SoundLibWndProc");
        SoundLibWndProc soundLibWndProc = gameObject.AddComponent <SoundLibWndProc>();

        gameObject.transform.parent = base.transform;
        return(true);
    }
Exemplo n.º 5
0
 public static IntPtr GetWindowHandle()
 {
     return(SoundLibWndProc.GetActiveWindow());
 }