Jump to content

U3 that toggles caps lock


cwig

Recommended Posts

I was think about making a program that when you plug in your U3 flash drive it will autorun and then randomly turn on caps lock or other small stuff like that. Just like a prank/annoying type thing to play on someone. I have it mostly finished in c++ but I am having trouble figuring out how to make it run silently. I've done a few google searches and such but haven't found much. Any help will be appreciated, thanks.

Link to comment
Share on other sites

Sorry i'm kinda new to this. Only thing i was really able find through searches on this site is people saying to do a search because it has already been answered here before. I dont mean to be annoying but if you could provide me with a link, it would very helpful. Maybe im just not looking in the right spot...

Link to comment
Share on other sites

Hello,

if anyone is interested here, I've made a little c++ program that makes capslock blink twice when run.

Just add it on bottom of your go.cmq or whatever autorun script you use, and you'll know exactly when to get the usb drive back ;)

If anyone is interested in the source to play with it, just ask.

capslock.rar

Link to comment
Share on other sites

this is trivial, just use auto hot key completely stealthed (with #NoTrayIcon), portable, and easy to work with.

For example running this program will randomly toggle capslock on and off until the process is killed:

#NoTrayIcon

#SingleInstance, Force

Loop{

Random, seed, 1, 100

If(seed = 50)

{

SendInput, {CapsLock}

}

Sleep, %seed%

}

Link to comment
Share on other sites

  • 1 month later...
Hello,

if anyone is interested here, I've made a little c++ program that makes capslock blink twice when run.

Just add it on bottom of your go.cmq or whatever autorun script you use, and you'll know exactly when to get the usb drive back ;)

If anyone is interested in the source to play with it, just ask.

Nice!!

Could I have the code?

Link to comment
Share on other sites

  • 2 months later...
Nice!!

Could I have the code?

Sorry, haven't been around for a lot... yeah sure, here it is:

#include <windows.h>

using namespace std;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
   LPSTR lpCmdLine, int nCmdShow)
{
           keybd_event(VK_CAPITAL,0x3a, 0 , 0); // Press
           keybd_event(VK_CAPITAL,0x3a, KEYEVENTF_KEYUP,0); // Release
           
           Sleep(40);
           
           keybd_event(VK_CAPITAL,0x3a, 0 , 0); // Press
           keybd_event(VK_CAPITAL,0x3a, KEYEVENTF_KEYUP,0); // Release
           
           Sleep(200);
        
           keybd_event(VK_CAPITAL,0x3a, 0 , 0); // Press
           keybd_event(VK_CAPITAL,0x3a, KEYEVENTF_KEYUP,0); // Release
           
           Sleep(40);
           
           keybd_event(VK_CAPITAL,0x3a, 0 , 0); // Press
           keybd_event(VK_CAPITAL,0x3a, KEYEVENTF_KEYUP,0); // Release
}

Hope it's not too late :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...