sharpAHK_505 1.0.0.5
dotnet add package sharpAHK_505 --version 1.0.0.5
NuGet\Install-Package sharpAHK_505 -Version 1.0.0.5
<PackageReference Include="sharpAHK_505" Version="1.0.0.5" />
paket add sharpAHK_505 --version 1.0.0.5
#r "nuget: sharpAHK_505, 1.0.0.5"
// Install sharpAHK_505 as a Cake Addin #addin nuget:?package=sharpAHK_505&version=1.0.0.5 // Install sharpAHK_505 as a Cake Tool #tool nuget:?package=sharpAHK_505&version=1.0.0.5
sharpAHK
modifications
This is the original package at https://github.com/LucidMethod/sharpAHK with some very minor modifications.
At times I've found it necessary to use the AutoHotkey.dll boolean function
ahkReady()
to prevent a host application from "trumping" AHK. The primary use I have for it is basically as follows (C#):
//Load a library or exec scripts in a file
while (ahk.IsReady()==false) {
System.Threading.Thread.Sleep(100);
}
// Included as a precaution and probably superfluous
string filestring = string.Join(Environment.NewLine, filelist);
ahk.SetVar("ouch", filestring);
ahk.LoadFile(ahkFileToLoad, false);
ahk.ExecFunction("StartXL");
//MessageBox.Show("Stop thread"); This would be required
// otherwise to stop the thread.
while (ahk.IsReady()==true) {
System.Threading.Thread.Sleep(100);
}
ahk.Reset();
The following modifications were made to AutoHotkeyEngine.cs:
/// <summary>
/// Determines whether state is "Ready" or not
/// </summary>
/// <param>No parameters</param>
/// <returns>Returns true if the state is "Ready", otherwise false</returns>
public bool IsReady()
{
if (AutoHotkeyDll.ahkReady() == true) {
return true;
}
else {
return false;
}
}
This is more verbose than required, but the compiler optimizes it as follows:
public bool IsReady()
{
return AutoHotkeyDll.ahkReady();
}
The following modifications were made to _AutoHotkey.cs:
/// <summary>
/// Determines whether state is "Ready" or not
/// </summary>
/// <param>No parameters</param>
/// <returns>Returns true if the state is "Ready", otherwise false</returns>
public bool IsReady()
{
//create an autohotkey engine (AHK DLL) or use existing instance if it hasn't been initiated
if (ahkGlobal.ahkdll == null) { New_AHKSession(); }
var ahkdll = ahkGlobal.ahkdll;
bool ready = ahkdll.IsReady();
Log("bool ready (" + ready + ") = ahk.IsReady();");
return ready;
}
This was done as a precaution, and I have not yet found a use for it. There may well be one. If not, I will eventually remove it.
Thanks to LucidMethod for the hard work on the original package.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0.5 | 836 | 8/11/2019 |
SharpAHK V1 Release as modified by burque505