Results 1 to 5 of 5
  1. #1
    Gasps Its Michael Jackson's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Heaven
    Posts
    114
    Reputation
    10
    Thanks
    41
    My Mood
    Confused

    [HELP] How do you make SendKeys work?

    I'm personally making a On-Screen Number Pad right now for users who use laptops. And when I debugged it, and tried it, it doesn't work! So I'm guessing I need to have a target process or something. But I don't know how! Help! Here's my code:

    [PHP]Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim TargetProcess As Process() = Process.GetProcessesByName(TextBox1.Text)

    End Sub
    End Class[/PHP]

    That's the TargetProcess. Here's the Number Pad:

    [PHP]Public Class Form2

    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click

    End

    End Sub

    Private Sub AlwaysOnTopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AlwaysOnTopToolStripMenuItem.Click

    If AlwaysOnTopToolStripMenuItem.Checked = True Then

    Me.TopMost = True

    Else

    Me.TopMost = False

    End If

    End Sub

    Private Sub Button0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button0.Click

    SendKeys.SendWait(Keys.NumPad0)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    SendKeys.SendWait(Keys.NumPad1)

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

    SendKeys.SendWait(Keys.NumPad2)

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

    SendKeys.SendWait(Keys.NumPad3)

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

    SendKeys.SendWait(Keys.NumPad4)

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

    SendKeys.SendWait(Keys.NumPad5)

    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

    SendKeys.SendWait(Keys.NumPad6)

    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

    SendKeys.SendWait(Keys.NumPad7)

    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click

    SendKeys.SendWait(Keys.NumPad8)

    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

    SendKeys.SendWait(Keys.NumPad9)

    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click

    SendKeys.SendWait(Keys.Divide)

    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click

    SendKeys.SendWait(Keys.Multiply)

    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click

    SendKeys.SendWait(Keys.Decimal)

    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click

    SendKeys.SendWait(Keys.Enter)

    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click

    SendKeys.SendWait(Keys.Add)

    End Sub

    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click

    SendKeys.SendWait(Keys.Subtract)

    End Sub
    End Class[/PHP]

    Help!
    Quote Originally Posted by Post Ranks
    Leecher 0
    Newbie 50
    Member 100

    Advanced Member 150
    H4X0R Member 250
    Dual-Keyboard Member 500
    Expert Member 750
    Bobo's Trainer 1,000
    MPGH Expert 1,250
    Synthetic Hacker 1,500
    Blackhat Hacker 2,000
    Whitehat Hacker 2,500
    Bobo's Guardian 3,000
    Upcoming MPGHiean 3,500
    MPGH Addict 4,000
    MPGHiean 4,500
    MPGH Knight 5,000
    MPGH Lord 5,500
    MPGH Champion 6,000
    MPGH King 6,500
    MPGH Legend 7,000
    MPGH God 7,500
    MPGH God II 8,000
    MPGH God III 8,500
    MPGH God IV 9,000
    MPGH God V 9,500
    Arun's Slave 10,000
    Dave's Slave 10,500







  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    If you want to send a message/key to a process without having it focused, go for SendMessage.



  3. #3
    Gasps Its Michael Jackson's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Heaven
    Posts
    114
    Reputation
    10
    Thanks
    41
    My Mood
    Confused
    Quote Originally Posted by Blubb1337 View Post
    If you want to send a message/key to a process without having it focused, go for SendMessage.
    What do you mean SendMessage? I can't find it.
    Quote Originally Posted by Post Ranks
    Leecher 0
    Newbie 50
    Member 100

    Advanced Member 150
    H4X0R Member 250
    Dual-Keyboard Member 500
    Expert Member 750
    Bobo's Trainer 1,000
    MPGH Expert 1,250
    Synthetic Hacker 1,500
    Blackhat Hacker 2,000
    Whitehat Hacker 2,500
    Bobo's Guardian 3,000
    Upcoming MPGHiean 3,500
    MPGH Addict 4,000
    MPGHiean 4,500
    MPGH Knight 5,000
    MPGH Lord 5,500
    MPGH Champion 6,000
    MPGH King 6,500
    MPGH Legend 7,000
    MPGH God 7,500
    MPGH God II 8,000
    MPGH God III 8,500
    MPGH God IV 9,000
    MPGH God V 9,500
    Arun's Slave 10,000
    Dave's Slave 10,500







  4. #4
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by Gasps Its Michael Jackson View Post


    What do you mean SendMessage? I can't find it.
    what about searching on MSDN? If it exists.. it will be there...

    SendMessage
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  5. #5
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    You need to use P/Invoke

    Code:
    <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
    Private Shared Function SendMessage(ByVal Handle As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
    End Function
    If that doesn't work

    Code:
    <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
    Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
    End Function

Similar Threads

  1. [Help] How do you make a textbox show as *? Like for a password box in VB
    By Gasps Its Michael Jackson in forum Programming Tutorials
    Replies: 10
    Last Post: 09-01-2010, 10:06 AM
  2. [HELP] How do you make SendKeys work?
    By Gasps Its Michael Jackson in forum Visual Basic Programming
    Replies: 5
    Last Post: 08-26-2010, 01:41 AM
  3. how do you make weapon mods work?
    By cyeo1 in forum Combat Arms Mod Discussion
    Replies: 2
    Last Post: 07-18-2010, 02:51 PM
  4. [HELP] How would you make a G36E, into a M417 Combat, being that they have differnt m
    By hellohigoodbye in forum Combat Arms Mods & Rez Modding
    Replies: 1
    Last Post: 12-16-2009, 06:01 PM
  5. [Help] How do you get DDD555 aimbot to work with Xfire chams?
    By HAPPYxHACKING in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 07-22-2009, 06:53 PM