Convert Autohotkey script to C# or VB6

Asked

Viewed 129 times

-1

I would like to convert the following script done with AutoHokey:

DllCall("shdocvw\SetShellOfflineState", "int", False)

With that script I can "take" the Internet Explorer in the way offline without user intervention. This procedure is necessary because when the IE is offline causes error in a third party component I am using.

Other suggestions for the execution of the procedure are also welcome.

1 answer

2


Use the Autohotkey.Interop to work on C#.

The code goes something like this:

public class AutoHotKey
{
    private readonly AutoHotkeyEngine _ahkEgine = new AutoHotkeyEngine();
    private const string comando = @"DllCall(""shdocvw\SetShellOfflineState"", ""int"", False)"; //aqui fica o script.

    public AutoHotKey()
    {
        _ahkEngine.ExecRaw(comando);
    }
}

You also have this link, which demonstrates how to use in WPF, and some more complete examples.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.