Simulate keystrokes (C# or Vb.Net)? menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    Micha01's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simulate keystrokes (C# or Vb.Net)?

    Hi all,

    how can I Simulate keystrokes for Warhammer Online (C / C++ / C# / VB.Net) ?


    I found this Code in C++:


    Code:
    	INPUT input;
    	memset(&input,0,sizeof(INPUT));
    	input.type=INPUT_KEYBOARD;
    	input.ki.wScan =0x0402; 
    	input.ki.dwFlags=0;
    	SendInput(1,&input,sizeof(INPUT));
    
    	return 0;

    but doesnt work.

    I found this Code in Vb.Net:

    Code:
    Option Explicit Off
    
    Public Class Form1
    
    
        Private Declare Function SendInput Lib "user32.dll" (ByVal cInputs As Long, ByRef pInputs As MyInput, ByVal cbSize As Long) As Long
    
        Private Structure KEYBDINPUT
            Dim wVk As Integer
            Dim wScan As Long
            Dim dwFlags As Long
            Dim time As Long
            Dim dwExtraInfo As Long
            Dim unused1 As Long
            Dim unused2 As Long
        End Structure
    
        Private Structure MyInput
            Dim Type As Long
            Dim ki As KEYBDINPUT
        End Structure
    
        Private Const KEYEVENTF_KEYUP As Long = &H2
        Private Const INPUT_KEYBOARD As Long = 1
        Private Const DIKEYBOARD_1 As Long = &H402 '0x0402
    
    
        Private Sub Form_Load()
    
            Dim inp As MyInput
    
            inp.Type = INPUT_KEYBOARD
            inp.ki.wScan = DIKEYBOARD_1
            If Not press_key Then
                inp.ki.dwFlags = KEYEVENTF_KEYUP
            End If
    
         SendInput(1, inp, Len(inp))
    
        End Sub
    End Class
    but doesnt work.

    Simulate keystrokes (C# or Vb.Net)?
  2. #2
    Moutney's Avatar Member
    Reputation
    4
    Join Date
    Jan 2008
    Posts
    18
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if its not necissary to be C / C++ / C# / VB.Net. you can use AutoIt, really easy to set up, and you can make really complicated macros with it.

  3. #3
    Micha01's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will not use AutoIt - I will use Vb.Net.

    But Thanks

  4. #4
    Moutney's Avatar Member
    Reputation
    4
    Join Date
    Jan 2008
    Posts
    18
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how its better in doing a bot(i suppose thats what your trying to do)
    Last edited by Moutney; 11-02-2008 at 09:53 AM.

  5. #5
    Micha01's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found this Code:

    Code:
        Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    
        Private Const KEYBOARD_1 As Byte = &H31
        Private Const KEYEVENTF_KEYUP As Byte = &H2
    
        Public Sub KeySend()
    
            'Taste drücken
            keybd_event(KEYBOARD_1, 0, 0, 0)
            'Taste loslassen
            keybd_event(KEYBOARD_1, 0, KEYEVENTF_KEYUP, 0)
    
        End Sub
    but doesnt work.

  6. #6
    Micha01's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    I found this Code:

    Code:
    Private Declare Function GetForegroundWindow Lib "user32" () As Long
    
        Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
    
        Public Sub KeySend()
    
    
            Dim hwnd As Long = GetForegroundWindow
    
            SendMessage(hwnd, &H100, &H31, 0)
            SendMessage(hwnd, &H101, &H31, 0)
    
        End Sub
    but doesnt work.

    Someone an idea?

  7. #7
    ntldr's Avatar Member
    Reputation
    1
    Join Date
    Sep 2008
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moutney already pointed out that AutoIt will be your best bet. If you're too hard nosed to give it a try (from the sound of your posts you are) then you may be out of luck.

    It doesn't sound like you have a lot of programming experience based on your googling of other peoples' code. This again would lead me to suggest AutoIt as well. Super easy to set up.

    But alas you probably will disregard any advice we're giving you.

Similar Threads

  1. hijack net-op teacher
    By WoWLegend in forum Community Chat
    Replies: 9
    Last Post: 03-08-2007, 03:15 PM
  2. Wowhints.net guide
    By warlord251 in forum World of Warcraft General
    Replies: 1
    Last Post: 01-30-2007, 11:25 AM
  3. BEWARE of KEYLOGGERS on WORLDOFWAR.NET TEMPORARILY!
    By agrestic in forum World of Warcraft General
    Replies: 4
    Last Post: 12-22-2006, 03:00 AM
  4. about "worldofwarcraftgoldhack.net"
    By KuRIoS in forum World of Warcraft General
    Replies: 6
    Last Post: 12-17-2006, 12:09 AM
  5. Anyone playing Starcraft Broodwar battle net.?
    By Datonking in forum Gaming Chat
    Replies: 7
    Last Post: 09-13-2006, 08:18 AM
All times are GMT -5. The time now is 03:35 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search