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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:41:23+00:00 2026-05-19T16:41:23+00:00

I am trying to send a message to a game (to automate text commands),

  • 0

I am trying to send a message to a game (to automate text commands), the problem is that I can’t figure out how to use the information from spy++ to write a C# sendmessage function.

I was able to use spy++ to get
00220540 S WM_SETCURSOR hwnd:0024052C nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE

Could anyone provide a breakdown of what this means, and how to send the message to the game in c#?

EDIT:

I found out that I was looking at the wrong process. Instead of looking at the javaw.exe, I was looking at the actual game.

Here is the code for pressing t:

<00919> 0038062A WM_INPUT nInputCode:RIM_INPUT hRawInput:189E0973
<00920> 0024052 P WM_KEYUP nVirtKey:'T' cRepeat:1 ScanCode:14fExtended:0fAltDown:0fRepeat:1fUp:1
  • 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-19T16:41:24+00:00Added an answer on May 19, 2026 at 4:41 pm

    So lets start with the signature for SendMessage, from Pinvoke.net:

    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
    

    It taks a window handle, hWnd, a message ID, Msg, and two generic parameters wParam and lParam which change meaing based on the message ID.

    What spy++ is showing you is the parameters that were sent to SendMessage. As you can see it doesn’t show you wParam and lParam, but hwnd, nHittest, and wMouseMsg. That’s because Spy++ knows what the wParam and lParam parameters actually mean for a WM_SETCURSOR message and is decoding them for you.

    So decoding each piece of the what Spy++ has sent:

    1. 00220540 – the window handle receiving the message – the hWnd parameter.
    2. S – It means it was sent via
      SendMessage() and not posted via
      PostMessage(). See http://msdn.microsoft.com/en-us/library/aa265147(v=vs.60).aspx
    3. WM_SETCURSOR – The message ID – the
      Msg parameter.
    4. hwnd:0024052C – handle of the Window
      containing the cursor – the wParam
      parameter.
    5. nHittest:HTCLIENT – the hit test
      code – the low word of the lParam
      parameter.
    6. wMouseMsg:WM_MOUSEMOVE – the mouse
      message – the high word of the
      lParam parameter.

    The way you would go about sending the message to a window is:

    enum WindowMessages {
        WM_SETCURSOR  = 0x0020,
        WM_MOUSEMOVE  = 0x0200,
        ....
    }
    
    enum HitTestCodes {
        HTCLIENT = 1,
        ....
    }
    
    ....
    IntPtr hWnd = [get your window handle some how]
    int lParam = ((int)WindowMessages.WM_MOUSEMOVE) << 16 + (int)HitTestCodes.HTCLIENT;
    SendMessage(hWnd, (uint)WindowMessages.WM_SETCURSOR, hWnd, (IntPtr)lParam);
    

    For understanding what other messages mean you can do a search on Msdn.com for the messsage in the Windows documentation.

    So after answering all of that I don’t think this will have anything to do with sending keys to the game you are trying to control. WM_SETCURSOR doesn’t have anything to do with keyboard input.

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

Sidebar

Related Questions

I'm trying to send a message with game center that contains a struct, roughly
I am trying to use a websocket to send audio message, what type of
I'm trying to send-retrive message from server by SOAP... but soapConnection.call( soapMessage, endpoint )
I'm making a turned based poker game and trying to figure out the best
I am trying to send a message to my main activity from an Async
I'm trying to figure out if game center is the right tool for me.
I'm trying to send a message to the users. I use a message object
I have been trying to send xml message from php to asp and output
I'm trying to send a message with an IEnumerable property, am i correct that
I am trying to send a message, using MailCore framework in iOS. This is

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.