|
How would I do this? I have limited C# experience and I know how to use SendKeys command Here is some sample code of what im trying to do but I cant get it to work.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO;
namespace Macro { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void ButtonIsPressed(KeyPressEventArgs keypress) { KeyPreview = true;// just figured I might need this for some reason /*Removed in case of was causing problems if (checkBox1.Checked && keypress.KeyChar.Equals(Keys.W)) { //My SendKeys here } */ if (keypress.KeyChar.Equals(Keys.W))//Right here is the problem I believe... { SendKeys.SendWait("H"); SendKeys.SendWait("o"); SendKeys.SendWait("w"); SendKeys.SendWait(" "); SendKeys.SendWait("T"); SendKeys.SendWait("o"); SendKeys.SendWait(" "); SendKeys.SendWait("D"); SendKeys.SendWait("o"); SendKeys.SendWait(" "); SendKeys.SendWait("T"); SendKeys.SendWait("h"); SendKeys.SendWait("i"); SendKeys.SendWait("s"); SendKeys.SendWait("?"); }
} } }
|