• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Send keys like Num0 to the game

    Discussion in 'Community Developer Forum' started by dark wolf, Mar 18, 2015.

    1. dark wolf

      dark wolf New Member

      Joined:
      Mar 11, 2015
      Messages:
      95
      Likes Received:
      2
      Trophy Points:
      0
      Is ther a api for it? i could not find anything in the forum or the Documentation.
      Did I miss it ?
      Thanks
       
    2. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      No, you'll have to hook into user32.dll and into the process

      Code:
                  [DllImport("user32.dll")]
                  public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
      
      Code:
                      const uint WM_KEYDOWN = 0x100;
                      const uint WM_KEYUP = 0x0101;
                      IntPtr edit = Core.Memory.Process.MainWindowHandle;
      
                      PostMessage(edit, WM_KEYDOWN, (IntPtr)(Keys.NumPad0), IntPtr.Zero);
                      PostMessage(edit, WM_KEYUP, (IntPtr)(Keys.NumPad0), IntPtr.Zero);
      
      something like that.
       

    Share This Page