DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: fling a window across the screen  (Read 6,013 times)

relipse

  • I love Jesus. Coding in PHP primarily.
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 131
    • Participated in NANY Challenge Seven Times
IDEA: fling a window across the screen
« on: April 13, 2014, 10:54 AM »
You are given these via parameters on execution:
1. sx - Start X point
2. sy - Start Y point
3. fx - Final X point
4. fy - Final Y point
5. d - final displacement (int) of start to finish swipe
6. v - Velocity (double) of how fast the touch or swipe was
7. a - final acceleration of how fast the touch or swipe was accelerating (can be negative)


Coding Snack Job - Accept the above as command line parameters and then
Fling the window across the screen slowing it down due to the friction of the desktop.


This will be in used in conjunction with a touch-pad gesture program which I will release later.
It may pass parameters like so: s100,1032 f1300,123  d103 v1.38882 a-1.313

By the way, use WindowFromPoint() api call from sx,sy to grab the window that needs to be flung
Ex C++Builder coder, current PHP coder, and noob Qt Coder
« Last Edit: April 13, 2014, 11:33 AM by relipse »

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge

relipse

  • I love Jesus. Coding in PHP primarily.
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 131
    • Participated in NANY Challenge Seven Times
Re: IDEA: fling a window across the screen
« Reply #2 on: April 15, 2014, 05:11 AM »
Ok, so I have been experimenting with the script you posted sk.
Here is my modified version that seems good for my purposes:

https://gist.github.com/relipse/10655325

But my question is, how can I modify it to accept parameters in the command line?
Also where can I input the direction and and grab the current window that the mouse is over or something.
Thanks,
Jim
Ex C++Builder coder, current PHP coder, and noob Qt Coder

Original address: https://www.donationcoder.com/forum/index.php?topic=37719.0