GameKiller - Bringing The Pain To Each And Every Game!
Reply to Thread
Results 1 to 7 of 7
  1. #1
    Banned Feedback Score 0
    Join Date
    Jan 2010
    Posts
    53
    Thanks
    2
    Thanked 4 Times in 4 Posts
     

    Default Sending Key Presses to MS

    Alright, I'm havin a bit of trouble and I really don't have the time to keep sitting down trying to figure it out because of college and work. I've spent a load of time already, and figured it was time to ask for a bit of help.

    Note: In C#, but I'll take any language and convert it if I have to.

    I need to send certain key presses to MS. However, nothing I do seems to actually send the "Key" to MS, but instead just the string. I've been using SendInput and other relative functions, but nothing works. I've been told to try DirectInput, but when screwing with that I noticed it's more for READING keypresses/events, than actually sending them.

    So, does anyone know to send readable key presses to MS? If not, that's fine, I can figure it out, it's just going to take a LOT longer than I would like.


  2. Sponsored


  3. #2
    Experienced Hacker Feedback Score 0 ヘ(^_^ヘ)(ノ^_^)ノ's Avatar
    Join Date
    Sep 2009
    Posts
    221
    Thanks
    4
    Thanked 43 Times in 28 Posts
     

    Default Re: Sending Key Presses to MS

    PostMessage + 5 Bypass
    Intel Corie i7 920 OC @ 4.0GHz + Prolimatech Megahalems CPU Cooler with 2 Fans @ 1200RPMs
    Evga X58 SLI Classified
    Evga GTX 470 FTW for 3 Way SLI + Evga GT 9800 GT for PhysX
    Corsair Dominator GT 1600MHz DDR3 6GB
    Corsair HX1000
    Corsair Obsidian 800D
    Kingston 64GB SSD for OS + Western Digital Caviar Black 1TB for Storage
    Alienware OptX 3D Monitor + Nvidia 3D Bundle
    Razer Lycosa, Mamba, Sphex, Mako, & Megalodon



  4. #3
    Banned Feedback Score 0
    Join Date
    Jan 2010
    Posts
    53
    Thanks
    2
    Thanked 4 Times in 4 Posts
     

    Default Re: Sending Key Presses to MS

    Quote Originally Posted by KittyKittyBoy17
    [Dear Visitor, you're restricted from viewing links until you are registered & logged on.
    Click Here To Register Today
    PostMessage + 5 Bypass
    PostMessage only sends the string/character value, though. Not the actual keypress. So regardless of what bypass is used, I can't see that working in any way, shape, or form.


  5. #4
    Banned Feedback Score 2 (100%)
    Join Date
    Aug 2009
    Location
    New Zealand
    Posts
    581
    Thanks
    53
    Thanked 63 Times in 42 Posts
     

    Default Re: Sending Key Presses to MS

    Quote Originally Posted by TGForums
    [Dear Visitor, you're restricted from viewing links until you are registered & logged on.
    Click Here To Register Today
    PostMessage only sends the string/character value, though. Not the actual keypress. So regardless of what bypass is used, I can't see that working in any way, shape, or form.
    You obviously don't know much about programing. PostMessage is exactly what you are looking for.

    It's simple enough to achieve what you want, just send the WM_KEYDOWN message to MapleStory via it's windows process name (wndproc for short)

    There are several ways to send a PostMessage instruction to it's wndproc, and one of which I will demonstrate (which is in C#)

    First of all you will need to import the following into your project imports "System.Runtime.InteropServices;" This allows you to import and use dynamic link library files (also known as dll's).

    Second you will need to import the FindWindow function and the PostMessage function which will be shown bellow;

    //////////////////////////////////
    //////// FINDWINDOW /////////
    //////////////////////////////////

    Code:
    [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr FindWindow(
                string lpClassName,
                string lpWindowName);
    
            IntPtr hWnd = FindWindow(
                null,
                "MapleStory");
    
    //////////////////////////////////
    //////// POSTMESSAGE ////////
    //////////////////////////////////

    Code:
    [return: MarshalAs(UnmanagedType.Bool)]
            [DllImport("user32.dll", SetLastError = true)]
                static extern bool PostMessage(
                IntPtr hWnd,
                uint Msg,
                int wParam,
                int lParam);
    
    Thirdly you need to define the WM_KEYDOWN event. Add this piece of code to your form coding (under public partial class)

    Code:
    const int WM_KEYDOWN = 0x100;
    
    Now that we've got all the functions and imports sorted, all thats needed to do is call the PostMessage event using our parameters. For an example of the usage of PostMessage I will attempt to send the "A" Key to MapleStory' wndproc, the following is done so like:

    Code:
    PostMessage(hWnd, WM_KEYDOWN, 0x41, 0x1e0001);
    
    Here I will list each Parameter of the PostMessage event so you can get a better understanding.

    hWnd - Is the destination parameter (basically where the message will be delivered to in la mans terms)
    WM_KEYDOWN - As stated before this is the KEY_DOWN event, it signifies a key being held down. Alternatively you can also use the KEY_PRESS event.
    0x41 - Is the wParam which signifies what key is being used
    0x1e0001 - Is the lParam which signifies what key is being used

    You can find a list of wParameters and lParameters here:
    [Dear Visitor, you're restricted from viewing links until you are registered & logged on.
    Click Here To Register Today


    Ofcourse none of the above will work if you have not attached your program to MapleStory' wndproc, or in this case "hWnd". To do this, simply put the following code in your form_load events:

    Code:
    FindWindow(null, "MapleStory");
    
    An alternative to this would be to put "MapleStoryClass" instead of MapleStory. If you are using "MapleStory" as the window name, you will only be able to use your program if you start it up before you start MapleStory. Using "MapleStoryClass" as the window to find will allow you to open up your program after MapleStory has been opened.

    Thats all I have to say.
    Last edited by Viera; 01-25-2010 at 05:23 AM.


  6. The Following User Says Thank You to Viera For This Useful Post:

    TGForums (01-25-2010)

  7. #5
    Banned Feedback Score 0
    Join Date
    Jan 2010
    Posts
    53
    Thanks
    2
    Thanked 4 Times in 4 Posts
     

    Default Re: Sending Key Presses to MS

    Quote Originally Posted by Viera
    [Dear Visitor, you're restricted from viewing links until you are registered & logged on.
    Click Here To Register Today
    You obviously don't know much about programing. PostMessage is exactly what you are looking for.

    It's simple enough to achieve what you want, just send the WM_KEYDOWN message to MapleStory via it's windows process name (wndproc for short)

    There are several ways to send a PostMessage instruction to it's wndproc, and one of which I will demonstrate (which is in C#)

    First of all you will need to import the following into your project imports "System.Runtime.InteropServices;" This allows you to import and use dynamic link library files (also known as dll's).

    Second you will need to import the FindWindow function and the PostMessage function which will be shown bellow;

    //////////////////////////////////
    //////// FINDWINDOW /////////
    //////////////////////////////////

    Code:
    [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr FindWindow(
                string lpClassName,
                string lpWindowName);
    
            IntPtr hWnd = FindWindow(
                null,
                "MapleStory");
    
    //////////////////////////////////
    //////// POSTMESSAGE ////////
    //////////////////////////////////

    Code:
    [return: MarshalAs(UnmanagedType.Bool)]
            [DllImport("user32.dll", SetLastError = true)]
                static extern bool PostMessage(
                IntPtr hWnd,
                uint Msg,
                int wParam,
                int lParam);
    
    Thirdly you need to define the WM_KEYDOWN event. Add this piece of code to your form coding (under public partial class)

    Code:
    const int WM_KEYDOWN = 0x100;
    
    Now that we've got all the functions and imports sorted, all thats needed to do is call the PostMessage event using our parameters. For an example of the usage of PostMessage I will attempt to send the "A" Key to MapleStory' wndproc, the following is done so like:

    Code:
    PostMessage(hWnd, WM_KEYDOWN, 0x41, 0x1e0001);
    
    Here I will list each Parameter of the PostMessage event so you can get a better understanding.

    hWnd - Is the destination parameter (basically where the message will be delivered to in la mans terms)
    WM_KEYDOWN - As stated before this is the KEY_DOWN event, it signifies a key being held down. Alternatively you can also use the KEY_PRESS event.
    0x41 - Is the wParam which signifies what key is being used
    0x1e0001 - Is the lParam which signifies what key is being used

    You can find a list of wParameters and lParameters here:
    [Dear Visitor, you're restricted from viewing links until you are registered & logged on.
    Click Here To Register Today


    Ofcourse none of the above will work if you have not attached your program to MapleStory' wndproc, or in this case "hWnd". To do this, simply put the following code in your form_load events:

    Code:
    FindWindow(null, "MapleStory");
    
    An alternative to this would be to put "MapleStoryClass" instead of MapleStory. If you are using "MapleStory" as the window name, you will only be able to use your program if you start it up before you start MapleStory. Using "MapleStoryClass" as the window to find will allow you to open up your program after MapleStory has been opened.

    Thats all I have to say.
    I understood all of that before lol, but thankyou for the time you spent in that response. And I figured PostMessage was only a char/string oriented function; not a keypressing one. I previously believed it was similar to SendWait, but then again I hadn't really looked into it. Sorry for my ignorance and thank you for your help.

    PS: It really had nothing to do with not knowing how to program. It was simply that I didn't know PostMessage because, like I previously stated, I thought it was string/char sending and not the actual key.

    EDIT:

    Played around with it while in class, got it working. Thank you very much for the help.
    Last edited by TGForums; 01-25-2010 at 01:54 PM.


  8. #6
    Banned Feedback Score 2 (100%)
    Join Date
    Aug 2009
    Location
    New Zealand
    Posts
    581
    Thanks
    53
    Thanked 63 Times in 42 Posts
     

    Default Re: Sending Key Presses to MS

    Quote Originally Posted by TGForums
    [Dear Visitor, you're restricted from viewing links until you are registered & logged on.
    Click Here To Register Today
    I understood all of that before lol, but thankyou for the time you spent in that response. And I figured PostMessage was only a char/string oriented function; not a keypressing one. I previously believed it was similar to SendWait, but then again I hadn't really looked into it. Sorry for my ignorance and thank you for your help.

    PS: It really had nothing to do with not knowing how to program. It was simply that I didn't know PostMessage because, like I previously stated, I thought it was string/char sending and not the actual key.

    EDIT:

    Played around with it while in class, got it working. Thank you very much for the help.
    No problem

    I remember when I was making my first bot and was having trouble with PostMessage. Ah the good ol' days


  9. #7
    Banned Feedback Score 0
    Join Date
    Jan 2010
    Posts
    53
    Thanks
    2
    Thanked 4 Times in 4 Posts
     

    Default Re: Sending Key Presses to MS

    Quote Originally Posted by Viera
    [Dear Visitor, you're restricted from viewing links until you are registered & logged on.
    Click Here To Register Today
    No problem

    I remember when I was making my first bot and was having trouble with PostMessage. Ah the good ol' days
    It's not my first; normally I'd use SendInput, but I just recently found out that doesn't work for DirectX games, so I needed to find an alternative. And thanks to you finding my stupidity and letting me know that PostMessage wasn't what I was thinking it was (IE. Send, SendWait, etc), I actually managed to get it to work lol

    The last bots for MS that I made were roughly 3-years ago and written in C++/Java. Then I moved onto FFXI, and was making bots there for those 3 years, but never had a problem with the automated input until now haha

    Thankyou

    And PS. I've been using FindWindow(null, "MapleStory"); for a while, and never had a problem with the order of execution. It seems to work fine, at least for me, regardless of the order I start the programs. I wonder what would cause the difference


Similar Threads

  1. Sending Input to MS
    By TGForums in forum Global Maple Story Hacks Discussion
    Replies: 3
    Last Post: 01-22-2010, 09:00 PM
  2. Please stop sending me messages.
    By Benji in forum SpamZilla
    Replies: 40
    Last Post: 08-22-2009, 10:03 AM
  3. Packet Sending & Recieving
    By 0wnzj00z in forum Global Maple Story Hacks Discussion
    Replies: 1
    Last Post: 08-18-2009, 04:57 PM

Visitors found this page by searching for:

HWND gamekiller

SEO Blog

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Winner for September 2010
GameKiller.net
Design Copyright © 2009 - 2010 GameKiller, All Rights Reserved.
GameKiller.net is not responsible for any content in any posting made by users on the site.
All times are GMT -4. The time now is 05:09 PM. SEO by vBSEO 3.5.1 PL1