<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 - Entries tagged with Pranks</title>
    <atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Tags/pranks/RSS"></atom:link>
    <itunes:summary></itunes:summary>
    <itunes:author>Microsoft</itunes:author>
    <itunes:subtitle></itunes:subtitle>
    <image>
      <url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
      <title>Channel 9 - Entries tagged with Pranks</title>
      <link>http://channel9.msdn.com/Tags/pranks</link>
    </image>
    <itunes:image href=""></itunes:image>
    <itunes:category text="Technology"></itunes:category>
    <description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
    <link>http://channel9.msdn.com/Tags/pranks</link>
    <language>en</language>
    <pubDate>Mon, 20 May 2013 05:56:42 GMT</pubDate>
    <lastBuildDate>Mon, 20 May 2013 05:56:42 GMT</lastBuildDate>
    <generator>Rev9</generator>
    <c9:totalResults>4</c9:totalResults>
    <c9:pageCount>1</c9:pageCount>
    <c9:pageSize>25</c9:pageSize>
  <item>
      <title>Halloween Gremlins</title>
      <description><![CDATA[
<p>This article describes a quick and easy application to play Halloween tricks on the PC.</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9915768/clip_image001_2.jpg"><img title="clip_image001" border="0" alt="clip_image001" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9915768/clip_image001_thumb.jpg" width="282" height="135"></a></p>
<h3>Introduction</h3>
<p>This article describes “Gremlin”, a quick and easy application that lets you play Halloween tricks. When your victim's computer is idle, Gremlin moves windows around on the screen, changes the focus window, moves your mouse, scrolls windows, and types nonsensical
 stuff. When there is background noise – like someone talking – it will shake the screen, even as your victim is typing away.</p>
<h3>Deployment</h3>
<p><b>Run it right away</b>. You can download, copy theGremlin.exe executable and NAudio.dll to the victim's computer (say in c:\ directory), and then double click on the executable to run it.</p>
<p><b>Run it later.</b> The other option is to copy the executable and dll files (or a shortcut to it) to the Startup folder on the victim's machine and watch the fun begin when they start up their machine in the morning!</p>
<p>If the computer you're using runs on Windows XP the path is: </p>
<blockquote>
<p>C:\Documents and Settings\All Users\Start Menu\Programs\Startup</p>
</blockquote>
<p>With Vista and Windows 7 the path looks like: </p>
<blockquote>
<p>C:\Users\<i>USERNAME</i>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup</p>
</blockquote>
<p>Just remember to change <i>USERNAME</i> to the name of the user on your machine.</p>
<p></p>
<h4>Commandline</h4>
<p>Gremlin is compiled as a windows application, so it won't popup a terminal window if you double click on it, etc. But you can run it from the command line with flags:</p>
<blockquote>
<p><b>-aggressive</b> will make the gremlin's actions more obvious</p>
<p><b>-help</b> will display the command line options</p>
<p><b>-name</b> <i>NAME</i> is useful for testing. Gremlin will only use windows with this specific title or from this specific application. (Remember to drop the &quot;.exe&quot; from the application filename)</p>
</blockquote>
<p>To stop the program, press CTRL&#43;F2.</p>
<h3>And now … the dodgy bits</h3>
<p>The overall structure of the program is broken down into three kinds of functionality – actions, triggers and some interstitial glue:</p>
<p>Actions</p>
<ul>
<li>The screen-shaker is a window that makes the monitor look like it is shaking. Sort of like a loose cable on the back of the monitor.
</li><li>A random event might kick the windows around—either friction will slow them down, or...
</li><li>Gremlin will type nonsensical messages from the keyboard. These messages are then sent from a virtual keyboard, or they:
</li><li>Move the mouse around, or </li><li>Press the mouse buttons, or </li><li>Randomly switch the focus to another window </li></ul>
<p>Triggers</p>
<ul>
<li>An audio module listens for sounds that trigger the module that shakes your screen.
</li><li>Otherwise, the software uses a p/invoke to <strong>GetLastInputInfo()</strong> and waits for the user to be idle for a minute or two. When it detects that the user is inactive, it randomly selects and carries out actions.
</li></ul>
<p>Other</p>
<ul>
<li>A hidden window receives key press events. I tend to reuse this module a lot, as a way to
<i>stop</i> experimental programs that may have made my machine unusable. </li></ul>
<p>For fun, I'll describe a couple of these modules below.</p>
<p></p>
<h4>Screen shaker</h4>
<p>My favorite bit is the screen shaker. It grabs a picture of the screens, creates a window that spreads across them, and then moves that image back and forth a few pixels every 30ms or so, with a little bit of random rotation. (Faster computers, of course,
 get a better effect).</p>
<p>The screen shaker is special in four ways:</p>
<ul>
<li>It is a top-level window – no other windows are allowed to go over it. </li><li>This top-level window never becomes the focus window (the window that gets the keyboard events).
</li><li>Mouse button events (e.g. clicks and double-clicks) are passed through to the windows and desktop underneath. This gives the illusion that this is the &quot;real&quot; desktop shaking, by allowing a person to click on a button or text that passes the click thru to
 the <i>real</i> button or text. </li><li>It shakes each of the monitor's screens independently </li></ul>
<p>Some background: to create a window that looks like the shaking screen, I used two classes. The first is ScrShake (in ScreenShake.cs), which derives from the second class UnfocusableForm.&nbsp; I'll describe ScrShake first.</p>
<p>The screen shaking process requires five instance variables:</p>
<ul>
<li><i>animTimer</i> is a System.Windows.Forms.Timer used to force painting of a new frame on the screen.
</li><li><i>bx</i>, and <i>by </i>are how far the screen has shaken up or down, left or right.
</li><li><i>angle </i>is how much the screen has twisted during shaking. </li><li><i>screenBitmap</i> is an array of bitmaps, one for each of the monitors. </li></ul>
<p>This creates a window without a border or other trappings, then makes it the topmost window and sets a flag in the method variable ExStyle to ignore mouse clicks. More on this flag in a little while.</p>
<p></p>
<p><b>C# <br>
</b></p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> ScrShake : UnfocusableForm
{
   <span class="kwrd">public</span> ScrShake(<span class="kwrd">double</span> ShakeCoef, <span class="kwrd">double</span> AngleCoef) : <span class="kwrd">base</span>(<span class="kwrd">true</span>)
   {
      <span class="kwrd">this</span>.SuspendLayout();
      … other setup code …
      <span class="rem">// This is needed since we're over the whole display, and we don't</span>
      <span class="rem">// want the other areas to be blurry</span>
      TransparencyKey =  BackColor = ForeColor = System.Drawing.Color.Fuchsia;
      DoubleBuffered = <span class="kwrd">true</span>;
      TopMost = <span class="kwrd">true</span>;
      FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

      ClientSize = <span class="kwrd">new</span> System.Drawing.Size(300, 300);
      Name = <span class="str">&quot;topimage&quot;</span>;
      ResumeLayout(<span class="kwrd">false</span>);

      <span class="rem">// This is need to pass mouse clicks thru to lower layers</span>
      ExStyle |= (<span class="kwrd">int</span>) WS . EX_TRANSPARENT;

      … More code that will be described later…
   }
}</pre>
<style type="text/css">
<!--
.csharpcode, .csharpcode 
	{font-size:small;
	color:black;
	font-family:consolas,"Courier New",courier,monospace;
	background-color:#ffffff}
.csharpcode 
	{margin:0em}
.csharpcode .rem
	{color:#008000}
.csharpcode .kwrd
	{color:#0000ff}
.csharpcode .str
	{color:#006080}
.csharpcode .op
	{color:#0000c0}
.csharpcode .preproc
	{color:#cc6633}
.csharpcode .asp
	{background-color:#ffff00}
.csharpcode .html
	{color:#800000}
.csharpcode .attr
	{color:#ff0000}
.csharpcode .alt
	{background-color:#f4f4f4;
	width:100%;
	margin:0em}
.csharpcode .lnum
	{color:#606060}
-->
</style>
<p><b><br>
</b></p>
<p>When the timer has done a given number of animations, it will call the Stop() method. This will stop the animation, clean it up, and hide the window:</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">void</span> Stop()
{
   animTimer . Stop();
   Hide();
   screenBitmap = <span class="kwrd">null</span>;
}</pre>
<p>When the main loops that start the animated screen shaking process, it calls the Screens() method. This grabs an image of the screens, determines the shape of each monitor, and starts the animation for 10 frames.</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">internal</span> <span class="kwrd">void</span> Screens()
{
   <span class="kwrd">if</span> (Visible)
   {
      Stop();
      <span class="kwrd">return</span> ;
   }
   <span class="rem">// Grab the screens</span>
   screenBitmap = Program.GrabScreens();
   CountDown = 10;

   animTimer.Start();
   angle = 0.0f;
   … code to display the window and get shape of monitors (see below)…
}</pre>
<p><b><br>
</b></p>
<p>The screen capture portion is in ScreenCapture.cs. The method GrabScreens() creates an individual bitmap for each monitor and returns them as an array.</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">internal</span> <span class="kwrd">void</span> Screens()
{
   <span class="kwrd">if</span> (Visible)
   {
      Stop();
      <span class="kwrd">return</span> ;
   }
   <span class="rem">// Grab the screens</span>
   screenBitmap = Program.GrabScreens();
   CountDown = 10;

   animTimer.Start();
   angle = 0.0f;
   … code to display the window and get shape of monitors (see below)…
}</pre>
<p><b><br>
</b></p>
<p>The code below determines the bounds of each screen and builds up a size of all of the screens put together. The window will be set to be this size.
</p>
<p><b>C# </b></p>
<pre class="csharpcode">Screen[] AllScreens = Screen.AllScreens;

<span class="rem">// full width/height of all monitors combined</span>
Rectangle fullSize = AllScreens[0].Bounds;

<span class="rem">// find a rectangle that will encompass all monitors on the system</span>
<span class="rem">// (assuming the primary monitor is on the left/top!)</span>
<span class="kwrd">for</span> (<span class="kwrd">int</span> i = 1; i &lt; AllScreens.Length &amp;&amp; i &lt; screenBitmap.Length; i&#43;&#43;)
{
    Rectangle Bounds = AllScreens[i].Bounds;

    <span class="kwrd">if</span> (Bounds.Left &lt; fullSize.Left)
        fullSize.X = Bounds.X;

    <span class="kwrd">if</span> (Bounds.Right &gt; fullSize.Right)
        fullSize.Width = Bounds.Right - fullSize.X;

    <span class="kwrd">if</span> (Bounds.Top &lt; fullSize.Top)
        fullSize.Y = Bounds.Y;

    <span class="kwrd">if</span> (Bounds.Bottom &gt; fullSize.Bottom)
        fullSize.Height = Bounds.Bottom - fullSize.Y;
}</pre>
<p>The code to show the window, fill the whole screen, and move it to the top looks like:</p>
<p><b>C# </b></p>
<pre class="csharpcode">Show();
WindowState = FormWindowState.Normal;
<span class="rem">// cover all monitors with one gigantic window</span>
Location = <span class="kwrd">new</span> Point(fullSize.Left, fullSize.Top);
Size = <span class="kwrd">new</span> Size(fullSize.Width, fullSize.Height);

<span class="rem">// bring it to the top</span>
BringToFront();</pre>
<p>The constructor also created a timer that drives the screen shaking effect. The timer has a delegate that randomly selects the angle of rotation and the offset of the image, and triggers a repaint of the window. (The amount of shaking is controlled by two
 external variables called <i>AngleCoef</i> and <i>ShakeCoef</i>).</p>
<p><b>C# </b></p>
<pre class="csharpcode">animTimer = <span class="kwrd">new</span> System.Windows.Forms.Timer();
animTimer.Tick &#43;= <span class="kwrd">delegate</span>(<span class="kwrd">object</span> A, EventArgs E)
{
    <span class="kwrd">if</span> (--CountDown &lt; 1)
        Stop();

    angle &#43;= (<span class="kwrd">float</span>)((Program.Rnd.NextDouble() - 0.5) * AngleCoef);
    bx = (<span class="kwrd">float</span>)((Program.Rnd.NextDouble() - 0.5) * ShakeCoef);
    by = (<span class="kwrd">float</span>)((Program.Rnd.NextDouble() - 0.5) * ShakeCoef);
    Invalidate();
};

<span class="rem">// Sets the timer interval to 30 milliseconds.</span>
animTimer.Interval = 30;</pre>
<p>Although each monitor shifts up &amp; down, left &amp; right by the same amount, and rotates by the same angle, they are painted independently. This gives the illusion that each monitor has a shaky image. Paint the window is using the following code.
</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> OnPaint(PaintEventArgs e)
{
    <span class="kwrd">base</span>.OnPaint(e);
    Graphics g = e.Graphics;
    g.CompositingQuality = CompositingQuality.HighQuality;

    <span class="rem">// for each monitor, draw the effect</span>
    Screen[] AllScreens = Screen.AllScreens;
    <span class="kwrd">for</span>(<span class="kwrd">int</span> i = 0; i &lt; screenBitmap.Length; i&#43;&#43;)
    {
        <span class="kwrd">if</span> (<span class="kwrd">null</span> == screenBitmap[i])&nbsp;&nbsp; <span class="kwrd">continue</span>;
        g.SmoothingMode = SmoothingMode.HighQuality;

        <span class="rem">// grab the size of the current monitor</span>
        Rectangle region = AllScreens[i].Bounds;

        <span class="kwrd">double</span> ImWidth = screenBitmap[i].Width  * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Graphics.DpiX / screenBitmap[i].HorizontalResolution;
        <span class="kwrd">double</span> ImHeight= screenBitmap[i].Height * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Graphics.DpiY / screenBitmap[i].VerticalResolution;
        Matrix m = <span class="kwrd">new</span> Matrix();
        m.Translate( (<span class="kwrd">float</span>)(- ImWidth  /2), 
                  (<span class="kwrd">float</span>)(- ImHeight /2), MatrixOrder.Append);

        <span class="rem">// rotate the bitmap about the center</span>
        m.RotateAt(angle, <span class="kwrd">new</span> Point(0,0), MatrixOrder.Append);

        <span class="rem">// center the image no matter what its size is</span>
        m.Translate( region.Width /2 - bx, 
                  region.Height/2 - by, MatrixOrder.Append);

        <span class="rem">// assign our transformation matrix</span>
        g.Transform = m;

        <span class="rem">// draw it</span>
        g.DrawImage(screenBitmap[i], region.Left, region.Top);
    }</pre>
<h4>The Form that does nothing!</h4>
<p>The ScrShaker class uses a help class called UnfocusableForm (in UnfocusableForm.cs) to create a window that never becomes the focus window – it never receives key presses, etc.</p>
<p>This window has no trappings – no border, no resize gripper, no icon, no minimize / maximize buttons, no title bar.</p>
<p></p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> UnfocusableForm : Form
{
   <span class="kwrd">public</span> UnfocusableForm(<span class="kwrd">bool</span> X) : <span class="kwrd">base</span>()
   {
      <span class="kwrd">if</span> (X)
        {
           ControlBox = <span class="kwrd">false</span>;
           FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
           ShowInTaskbar = <span class="kwrd">false</span>;
           ShowIcon = <span class="kwrd">false</span>;
           MinimizeBox = <span class="kwrd">false</span>;
           SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
           StartPosition = System.Windows.Forms.FormStartPosition.Manual;
        }
   }</pre>
<p>Then it overrides the ShowWithoutActivation method so that the window will <i>
not</i> become the active when it is shown.</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">bool</span> ShowWithoutActivation
{ get {  <span class="kwrd">return</span> <span class="kwrd">true</span>; } }</pre>
<p>The UnfocusableForm class also overrides the CreateParams() method to set extra styles when creating the window. I haven't found a way to set these styles flexibly. Instead, the UnfocusableForm uses a method variable called ExStyle that allows derived classes
 to specify what flags they desire. In this case, The ScrShake class used the method variable to set a flag that ignore mouse clicks:</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">override</span> CreateParams CreateParams
{
  get
  {
     CreateParams cp=<span class="kwrd">base</span>.CreateParams;
     cp . ExStyle |= ExStyle;
     <span class="kwrd">return</span> cp;
  }
}</pre>
<p><b><br>
</b>Finally, it captures a couple of events that ask a window if it would like to become the active window. (These usually happen when the user clicks on an inactive window):</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">internal</span> <span class="kwrd">const</span> <span class="kwrd">int</span> MA_NOACTIVATE = 0x0003;
<span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> WndProc(<span class="kwrd">ref</span> Message m)
{
  <span class="kwrd">if</span> (m.Msg == (<span class="kwrd">int</span>) WM.MOUSEACTIVATE)
  {
     m.Result = (IntPtr) MA_NOACTIVATE;
     <span class="kwrd">return</span>;
  }
  <span class="kwrd">if</span> (m.Msg == (<span class="kwrd">int</span>) WM.FOCUS)
  {
     m.Result = (IntPtr)1;
     <span class="kwrd">return</span>;
  }
  <span class="kwrd">base</span>.WndProc(<span class="kwrd">ref</span> m);
}</pre>
<h4>Sending Mouse Events</h4>
<p>Sending Mouse Events is simple, but not trivial. The wiki at Pinvoke.net provides the signature to the procedures and structures we need to pass to it. (Note: these structures are a bit different, based on
<a href="http://blogs.msdn.com/oldnewthing/archive/2009/08/13/9867383.aspx">a blog posting by Raymond Chen</a>)</p>
<p><b>C# </b></p>
<pre class="csharpcode">[DllImport(<span class="str">&quot;user32.dll&quot;</span>, EntryPoint = <span class="str">&quot;SendInput&quot;</span>, SetLastError = <span class="kwrd">true</span>)]
<span class="kwrd">static</span> <span class="kwrd">extern</span> <span class="kwrd">uint</span> SendInput(<span class="kwrd">uint</span> nInputs, INPUT[] Inputs, <span class="kwrd">int</span> cbSize);
[DllImport(<span class="str">&quot;user32.dll&quot;</span>, EntryPoint = <span class="str">&quot;GetMessageExtraInfo&quot;</span>, SetLastError = <span class="kwrd">true</span>)]
<span class="kwrd">static</span> <span class="kwrd">extern</span> IntPtr GetMessageExtraInfo();

[StructLayout(LayoutKind.Sequential)]
<span class="kwrd">struct</span> INPUT
{
   <span class="kwrd">internal</span> INPUTTYPE   type;
   <span class="kwrd">internal</span> INPUT_UNION i;
}

 <span class="rem">// This generates the anonymous union</span>
[StructLayout(LayoutKind.Explicit)]
<span class="kwrd">struct</span> INPUT_UNION
{
   [FieldOffset(0)]
   <span class="kwrd">public</span> MOUSEINPUT mi;
   [FieldOffset(0)]
   <span class="kwrd">public</span> KEYBDINPUT ki;
   [FieldOffset(0)]
   <span class="kwrd">public</span> HARDWAREINPUT hi;
};

[StructLayout(LayoutKind.Sequential)]
<span class="kwrd">struct</span> MOUSEINPUT
{
   <span class="kwrd">public</span> <span class="kwrd">int</span>    dx;
   <span class="kwrd">public</span> <span class="kwrd">int</span>    dy;
   <span class="kwrd">public</span> <span class="kwrd">int</span>    mouseData;
   <span class="kwrd">public</span> MOUSEEVENTF dwFlags;
   <span class="kwrd">public</span> <span class="kwrd">int</span>    time;
   <span class="kwrd">public</span> IntPtr dwExtraInfo;
}

[Flags]
<span class="kwrd">enum</span> MOUSEEVENTF : <span class="kwrd">int</span>
{
   MOVE       = 0x01,
   LEFTDOWN   = 0x02,
   LEFTUP     = 0x04,
   RIGHTDOWN  = 0x08,
   RIGHTUP    = 0x10,
   MIDDLEDOWN = 0x20,
   MIDDLEUP   = 0x40,
   ABSOLUTE   = 0x8000
}</pre>
<p><b><br>
</b></p>
<p>Each of these pieces go together in a specific way. To do a mouse movement, a mouse event structure needs to be created. This involves setting dwFlags to the kind of mouse event (a relative movement in this case), dx and dy to the number of pixels moved.
 It is also important to set dwExtraInfo to whatever GetMessageExtraInfo() is set to.</p>
<p><b>C# </b></p>
<pre class="csharpcode">MOUSEINPUT MEvent = <span class="kwrd">new</span> MOUSEINPUT();
MEvent.dwFlags = MOUSEEVENTF.MOVE;
MEvent.dx = Rnd . Next(-8, 8) ;
MEvent.dy = Rnd . Next(-8, 8);
MEvent.dwExtraInfo = GetMessageExtraInfo();
Send(MEvent);</pre>
<p>Sending the event takes a few more steps that are all wrapped in a helper methdo called Send(). Send these
<i>human interface device</i> events via the SendInput() procedure (earlier). The procedure takes an array of events, for different kinds of devices. We have to create the array, set the event type, copy the event data, and then make the call:</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">virtual</span> <span class="kwrd">bool</span> Send(MOUSEINPUT Event)
{
  INPUT[] Events = <span class="kwrd">new</span> INPUT[1];
  Events[0] . type = INPUTTYPE . MOUSE;
  Events[0] . i.mi = MEvent;
  <span class="kwrd">return</span> SendInput((<span class="kwrd">uint</span>)Events.Length, Events, Marshal.SizeOf(Events[0])) &gt; 0; 
}</pre>
<p><b><br>
</b></p>
<p>From here, sending a mouse button click is pretty straight forward. A mouse click is really a mouse button press event, followed by a mouse button release event. To make things interesting the mouse button is choosen at random. The “ugly” part is that each
 of the mouse buttons is assigned a bit, so a binary shift is used to convert a button number to its bit. And the button release is yet another bit, so the second message shifts the flags, to move the bit from the “button pressed” state to the “button released
 state”.</p>
<p><b>C# </b></p>
<pre class="csharpcode">MOUSEINPUT MEvent = <span class="kwrd">new</span> MOUSEINPUT();
MEvent.dwFlags = (MOUSEEVENTF) (1 &lt;&lt; (2*Rnd.Next(0, 3)&#43;1)) ;
MEvent.dwExtraInfo = GetMessageExtraInfo ();
Send(MEvent);

MEvent.dwFlags = (MOUSEEVENTF)((<span class="kwrd">int</span>) MEvent.dwFlags &lt;&lt; 1);
MEvent.dwExtraInfo = GetMessageExtraInfo ();
Send(MEvent);</pre>
<p><b><br>
</b></p>
<h4>Generating deranged text</h4>
<p>The gremlin can also type deranged sentences that will appear in editors, if the user left one open. The SendWait() method in the SendKeys class does the typing itself:</p>
<p><b>C#</b>&nbsp;</p>
<pre class="csharpcode">SendKeys . SendWait(GenerateSentence());
SendKeys . SendWait(<span class="str">&quot;{ENTER}&quot;</span>);</pre>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9915768/clip_image001_5B6_5D.jpg"><img title="clip_image001[6]" border="0" alt="clip_image001[6]" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9915768/clip_image001_5B6_5D_thumb.jpg" width="282" height="135"></a></p>
<p>Generating the sentences is not difficult; I used a simplistic Markov generator. This generator starts by randomly selecting a word that can start a sentence. The
<i>Starts</i> variable is array which holds just these words. Then, in the Transition method, this word is used to find the
<i>next</i> word that can be included in the sentence. It does this by using a dictionary, called
<i>NonStart</i>, which given the word as a key, will return a list of all the words that can come after it. This process then repeats, appending the words onto the end of a string. It stops if it finds a word that can end a sentence.</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">static</span> Dictionary&lt;<span class="kwrd">string</span>,<span class="kwrd">string</span>[]&gt; NonStart ;
<span class="kwrd">static</span> <span class="kwrd">string</span>[] Starts;
<span class="kwrd">static</span> Dictionary&lt;<span class="kwrd">string</span>,<span class="kwrd">string</span>&gt; Terminal ;

<span class="kwrd">static</span> <span class="kwrd">string</span> GenerateSentence()
{
  StringBuilder SB = <span class="kwrd">new</span> StringBuilder();
  <span class="kwrd">string</span> Word = Starts[ Rnd.Next(0, Starts.Length) ];

  Transition(SB, Word);
  <span class="kwrd">return</span> SB.ToString();
}

<span class="kwrd">static</span> <span class="kwrd">void</span> Transition(StringBuilder SB, <span class="kwrd">string</span> Word)
{
  <span class="kwrd">while</span> (<span class="kwrd">true</span>)
  {
     SB.Append(Word);
     SB.Append(<span class="str">' '</span>);

     <span class="rem">// Look up word after this</span>
     <span class="kwrd">string</span>[] Nexts;
     <span class="kwrd">if</span> (!NonStart.TryGetValue(Word, <span class="kwrd">out</span> Nexts))
       <span class="kwrd">break</span>;
     <span class="kwrd">int</span> Idx = Rnd.Next(Terminal . ContainsKey(Word) ? -1 :0, Nexts.Length);
     <span class="kwrd">if</span> (Idx &lt; 0)
       <span class="kwrd">break</span>;
     Word = Nexts[Idx];
  }
}</pre>
<p><b><br>
</b></p>
<p>Building these two dictionaries and array is a pretty simple process. The BuildSuffixTree() method takes a string and splits it up into sentences. Then it splits each sentence into (lower case) words. The first word of the sentence goes onto the end of the
<i>Starts</i> array. Otherwise, the previous word is used to look up a list in a dictionary, and the current word is appended on to the list. This dictionary will become the
<i>NonStarts</i> dictionary. The last word of the sentence is also placed into the
<i>Terminal</i> dictionary, to indicate that this might be the end of a sentence.</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">static</span> <span class="kwrd">void</span> BuildSuffixTree()
{
  <span class="rem">// First, build up a list of words that start sentence, and transitions</span>
  List&lt;<span class="kwrd">string</span>&gt; Starts1 = <span class="kwrd">new</span> List&lt;<span class="kwrd">string</span>&gt;();
  Dictionary&lt;<span class="kwrd">string</span>,List&lt;<span class="kwrd">string</span>&gt;&gt; Trans = <span class="kwrd">new</span> Dictionary&lt;<span class="kwrd">string</span>,List&lt;<span class="kwrd">string</span>&gt;&gt;();
  <span class="kwrd">foreach</span>(<span class="kwrd">string</span> S1 <span class="kwrd">in</span> S.Split(<span class="kwrd">new</span> <span class="kwrd">char</span>[]{<span class="str">'.'</span>,<span class="str">'?'</span>,<span class="str">'!'</span>}))
  {
     <span class="kwrd">string</span> Prev=<span class="kwrd">null</span>;
     <span class="kwrd">foreach</span>(<span class="kwrd">string</span> S2 <span class="kwrd">in</span> S1.Split(<span class="kwrd">new</span> <span class="kwrd">char</span>[]{<span class="str">' '</span>,<span class="str">'\n'</span>,<span class="str">'\r'</span>,<span class="str">'\t'</span>,<span class="str">','</span>,<span class="str">';'</span>}))
     {
        <span class="kwrd">if</span> (S2 . Length &lt; 1)
          <span class="kwrd">continue</span>;
        <span class="kwrd">if</span> (<span class="kwrd">null</span> == Prev)
          {
             Starts1.Add(<span class="kwrd">string</span>.Intern(S2.ToLower()));
             Prev = <span class="kwrd">string</span>.Intern(S2.ToLower());
             <span class="kwrd">continue</span>;
          }
        List&lt;<span class="kwrd">string</span>&gt; Nextsa;
        <span class="kwrd">if</span> (! Trans.TryGetValue(Prev, <span class="kwrd">out</span> Nextsa))
          Trans[Prev] = Nextsa = <span class="kwrd">new</span> List&lt;<span class="kwrd">string</span>&gt;();
        Prev = <span class="kwrd">string</span>.Intern(S2.ToLower());
        Nextsa.Add(Prev);
     }
     <span class="kwrd">if</span> (<span class="kwrd">null</span> != Prev)
       Terminal[Prev] = Prev;
 }

 <span class="rem">// Next, flatten the list of words that start a sentence</span>
 Starts = Starts1.ToArray();

 <span class="rem">// Flatten the transition table</span>
 <span class="kwrd">foreach</span> (<span class="kwrd">string</span> S3 <span class="kwrd">in</span> Trans.Keys)
  NonStart[S3] = Trans [S3].ToArray();
}</pre>
<p><b><br>
</b></p>
<h3>The things that trigger action</h3>
<h4>The audio trigger</h4>
<p>The audio module (in file AudioTrigger.cs) listens in on all of the microphones. It uses NAudio, with a basic setup and delegate structure swiped from Mark Heath's article “.NET Audio Recording”. The first difference is that it registers
<i>all</i> audio input devices:</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">static</span> WaveIn[] StartMics()
{
  <span class="kwrd">int</span> NumDevices = WaveIn.DeviceCount;
  WaveIn[] AudIns = <span class="kwrd">new</span> WaveIn[NumDevices];
  <span class="kwrd">for</span> (<span class="kwrd">int</span> waveInDevice = 0; waveInDevice &lt; NumDevices ; waveInDevice&#43;&#43;)
  {
     AudIns[waveInDevice] = <span class="kwrd">new</span> WaveIn();
     AudIns[waveInDevice].DeviceNumber = waveInDevice;
     AudIns[waveInDevice].DataAvailable &#43;= waveIn_DataAvailable;
     AudIns[waveInDevice].WaveFormat = <span class="kwrd">new</span> WaveFormat(8000, 1);
     AudIns[waveInDevice].StartRecording();
  }
  <span class="kwrd">return</span> AudIns;
}</pre>
<p>The real magic in the trigger is a modified version of the waveIn_DataAvailable delegate. Instead of saving the audio, it checks for any sound activity. It starts by checking to see if any of the sound amplitudes are greater than a pre-defined, very high
 threshold. Then the samples are squared and summed up, and the result is compared with a threshold. If it exceeds the threshold, the trigger is set. These two are good at catching the kind of sound made when a person is talking, futzing on the desk, or typing.</p>
<p><a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9915768/clip_image002_2.jpg"><img title="clip_image002" border="0" alt="clip_image002" src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/9915768/clip_image002_thumb.jpg" width="372" height="210"></a></p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">static</span> <span class="kwrd">double</span> AudioThresh  = 0.8;
<span class="kwrd">static</span> <span class="kwrd">double</span> AudioThresh2 = 0.09;

<span class="kwrd">static</span> <span class="kwrd">void</span> waveIn_DataAvailable(<span class="kwrd">object</span> sender, WaveInEventArgs e)
{
  <span class="kwrd">bool</span> Tr = <span class="kwrd">false</span>;
  <span class="kwrd">double</span> Sum2  = 0;
  <span class="kwrd">int</span> Count = e.BytesRecorded / 2;
  <span class="kwrd">for</span> (<span class="kwrd">int</span> index = 0; index &lt; e.BytesRecorded; index &#43;= 2)
  {
     <span class="kwrd">double</span> Tmp = (<span class="kwrd">short</span>)((e.Buffer[index &#43; 1] &lt;&lt; 8) | e.Buffer[index &#43; 0]);
     Tmp /= 32768.0;
     Sum2 &#43;= Tmp*Tmp;
     <span class="kwrd">if</span> (Tmp &gt; AudioThresh)
       Tr = <span class="kwrd">true</span>;
  }
  Sum2 /= Count;

  <span class="rem">// If the Mean-Square is greater than a threshold, set a flag to indicate that noise has happened</span>
  <span class="kwrd">if</span> (Tr || Sum2 &gt; AudioThresh2)
    Interlocked.Exchange(<span class="kwrd">ref</span> AudioTrigger, 1);
}</pre>
<p><b><br>
</b></p>
<p>This sets a flag – AudioTrigger – which will be seen (and reset) in the main loop, with a bit of code that looks like:</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">while</span> (0 == Shutdown)
{
    <span class="rem">// Do some lovely events</span>
    Application . DoEvents();
    Thread . Sleep (20);

    <span class="rem">//… do some other stuff ..</span>

    <span class="rem">// Check for a kick from the sound system</span>
    <span class="kwrd">if</span> (0 != AudioTrigger)
    {
        Interlocked . Exchange(<span class="kwrd">ref</span> AudioTrigger, 0);
        …
        ScreenShaker . Screens();
        <span class="kwrd">continue</span>;
    }
    <span class="rem">//… more checks for the user idle trigger…</span>
}<b><br></b></pre>
<h4>Waiting for the user to be idle</h4>
<p>The check to see if the user is not doing anything, the main loop uses a helper method called LastInputTime(), which returns the number of milliseconds the user did any input activity. The loop ensures that the user has been idle for long enough, and then
 calls the method that selects random gremlin actions:</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">uint</span> LastTime = Win32.LastInputTime();
<span class="kwrd">if</span> ((<span class="kwrd">uint</span>) Environment.TickCount &lt; IdleTimeTrigger &#43; LastTime)
    <span class="kwrd">continue</span>;</pre>
<p>The LastInputTime() helper method uses a p/invoke call to the GetLastInputInfo() API call. The wiki at Pinvoke.net provides the signature to the procedure, and a suitable structure that we need to pass to it:</p>
<p><b>C# </b></p>
<pre class="csharpcode">[DllImport(<span class="str">&quot;User32.dll&quot;</span>)]
<span class="kwrd">static</span> <span class="kwrd">extern</span> <span class="kwrd">bool</span> GetLastInputInfo(<span class="kwrd">ref</span> LASTINPUTINFO LastInfo);

[StructLayout(LayoutKind.Sequential)]
<span class="kwrd">struct</span> LASTINPUTINFO
{
  <span class="kwrd">public</span> <span class="kwrd">uint</span> cbSize;

  <span class="rem">/// &lt;summary&gt;</span>
  <span class="rem">/// Number of system tickes</span>
  <span class="rem">/// &lt;/summary&gt;</span>
  <span class="kwrd">public</span> <span class="kwrd">uint</span> dwTime;
}</pre>
<p>Then, these two structures are wrapped up into the LastInputTime() helper procedure, which does the dirty work of allocating and initializing a structure.
</p>
<p><b>C# </b></p>
<pre class="csharpcode"><span class="kwrd">internal</span> <span class="kwrd">static</span> <span class="kwrd">uint</span> LastInputTime()
{
  LASTINPUTINFO lastInput=<span class="kwrd">new</span> LASTINPUTINFO();
  lastInput.cbSize = (<span class="kwrd">uint</span>)Marshal.SizeOf(lastInput);
  GetLastInputInfo(<span class="kwrd">ref</span> lastInput);
  <span class="kwrd">return</span> lastInput . dwTime;
}<b><br></b></pre>
<h3>Conclusion</h3>
<p>The tricks gremlin plays are intended to be somewhat subtle. There is an aggressive option to make it react more, and move windows around more visibly.
</p>
<p>If you want to try this out, the download link for the <a href="http://gremlin.codeplex.com/Release/ProjectReleases.aspx">
executable</a> and <a href="http://gremlin.codeplex.com/SourceControl/ListDownloadableCommits.aspx">
source code</a> are at the top of the article!</p>
<h4>Resources and References</h4>
<p>This article is a blatant grab bag of experimental and reused code from earlier experiments and other demo programs. Below are some of the projects I lifted code examples from:</p>
<ul>
<li><a href="http://pinvoke.net/">Pinvoke.net</a> – a wiki-style site with many useful bits of example code related to calling the Windows API from within .NET.
</li><li><a href="http://blogs.msdn.com/coding4fun/archive/2009/10/08/9905168.aspx">“.NET Audio Recorder”</a> by Mark Heath, from which I stole code to make the audio trigger.
</li><li><a href="http://blogs.msdn.com/coding4fun/archive/2007/10/29/5773776.aspx">“Possessed PC Pranks for Halloween”</a> by Brian Peek, from which I stole the basic code for sending keystrokes.
</li><li><a href="http://blogs.msdn.com/coding4fun/archive/2007/03/29/1991785.aspx">“April Fools' Day Application”</a> by Brian Peek, from which I stole code to grab the screen and rotate it.
</li></ul>
<h3>About The Author</h3>
<p>Randall Maas writes firmware for medical devices, and consults in embedded software. Before that he did a lot of other things… like everyone else in the software industry. You can contact him at
<a href="mailto:randym@acm.org">randym@acm.org</a>.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/pranks/RSS&WT.dl=0&WT.entryid=Entry:RSSView:144c71c45bb4497091de9e7600caf138">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Halloween-Gremlins</comments>
      <itunes:summary>
This article describes a quick and easy application to play Halloween tricks on the PC. 
 
Introduction
This article describes “Gremlin”, a quick and easy application that lets you play Halloween tricks. When your victim&#39;s computer is idle, Gremlin moves windows around on the screen, changes the focus window, moves your mouse, scrolls windows, and types nonsensical
 stuff. When there is background noise – like someone talking – it will shake the screen, even as your victim is typing away. 
Deployment
Run it right away. You can download, copy theGremlin.exe executable and NAudio.dll to the victim&#39;s computer (say in c:\ directory), and then double click on the executable to run it. 
Run it later. The other option is to copy the executable and dll files (or a shortcut to it) to the Startup folder on the victim&#39;s machine and watch the fun begin when they start up their machine in the morning! 
If the computer you&#39;re using runs on Windows XP the path is:  

C:\Documents and Settings\All Users\Start Menu\Programs\Startup 

With Vista and Windows 7 the path looks like:  

C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 

Just remember to change USERNAME to the name of the user on your machine. 
 
Commandline
Gremlin is compiled as a windows application, so it won&#39;t popup a terminal window if you double click on it, etc. But you can run it from the command line with flags: 

-aggressive will make the gremlin&#39;s actions more obvious 
-help will display the command line options 
-name NAME is useful for testing. Gremlin will only use windows with this specific title or from this specific application. (Remember to drop the &amp;quot;.exe&amp;quot; from the application filename) 

To stop the program, press CTRL&amp;#43;F2. 
And now … the dodgy bits
The overall structure of the program is broken down into three kinds of functionality – actions, triggers and some interstitial glue: 
Actions 

The screen-shaker is a window that makes the monitor look like it i</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Halloween-Gremlins</link>
      <pubDate>Sat, 31 Oct 2009 22:37:42 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Halloween-Gremlins</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9915768_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/9915768_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Randall Maas</dc:creator>
      <itunes:author>Randall Maas</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Halloween-Gremlins/RSS</wfw:commentRss>
      <category>Audio</category>
      <category>Halloween</category>
      <category>Pranks</category>
      <category>Holiday</category>
    </item>
  <item>
      <title>Clint Pranking NicFill</title>
      <description><![CDATA[Nic decided it was a good idea to hide my keys a few weeks back.&nbsp; This was my revenge.
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/pranks/RSS&WT.dl=0&WT.entryid=Entry:RSSView:4d886039418e4375ac7b9deb0027c58c">]]></description>
      <comments>http://channel9.msdn.com/Blogs/Clint/Clint-Pranking-NicFill</comments>
      <itunes:summary>Nic decided it was a good idea to hide my keys a few weeks back.&amp;nbsp; This was my revenge.
</itunes:summary>
      <itunes:duration>79</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/Clint/Clint-Pranking-NicFill</link>
      <pubDate>Mon, 14 Sep 2009 16:42:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/Clint/Clint-Pranking-NicFill</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/491606_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/491606_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_2MB_ch9.wmv" expression="full" duration="79" fileSize="60629899" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_ch9.mp3" expression="full" duration="79" fileSize="639569" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_ch9.mp4" expression="full" duration="79" fileSize="10753529" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_ch9.wma" expression="full" duration="79" fileSize="659849" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_ch9.wmv" expression="full" duration="79" fileSize="17558691" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_Zune_ch9.wmv" expression="full" duration="79" fileSize="11318619" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="mms://mschnlnine.wmod.llnwd.net/a1809/d1/ch9/6/0/6/1/9/4/clintPranksNic_s_ch9.wmv" expression="full" duration="79" fileSize="209" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/6/0/6/1/9/4/clintPranksNic_ch9.wmv" length="17558691" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Clint Rutkas</dc:creator>
      <itunes:author>Clint Rutkas</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/Clint/Clint-Pranking-NicFill/RSS</wfw:commentRss>
      <category>Channel 9 Team</category>
      <category>Pranks</category>
    </item>
  <item>
      <title>Prank: Re-Map the Keyboard!</title>
      <description><![CDATA[I wish I had known of this for April Fools Day! <a href="http://www.randyrants.com/2006/07/sharpkeys_211.html">SharpKeys</a> is a free utility that lets you remap any key on your keyboard. Essentially, SharpKeys is a registry hack that is used to make certain keys on a keyboard act like other keys. After you install the software, you can tell it what each key's new function can be. Although the software can be useful (like remapping CAPS Lock to Shift or turning it off if you have fumble fingers), it seems designed for pranking! The software works on Windows NT, Windows 2000, Windows XP, Windows Server 2003, or Windows Vista. The new version (2.1.1) addresses the Vista's user security so you no longer have to explicitly run SharpKeys as an Administrator as before. <em>(via </em><a href="http://www.downloadsquad.com/2008/02/01/remap-your-bosss-keyboard-as-a-prank-with-sharpkeys/"><em>Download Squad</em></a><em>)</em> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/pranks/RSS&WT.dl=0&WT.entryid=Entry:RSSView:4bb412de640b4ceaae119e0d00e177dd">]]></description>
      <comments>http://channel9.msdn.com/Blogs/coolstuff/Prank-Re-Map-the-Keyboard</comments>
      <itunes:summary>I wish I had known of this for April Fools Day! SharpKeys is a free utility that lets you remap any key on your keyboard. Essentially, SharpKeys is a registry hack that is used to make certain keys on a keyboard act like other keys. After you install the software, you can tell it what each key&#39;s new function can be. Although the software can be useful (like remapping CAPS Lock to Shift or turning it off if you have fumble fingers), it seems designed for pranking! The software works on Windows NT, Windows 2000, Windows XP, Windows Server 2003, or Windows Vista. The new version (2.1.1) addresses the Vista&#39;s user security so you no longer have to explicitly run SharpKeys as an Administrator as before. (via Download Squad)</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/coolstuff/Prank-Re-Map-the-Keyboard</link>
      <pubDate>Fri, 08 Feb 2008 05:19:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/coolstuff/Prank-Re-Map-the-Keyboard</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/320/on10_156815b5-ddcf-44a7-a2e6-7e0f240804ee.jpg" height="0" width="0"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/85/on10_d7eb7fc0-17f0-4c07-8827-8fa57cd0d826.jpg" height="64" width="85"></media:thumbnail>      
      <dc:creator>Sarah Perez</dc:creator>
      <itunes:author>Sarah Perez</itunes:author>
      <slash:comments>5</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/coolstuff/Prank-Re-Map-the-Keyboard/RSS</wfw:commentRss>
      <category>Pranks</category>
      <category>Utilities</category>
      <category>utility</category>
    </item>
  <item>
      <title>Almost feels like a holiday</title>
      <description><![CDATA[A friend called to ask what it's like working at Microsoft on the Halo 3 launch day. Yes, were all talking about it. Many are playing it right now (both here and at home). Employees were lined up at the company store (they had someone in a Master Chief costume there.) The <a href="http://halo.bungie.org/reviews.html?page=9">reviews so far</a> are about as good as game scores get. But best of all, we're all in awe of how much people really love this game. <br><br>In what is probably the best (okay, only) <a href="http://www-tech.mit.edu/V127/N41/graphics/halo3.html">statue hack</a> I've ever seen, MIT students 'hacked' the John P. Harvard statue in Harvard Yard to look like Master Chief. You have to believe that in this day and age that there was a video shot of this prank in progress. Come'on, let's see it.&nbsp; <br><br>Microsoft employee Brandon Wirtz combined his two favorite games and created a Halo-themed hardwood Dance Dance Revolution surface for his Xbox using about $45 in Home Depot supplies.&nbsp;<a href="http://www.xyhd.tv/2007/09/how-to/halo-3-dance-dance-revolution-hard-wood-dance-surface-for-xbox-360/">Check out more details and the video here</a>. <br><br>LoadingReadyRun.com <a href="http://www.loadingreadyrun.com/videos/view/228/Halo%3A&#43;The&#43;Future&#43;of&#43;Gaming">shows us their take</a> on the future of the Halo franchise. Little do they know the J. Allard Presidential Planning Committee has already <a href="http://www.on10.net/people/Laura/">selected a chairperson</a>. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif' alt='Wink' /> <br><br>Boy band <a href="http://www.superdeluxe.com/sd/contentDetail.do?id=D81F2344BF5AC7BBFFE3587F10E93131C90D27BA743FF37E">Team Tiger Awesome</a> puts their Halo love into verse. <a href="http://www.collegehumor.com/video:1777278">College Humor demonstrates</a> the importance of sound designers in gaming. Others have taken a break from the carnage to play a little bit of <a href="http://www.halo3impact.com/videos/?video=12553&amp;title=Halo_3_Baseball_Homerun">Spartan Stickball</a>. We've even found that Halo can <a href="http://albotas.com/index.php?option=com_content&amp;task=view&amp;id=95">bring out the best in people</a>. <br><br>Now go have some fun! <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/pranks/RSS&WT.dl=0&WT.entryid=Entry:RSSView:431c64f7cb754abf8cf49e0f0103b9aa">]]></description>
      <comments>http://channel9.msdn.com/Blogs/LarryLarsen/Almost-feels-like-a-holiday</comments>
      <itunes:summary>A friend called to ask what it&#39;s like working at Microsoft on the Halo 3 launch day. Yes, were all talking about it. Many are playing it right now (both here and at home). Employees were lined up at the company store (they had someone in a Master Chief costume there.) The reviews so far are about as good as game scores get. But best of all, we&#39;re all in awe of how much people really love this game. In what is probably the best (okay, only) statue hack I&#39;ve ever seen, MIT students &#39;hacked&#39; the John P. Harvard statue in Harvard Yard to look like Master Chief. You have to believe that in this day and age that there was a video shot of this prank in progress. Come&#39;on, let&#39;s see it.&amp;nbsp; Microsoft employee Brandon Wirtz combined his two favorite games and created a Halo-themed hardwood Dance Dance Revolution surface for his Xbox using about $45 in Home Depot supplies.&amp;nbsp;Check out more details and the video here. LoadingReadyRun.com shows us their take on the future of the Halo franchise. Little do they know the J. Allard Presidential Planning Committee has already selected a chairperson.  Boy band Team Tiger Awesome puts their Halo love into verse. College Humor demonstrates the importance of sound designers in gaming. Others have taken a break from the carnage to play a little bit of Spartan Stickball. We&#39;ve even found that Halo can bring out the best in people. Now go have some fun!</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/LarryLarsen/Almost-feels-like-a-holiday</link>
      <pubDate>Tue, 25 Sep 2007 20:01:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/LarryLarsen/Almost-feels-like-a-holiday</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/content/on10/blogs/hack.jpg" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/content/on10/entries/previewsmall/18961.jpg" height="64" width="85"></media:thumbnail>      
      <dc:creator>Larry Larsen</dc:creator>
      <itunes:author>Larry Larsen</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/LarryLarsen/Almost-feels-like-a-holiday/RSS</wfw:commentRss>
      <category>Pranks</category>
      <category>Halo 3</category>
    </item>    
</channel>
</rss>