Results 1 to 8 of 8
  1. #1
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused

    [help]Keystrokes into application

    I did some testing on a spammer that I have recently made, and I found out the hard way that the
    keystrokes don't register into the program half the time.

    I'm not sure what the issue is exactly, but is there any way to designate the keystrokes to one
    specific application? Somewhat like an injector, where you choose what process you're injecting.

    Makes sense to me, but I'm not sure how to explain it. Having the keystrokes set to work in a specific
    application would be extremely helpful seeing as any keystrokes that my program was making
    didn't work properly in-game.

    I'm trying to make a 'farming' tool so that the character drops the weapon(G key drops the weapon)

    I had it setup like:
    Code:
        Private Sub farm_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles farm.Tick
    
            SendKeys.Send("g")
        End Sub
    As you can see, when the timer ticks, the 'g' key is pressed. BUT when 'g' is pressed, nothing
    happens, not even an acknowledgment that the key has been pressed. But when I open notepad
    it works fine..

    If anyone knows a solution, or something that might help me, I would be grateful ;D

  2. #2
    MJLover's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Neverland
    Posts
    759
    Reputation
    33
    Thanks
    110
    My Mood
    Cheerful
    Quote Originally Posted by Alroundeath View Post
    I did some testing on a spammer that I have recently made, and I found out the hard way that the
    keystrokes don't register into the program half the time.

    I'm not sure what the issue is exactly, but is there any way to designate the keystrokes to one
    specific application? Somewhat like an injector, where you choose what process you're injecting.

    Makes sense to me, but I'm not sure how to explain it. Having the keystrokes set to work in a specific
    application would be extremely helpful seeing as any keystrokes that my program was making
    didn't work properly in-game.

    I'm trying to make a 'farming' tool so that the character drops the weapon(G key drops the weapon)

    I had it setup like:
    Code:
        Private Sub farm_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles farm.Tick
    
            SendKeys.Send("g")
        End Sub
    As you can see, when the timer ticks, the 'g' key is pressed. BUT when 'g' is pressed, nothing
    happens, not even an acknowledgment that the key has been pressed. But when I open notepad
    it works fine..

    If anyone knows a solution, or something that might help me, I would be grateful ;D
    Hmm.. I am not good with keystrokes and spammers stuff, but I can see that the application need to focus the application you want to spam in !!!

    To do this, before enabling the timer put this code:


    Code:
    Appactivate("Application Title")

    If you open a new notepad file Application Title it will be "Untitled - Notepad". So enter that..../....

    This will bring Notepad to front and then when you enable the timer, spamming will start in the notepad !!!

    Hope this helps !!

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

    NextGen1 (04-27-2010)

  4. #3
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Try getting the window handle, then send a message via PostMessage or SendMessage.

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

    NextGen1 (04-27-2010)

  6. #4
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Both will work, Best approach is to get focus

    [php]
    AppActivate("")
    [/php]

    You can open the application from the program
    and set it's focus

    On Button Click that says "Open Game"

    [php]
    Dim GameOpen As Integer = Shell("GamePath", AppWinStyle.MaximizedFocus)
    [/php]

    or you can use Win Api and the Find Windows Function

    Namespace (above Private Class Form1)

    [php]
    Imports System.Runtime.InteropServices
    [/php]

    then Just under Public Class Form1

    [php]
    <DllImport("User32.dll")> _
    Public Shared Function FindWindow(ByVal lpClassName As [String], ByVal lpWindowName As [String]) As Int32
    End Function
    [/php]

    This will allow you to find a window using it's title

    Then use the find window function, and get focus that way .

    plus there is a more elaborate way , but no need for it here, Tough My SDK will have it


     


     


     



    The Most complete application MPGH will ever offer - 68%




  7. The Following 2 Users Say Thank You to NextGen1 For This Useful Post:

    MJLover (04-28-2010),Zoom (04-28-2010)

  8. #5
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    The program can be on top of other, the game for instance.

    It can be on top, but the keys will not work properly in-game.

    I'll try these and see if they work, if not, I'll post back here =/

  9. #6
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    SendKeys won't work in most DX games (alot of companys patch sendkeys)


     


     


     



    The Most complete application MPGH will ever offer - 68%




  10. #7
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Ohhh, so I should use another one of the methods listed above?

    Alright, good to know.

  11. #8
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    There is a send key alternative which uses windows API.


     


     


     



    The Most complete application MPGH will ever offer - 68%




Similar Threads

  1. [Help]Why an Application wont start
    By Cryptonic in forum Visual Basic Programming
    Replies: 29
    Last Post: 04-12-2011, 07:01 PM
  2. [Help] Choosing an Application Name[solved]
    By AceKill3r in forum Visual Basic Programming
    Replies: 13
    Last Post: 02-16-2011, 08:00 AM
  3. [Help] Hooking into a game with a crosshair/setting resolution
    By yodaliketaco in forum C++/C Programming
    Replies: 2
    Last Post: 03-17-2010, 04:02 PM
  4. [Help] need help loggin into warrock
    By th9end in forum WarRock Discussions
    Replies: 7
    Last Post: 09-11-2009, 06:53 AM
  5. [Help]Hooking Into PunkBuster
    By *Marneus901* in forum WarRock - International Hacks
    Replies: 14
    Last Post: 05-24-2008, 10:46 AM