Jump to content
  • Advertisement
Sign in to follow this  

To make shaking a windows form

This topic is 4745 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would make shaking a window form as Yahoo messanger chat make if the user click on a button. How can i do? Someone speak about DirectX, but where are expleining about? If the user of my application haven't got directx on its computer can i use other ways to do that? I use c# for VS 2003 Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Just for the heck of it, in C/C++ I would do this, I'm sure you can get the
equivalent in C#:


    INT iX, iY;
    INT iIndex;
    RECT rcWindow;

    // Current window position.
    GetWindowRect(&rcWindow);
    for(iIndex = 0; iIndex < 160; iIndex ++)
    {
        iX = rand() % 6;
        iY = rand() % 6;

        // Offset the window position.
        SetWindowPos(NULL, rcWindow.left + iX,
            rcWindow.top + iY, 0, 0, SWP_NOSIZE|SWP_NOZORDER);
    }

    // Restore the current position.
    SetWindowPos(NULL, rcWindow.left, rcWindow.top,
        0, 0, SWP_NOSIZE|SWP_NOZORDER);




It will not have anything to do with DirectX :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!