c# Send key to Gw2 to move characters menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Ancitique's Avatar
    Ancitique
    Guest

    c# Send key to Gw2 to move characters

    Hi !

    I'am new on this forum and i'am here to learn and share my knowlegde to other members.

    I want to send key to GW2.exe to do a simple farm bot or anti afk kick. So i want to send Z en S to GW2 in c# i had read that gw2 use directinput but i don't find how to do this with SendInput. Can anybody help me please ?

    Thanks a lot

    c# Send key to Gw2 to move characters
  2. #2
    Ploxasarus's Avatar Active Member
    Reputation
    75
    Join Date
    Oct 2012
    Posts
    105
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PostMessage works fine.

    Code:
            [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
            [DllImport("user32.dll", SetLastError = true)]
            private static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
    
    
            private void Move_Tick(object sender, EventArgs e)
            {
                const int WM_KEYDOWN = 0x100;
                const int WM_KEYUP = 0x101;
    
                IntPtr hWnd = FindWindow(null, "Guild Wars 2");
    
                PostMessage(hWnd, WM_KEYDOWN, 0x26, 0x11480001);
                Thread.Sleep(100);
                PostMessage(hWnd, WM_KEYUP, 0x26, 0x11480001);
            }
    This is just an example as this only does W, but it does work ( even downsized ).

  3. Thanks andrewfam (1 members gave Thanks to Ploxasarus for this useful post)
  4. #3
    andrewfam's Avatar Member
    Reputation
    1
    Join Date
    Feb 2010
    Posts
    1
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ploxasarus View Post
    PostMessage works fine.

    Code:
            [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
            [DllImport("user32.dll", SetLastError = true)]
            private static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
    
    
            private void Move_Tick(object sender, EventArgs e)
            {
                const int WM_KEYDOWN = 0x100;
                const int WM_KEYUP = 0x101;
    
                IntPtr hWnd = FindWindow(null, "Guild Wars 2");
    
                PostMessage(hWnd, WM_KEYDOWN, 0x26, 0x11480001);
                Thread.Sleep(100);
                PostMessage(hWnd, WM_KEYUP, 0x26, 0x11480001);
            }
    This is just an example as this only does W, but it does work ( even downsized ).
    I'm digging up an old thread here because this method is still working today.
    Can someone please explain to me what the hex value 0x11480001 stand for? If I change this value to something else the function is no longer work.
    On the other hand, if I change 0x26 (up arrow key) to something else the function still work as expected.
    Thanks,

Similar Threads

  1. Sending Keys in C# to GW2
    By RazorDreamz in forum GW2 Bots and Programs
    Replies: 8
    Last Post: 09-09-2012, 04:47 PM
  2. Freebie method for sending keys to multiple WoW windows
    By tomit12 in forum World of Warcraft Guides
    Replies: 6
    Last Post: 03-03-2008, 10:49 AM
  3. Move characters to a different account
    By Mrstalks in forum World of Warcraft Exploits
    Replies: 14
    Last Post: 01-08-2008, 01:29 AM
  4. [move characters]idea!
    By ownpeer in forum WoW Scam Prevention
    Replies: 5
    Last Post: 01-07-2008, 05:05 PM
  5. Move Character
    By htolife in forum World of Warcraft General
    Replies: 2
    Last Post: 10-15-2007, 03:43 PM
All times are GMT -5. The time now is 06:46 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search