sharpAHK_505 1.0.0.5

AutoHotkey for C#

Install-Package sharpAHK_505 -Version 1.0.0.5
dotnet add package sharpAHK_505 --version 1.0.0.5
<PackageReference Include="sharpAHK_505" Version="1.0.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add sharpAHK_505 --version 1.0.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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.

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.

Release Notes

SharpAHK V1 Release as modified by burque505

Dependencies

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 History

Version Downloads Last updated
1.0.0.5 228 8/11/2019