0

How can I animate two windows at the same time? I tried:

    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    static extern bool AnimateWindow(IntPtr hwnd, int time, int flags);
    ...

    AnimateWindow(panel1.Handle, speed, AW_SLIDE | AW_HOR_Top);
    AnimateWindow(panel2.Handle, speed, AW_SLIDE | AW_HOR_Top);

But panel2 will not animate until panel1 finished its animation.

I must use the threading .. but i can't even if i used invoke .. also it runs the 2nd animation after the 1st

so how can i do it ?

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
MIM
  • 9
  • 3
  • possible duplicate of [AnimateWindow Using in a new thread (C#)](http://stackoverflow.com/questions/11147086/animatewindow-using-in-a-new-thread-c) (the proposed duplicate question is newer, but has received more activity, so voting to close in this direction) – Cody Gray - on strike Jul 20 '12 at 04:10

1 Answers1

-1

If you want to animate 2 windws simultaneously then you will have to use some threading stuff i think. But as you say that you have used it already - i think your threads are not synchronised, you just probably using two threads without synchronising them. declare the method calling animatewindow as synchronised and it must work.

thank you.!!