Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8470977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:40:04+00:00 2026-06-10T16:40:04+00:00

I want to write a software that intercepts the user input and changes it.

  • 0

I want to write a software that intercepts the user input and changes it. In late windows 98 and before our language wasn’t supported officially so programmers decided to invent a writing method based on ASCII characters (ArmSCII) and a font so that we could write in our language. The software is just changing the english inpur to relevant characters in ArmSCII. The program is now old. I want to write a new one. and it should be system-wide. Any suggestions how can I hook into keyboard and change the input? C , C++ or C# that doesn’t matter. Im fine with all of them..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:40:06+00:00Added an answer on June 10, 2026 at 4:40 pm

    Here is a Keyboard hook that intercepts user input and changes it to printf("ha ha, I intercepted your [%c] and changed it to [%c]\n", key, key+1);

    Win32 console C/C++ code :

    #define _WIN32_WINNT 0x0400
    #pragma comment( lib, "user32.lib" )
    
    #include <windows.h>
    #include <stdio.h>
    
    HHOOK hKeyboardHook;
    
    __declspec(dllexport) LRESULT CALLBACK KeyboardEvent (int nCode, WPARAM wParam, LPARAM lParam)
    {
        DWORD SHIFT_key=0;
        DWORD CTRL_key=0;
        DWORD ALT_key=0;
    
        if  ((nCode == HC_ACTION) &&   ((wParam == WM_SYSKEYDOWN) ||  (wParam == WM_KEYDOWN)))      
        {
            KBDLLHOOKSTRUCT hooked_key =    *((KBDLLHOOKSTRUCT*)lParam);
            DWORD dwMsg = 1;
            dwMsg += hooked_key.scanCode << 16;
            dwMsg += hooked_key.flags << 24;
            char lpszKeyName[1024] = {0};
            //lpszKeyName[0] = '[';
    
            int i = GetKeyNameText(dwMsg,   (lpszKeyName+1),0xFF) + 1;
            //lpszKeyName[i] = ']';
    
            int key = hooked_key.vkCode;
    
            SHIFT_key = GetAsyncKeyState(VK_SHIFT);
            CTRL_key = GetAsyncKeyState(VK_CONTROL);
            ALT_key = GetAsyncKeyState(VK_MENU);
    
            if (key >= 'A' && key <= 'Z')   
            {
    
                if  (GetAsyncKeyState(VK_SHIFT)>= 0) key +=32;
    
                if (CTRL_key !=0 && key == 'y' )
                {
                   MessageBox(NULL, "CTRL-y was pressed\nLaunch your app here", "H O T K E Y", MB_OK); 
                   CTRL_key=0;
                }
    
                if (CTRL_key !=0 && key == 'q' )
                {
                    MessageBox(NULL, "Shutting down", "H O T K E Y", MB_OK); 
                   PostQuitMessage(0);
                }
    
    
    
    
                //printf("key = %c\n", key);
                printf("ha ha, I intercepted your [%c] and changed it to [%c]\n", key, key+1);
    
                SHIFT_key = 0;
                CTRL_key = 0;
                ALT_key = 0;
    
            }
    
            //printf("lpszKeyName = %s\n",  lpszKeyName );
        //  printf("%s",  lpszKeyName );
        }
        return CallNextHookEx(hKeyboardHook,    nCode,wParam,lParam);
    }
    
    void MessageLoop()
    {
        MSG message;
        while (GetMessage(&message,NULL,0,0)) 
        {
            TranslateMessage( &message );
            DispatchMessage( &message );
        }
    }
    
    DWORD WINAPI my_HotKey(LPVOID lpParm)
    {
        HINSTANCE hInstance = GetModuleHandle(NULL);
        if (!hInstance) hInstance = LoadLibrary((LPCSTR) lpParm); 
        if (!hInstance) return 1;
    
        hKeyboardHook = SetWindowsHookEx (  WH_KEYBOARD_LL, (HOOKPROC) KeyboardEvent,   hInstance,  NULL    );
        MessageLoop();
        UnhookWindowsHookEx(hKeyboardHook);
        return 0;
    }
    
    int main(int argc, char** argv)
    {
        HANDLE hThread;
        DWORD dwThread;
    
        hThread = CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)   my_HotKey, (LPVOID) argv[0], NULL, &dwThread);
    
        //ShowWindow(FindWindowA("ConsoleWindowClass", NULL), false);
    
        if (hThread) return WaitForSingleObject(hThread,INFINITE);
        else return 1;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a software that unifies logs from different servers, all WebSphere,
Using .net's setup project, I want to write the location that my software is
I want to write a program in Prolog that confirms if a b-tree of
I want to write <a href=product.php?id=5> as product/5.I am not talking about user to
I am an ASP.NET developer, but now I want to build a software that
I want to write an enterprise software and now I'm in the DB design
There is some software I want to write a plugin for. The software includes
I have a bunch of software tools that are installed on 50-100 Windows 7
I'm looking for software that will allow me to write a macro/script to get
I'm making an app that takes commands from User and write it in real

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.