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 6974113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:11:42+00:00 2026-05-27T17:11:42+00:00

I am working on a client loader for a game not made by me.

  • 0

I am working on a client loader for a game not made by me. I’ve built a library of mouse and key events to send to the client and they work for the most part. However, there is one bit I cannot seem to figure out.

I made the typing portion of my code this:

[DllImport("user32.dll")]
public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, uint wParam, uint lParam);

//Send each character of string one at a time
foreach(Char c in Input)
    PostMessage(mainwnd, (uint)WM.CHAR, c, 1);
//Send final enter key to send message in game
PostMessage(mainwnd, (uint)WM.CHAR, 0x0D, 1);

This works fine, but there are two things it doesn’t account for.

  1. In-Game you are required to press the enter key before typing to open chat
  2. There are hotkeys to open menus

I have tried things like PostMessage(mainwnd, (uint)WM.CHAR, 0x0D, 1); to send the beginning enter key, but the game doesn’t process it. Same thing happens if I use PostMessage to try to open menus. Nothing is parsed unless the chat window is already open before sending the message.

I figure I am using the wrong WM_Message, but I cannot find which one I need. I have tried:

  1. WM_CHAR
  2. WM_SYSCHAR
  3. WM_MENUCHAR
  4. WM_HOTKEY
  5. WM_APPCOMMAND
  6. WM_KEYDOWN followed by WM_KEYUP

And maybe a few others, but no luck. Does anyone know which command might work?

  • 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-05-27T17:11:42+00:00Added an answer on May 27, 2026 at 5:11 pm

    You will have to get lucky for this to work. Keyboard input is not merely a message. It also affects (among others) GetKeyboardState and GetAsyncKeyState — and simulating input with these is non-trivial. And if keyboard focus is elsewhere, it can screw things up.

    You can try posting WM_KEYDOWN and WM_KEYUP to generate a slightly lower-level message.

    Lower-level still is SendInput which simulates input from the keyboard driver. Keyboard focus must be in the right place or it will send the input to the wrong window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a client proposal and they will need to upgrade their
I am working on a client-server application that uses boost::serialization library for it's serialization
I'm working on a client/server library for a legacy RPC implementation and was running
I'm working on a back-end functionality for a client. They want to be able
I'm working with a client that needs to generate millions of the alphanumeric codes
I'm working with a client to plan the topology for a public facing SharePoint
I'm working on a client-server Android application and trying to figure out how to
I'm working with a client who has just upgraded from SQL 2000 to SQL
I am working on a client server system, and am running into issues where
I've got a working SOAP::Lite client. It works against an established server, but so

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.