User Tag List

Results 1 to 2 of 2

Thread: [c#] How to: Multiboxing

  1. #1
    Lurking Member Hannx's Avatar
    Join Date
    Nov 2016
    Location
    Poznań
    Posts
    3
    XP
    113
    Level
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile [c#] How to: Multiboxing

    1. Make new class:
    Code:
    	public static class MyButton
    	{
    		[DllImport("user32.dll")]
    		public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
    		
    		public static void Down(int k,List<IntPtr> ptrs)
    		{
    			const uint WM_KEYDOWN = 0x100;
    			
    			foreach (var ptr in ptrs)
    				SendMessage(ptr, WM_KEYDOWN, ((IntPtr)k), (IntPtr)0);
    		}
    
    		internal static void Up(int keyValue, List<IntPtr> ptrs)
    		{
    			const int WM_KEYUP = 0x101;
    
    			foreach (var ptr in ptrs)
    				SendMessage(ptr, WM_KEYUP, ((IntPtr)keyValue), (IntPtr)0);
    		}
    	}
    2. Create simple form, with 2x button and 1 text edit.
    2.1 First button:
    Code:
    		private string _path;
    
    		private void button1_Click(object sender, EventArgs e)
    		{
    
    				var openFileDialog = new OpenFileDialog();
    				openFileDialog.Filter = "Exek WoWa|Wow.exe";
    				openFileDialog.Multiselect = false;
    
    				if (openFileDialog.ShowDialog() == DialogResult.OK)
    				{
    					_path = openFileDialog.FileName;
    				}
    		}
    2.2 Next button:
    Code:
    		private List<IntPtr> _ptr;
    
    		private void button2_Click(object sender, EventArgs e)
    		{
    			Process p = Process.Start(_path);
    			p.WaitForInputIdle();
    			IntPtr h = p.MainWindowHandle;
    			_ptr.Add(h);
    
    		}
    2.3 Textbox with 2 events:
    Code:
    		private void textBox1_KeyDown(object sender, KeyEventArgs e)
    		{
    			MyButton.Down(e.KeyValue, _ptr);
    		}
    
    		private void textBox1_KeyUp(object sender, KeyEventArgs e)
    		{
    			MyButton.Up(e.KeyValue, _ptr);
    		}
    3. Renember to init List<IntPtr> _ptr ;)

    ---------
    Let's play:
    Click button1 and select your WoW.exe.
    Click button2 to run WoW.exe (1 click == 1 wow)
    Click on TextBox and enjoy ;) (without tab and arrows)

  2. #2
    Epic Member <span style='color: #9400D3'><span class='glow_000000'>AlexeWarr</span></span>'s Avatar
    Join Date
    Apr 2013
    Location
    Romania
    Posts
    324
    XP
    6,622
    Level
    24
    Thanks
    46
    Thanked 107 Times in 46 Posts
    This error:

    3479644bb07b4ad8b7e12363e51039ad.jpg

    - - - Updated - - -

    This error:



    - - - Updated - - -

    This error: http://prnt.sc/ds0ch9
    Awards:
    Repacker Scripter
    Epic win LoL


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •