1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-12 14:34:08 +02:00

Only activate parent form in video player if the player window itself is active

This commit is contained in:
chylex 2017-08-28 23:41:46 +02:00
parent eeaf6949c5
commit fdac42947c
2 changed files with 4 additions and 1 deletions

View File

@ -150,7 +150,7 @@ private void timerSync_Tick(object sender, EventArgs e){
else if (!isCursorInside && wasCursorInside){
wasCursorInside = false;
if (!Player.fullScreen){
if (!Player.fullScreen && Handle == NativeMethods.GetForegroundWindow()){
NativeMethods.SetForegroundWindow(ownerHandle);
}
}

View File

@ -15,6 +15,9 @@ static class NativeMethods{
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
[StructLayout(LayoutKind.Sequential)]
public struct RECT{
public int Left;