Skip to content

Commit

Permalink
Add MSN message propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrekol committed Jan 27, 2018
1 parent 32c45e0 commit c6837c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions osu!StreamCompanion/Code/Core/Maps/MSN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,20 @@ private IntPtr CustomWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam
OnMSNStringChanged();
}
}

IntPtr ptr = FindWindowEx(IntPtr.Zero, m_hwnd, lpClassName, null);

if (ptr.ToInt32() > 0)
SendMessage(ptr, msg, IntPtr.Zero, lParam);

return DefWindowProcW(hWnd, msg, wParam, lParam);

}

[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern IntPtr SendMessage(IntPtr hwnd, uint wMsg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", EntryPoint = "FindWindowExA")]
private static extern IntPtr FindWindowEx(IntPtr hWnd1, IntPtr hWnd2, string lpsz1, string lpsz2);
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr DefWindowProcW(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true)]
Expand Down

0 comments on commit c6837c4

Please sign in to comment.