Important alert: (current site time 7/15/2013 6:15:42 PM EDT)
 

VB icon

Ghost Typer

Email
Submitted on: 4/1/2006 6:58:40 PM
By: Brenton Andrew Saunders 
Level: Intermediate
User Rating: By 7 Users
Compatibility: Microsoft Visual C++
Views: 12023
(About the author)
 
     The perfect April Fool's Day Prank! It simulates a user typing random scary messages every 45 seconds. Imagine typing up a report in a word processor when all of a sudden the words "I'm watching you...", appears on the screen all of a sudden.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: Ghost Typer
// Description:The perfect April Fool's Day Prank! It simulates a user typing random scary messages every 45 seconds. Imagine typing up a report in a word processor when all of a sudden the words "I'm watching you...", appears on the screen all of a sudden.
// By: Brenton Andrew Saunders
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=10405&lngWId=3//for details.//**************************************

#include <windows.h>
#include <stdlib.h>
#define NUM_MESSAGES 11
CHAR szMessage[NUM_MESSAGES][255] = {"i'm watching you...", // Just some scary messages
									 "did you lock the door",
									 "are you alone",
									 "they're coming...",
									 "leave while you can...",
									 "it's here...",
									 "i know where you are...",
									 "did you check the kids",
									 "don't turn around...",
									 "help me...",
									 "it's only a matter of time..."};
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	srand(GetTickCount());
	while(TRUE) // Main loop; Keeps the program running
	{
		Sleep(45000); // Pause for a few seconds to scare whoever is onleave while you the computer
		INT nRand = (rand() % NUM_MESSAGES); // Pick a random message to display
		for(INT i = 0; i < lstrlen(szMessage[nRand]); i ++)
		{
			// Simulate a person typing
			keybd_event((UCHAR)VkKeyScan(szMessage[nRand][i]), NULL, NULL, NULL);
			Sleep(rand() % 200);
		}
	}
	return 0;
}


Other 46 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
4/2/2006 8:27:57 AMRasmus

Wow! I both like the idea and the fact that this is a very simple program that I can yet learn from!

What do you think about this: You could merge this program with a chatbot and let it recognize whenever a button is pressed and put it together to a sentence so that it can receive input too. This way people can start talking with the "mysterious person" in e.g. a word processor! Now THAT would be awesome, wouldn't it?
(If this comment was disrespectful, please report it.)

 
4/2/2006 10:52:45 AMBrenton Andrew Saunders

Hi Rasmus,

Thanks for the positive feedback. About the chatbot idea: that would be a real cool project to work on! It would make the chatbot seem more real.
(If this comment was disrespectful, please report it.)

 
4/2/2006 2:27:48 PMRasmus

A friend and I are now eagerly working on a prototype of the chatbot version (we are making an entirely new program, but it is based on your idea). I'll send it to you or post it here when it's done. It will be an extremely basic chatbot, but enough to frighten the user ;)
(If this comment was disrespectful, please report it.)

 
4/2/2006 7:19:51 PMBrenton Andrew Saunders

That sounds great!
(If this comment was disrespectful, please report it.)

 
4/4/2006 7:49:44 AMBrenton Andrew Saunders

Thanks for the votes Rasmus and Gaye S. Solo, Jr!

(If this comment was disrespectful, please report it.)

 
4/4/2006 3:31:13 PMBrenton Andrew Saunders

Thanks for the vote dewimper!
(If this comment was disrespectful, please report it.)

 
5/21/2006 5:09:43 PME-Alex

:)) great ideea ;) nice work
(If this comment was disrespectful, please report it.)

 
6/1/2006 6:11:01 PM

That totally rocks.
leave while you can...
ah. I think I forgot to stop it running!
it's here...
(If this comment was disrespectful, please report it.)

 
6/8/2006 12:56:38 PMJesse

haha...Excellent job. Good joke to pull on people. 5/5. :)
(If this comment was disrespectful, please report it.)

 
6/22/2006 12:08:01 PMshrek

hey ,i am getting a linking error,plz help me out
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/INHERIT.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

INHERIT.exe - 2 error(s), 0 warning(s)

(If this comment was disrespectful, please report it.)

 
5/8/2010 10:56:23 AMronaloo

can it be run on dev c++ ?

any special need to mod lib linking in it? pls tell me i really need to run and see myself. sounds awesome. but dev c++ is eating my head on every code i download from here.even trubo c++4.5

or suggest the compiler i should download, apart from MS visual c++, its too big, speed is less. so pls some lightweight compiler refer

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.