Results 1 to 5 of 5
  1. #1
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy

    Help with sending keys

    I need help with sending the space key to Combat Arms.

    Apparently you can't do VKs anymore since Nexon patched them or something like that. So my bunny hop doesn't work. It's MSVC++ and Windows forms project...

    I have tried :
    SendKeys::Send();
    SendKeys::SendWait();
    GenerateKey(); (Person made function)
    keybd_event( VK_SPACE, 0x45, KEYEVENTF_EXTENDEDKEY, 0 );
    keybd_event( VK_SPACE, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0 );

    etc...
    Nothing seems to work. Is there any way I can do this?

  2. #2
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    You can try PostMessage()

    PostMessage Function()

    I did a little demo for Notepad for you.

    Code:
    #include <windows.h>
    #include <iostream>
    
    using namespace std;
    
    HWND hwnd;
    HWND child;
    
    int main()
    {
        hwnd = FindWindow(0,"Untitled - Notepad");
        if(!hwnd)
        {
                 return 0;
        }
        child = FindWindowEx(hwnd,0,"edit",0);
        if(!child)
        {
                  return 0;
        }
        
        SetForegroundWindow(child);
        Sleep(500);
               
        PostMessage(child,WM_KEYDOWN,(WPARAM)VkKeyScan('w'),0);
        
        cin.get();
    }
    Pretty much just types W into the edit box on NotePad.

    FindWindowEx was just to find the child window, in this case it's the giant edit box where you type. I don't think you need to do that for CA though.
    Code:
    child = FindWindowEx(hwnd,0,"edit",0);
    "edit" is the system class. If you were to make a textbox using windows api, the system class would be "edit", if you were making a button, it would be "button" etc etc..

    More info here:

    CreateWindow Function()
    Last edited by Void; 11-22-2009 at 07:11 PM.

  3. The Following User Says Thank You to Void For This Useful Post:

    why06 (11-22-2009)

  4. #3
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    Quote Originally Posted by Davidm44 View Post
    You can try PostMessage()

    PostMessage Function()

    I did a little demo for Notepad for you.

    Code:
    #include <windows.h>
    #include <iostream>
    
    using namespace std;
    
    HWND hwnd;
    HWND child;
    
    int main()
    {
        hwnd = FindWindow(0,"Untitled - Notepad");
        if(!hwnd)
        {
                 return 0;
        }
        child = FindWindowEx(hwnd,0,"edit",0);
        if(!child)
        {
                  return 0;
        }
        
        SetForegroundWindow(child);
        Sleep(500);
               
        PostMessage(child,WM_KEYDOWN,(WPARAM)VkKeyScan('w'),0);
        
        cin.get();
    }
    Pretty much just types W into the edit box on NotePad.

    FindWindowEx was just to find the child window, in this case it's the giant edit box where you type. I don't think you need to do that for CA though.
    Code:
    child = FindWindowEx(hwnd,0,"edit",0);
    "edit" is the system class. If you were to make a textbox using windows api, the system class would be "edit", if you were making a button, it would be "button" etc etc..

    More info here:

    CreateWindow Function()
    Thanks I'll try this out now.

  5. #4
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    That ought to work, but PostMessage() is kind of slow. A Global Key board hook would be faster and the better choice. I believe BA posted some source for one. Copy and paste till your heart desire.

    Hmmmm... wdf is HD when you need him, must have worn himself after that VB thing...

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  6. #5
    TehKiller's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    43
    Reputation
    10
    Thanks
    10
    Quote Originally Posted by why06 View Post
    That ought to work, but PostMessage() is kind of slow. A Global Key board hook would be faster and the better choice. I believe BA posted some source for one. Copy and paste till your heart desire.

    Hmmmm... wdf is HD when you need him, must have worn himself after that VB thing...
    WUT?! I'm still here just stopped flaming noobs, instead I wait for my mignions(crushed and ilovecookies) do it for me my plan isnt working yet tho, they are too soft and squishy, like the squishy toys.
    But I will bend them to my will >=D soon they will flame ch00bs just like me ill be so proud :P

Similar Threads

  1. Send.keys help...
    By tester181 in forum Visual Basic Programming
    Replies: 17
    Last Post: 09-27-2011, 12:42 PM
  2. Replies: 14
    Last Post: 10-04-2009, 02:49 PM
  3. Hi, i need help with packet sending
    By Prosper in forum General Hacking
    Replies: 0
    Last Post: 08-21-2008, 12:08 AM
  4. Kingz Of Key's V2.0 Need Help With Release!
    By Redbull in forum WarRock - International Hacks
    Replies: 13
    Last Post: 08-27-2007, 10:35 AM

Tags for this Thread