• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[c#] How to: Multiboxing

Hannx

New member
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)
 

AlexeWarr

Epic Member
This error:

3479644bb07b4ad8b7e12363e51039ad.jpg

- - - Updated - - -

This error:

ds0ch9


- - - Updated - - -

This error: http://prnt.sc/ds0ch9
 
Top