views:

78

answers:

2
+3  Q: 

Shakin' things up

Hi All

I have a little app here, and I would love to be able to do my own stuff in Vista/Win7 when I shake the form.

Currently, when a form is shaken, it will restore/minimize everything else. But I want to change that behavior in my app only. So when my form is shaken, I could, for example, shuffle the playlist, or Clear the contents of a Canvas etc...

Is this possible?

Thank you

+3  A: 

If you're asking for a code sample that does this, here you go:

http://www.codeproject.com/KB/dialog/aero-shake.aspx

Just replace the part that minimizes and maximizes other windows with whatever else you want to do.

Personally, I think this is pretty cool, and I'm seriously trying to fight the urge to use this everywhere, now. My ideal of the perfect user interface has always been a form with just one button on it. With shaking, I wouldn't even need the button.

MusiGenesis
+1 for being in total agreement: fighting the urge to use it everywhere :)
Robb
Yeah. I love this new shake feature, it's so awesome! With a big imagination, and the know-how, I bet we could come up with a program that lets you shake to perform more than one action, without the use of buttons
lucifer
Go for it. The linked code samples all use a pretty crude algorithm for detecting shaking, which could definitely be improved. Detecting left-to-right shaking vs. up-and-down would be pretty fun to do. It makes total sense to use this for clearing a drawing program, too, as you suggested - just like an Etch-a-Sketch.
MusiGenesis
Yeah! That's what they're called! I was going to mention Etch-A-Sketch in my question but couldn't remember what they're called
lucifer
Thanks, but I think you should definitely leave the check with Robb's answer. I only found my link by googling something I found in his.
MusiGenesis
thanks guys! Appreciate it.
Robb
+2  A: 

Another link with working example:

aero-shake

And yes pretty cool feature.

Robb
I can finally port Shake-The-Baby to Windows! </TASTELESS>
MusiGenesis