Example #1
0
        // 秀丸本体のExport関数を使えるようにポインタ設定。
        static void SetUnManagedDll()
        {
            // OutputDebugStream(version.ToString());
            if (version >= 866)
            {
                // 初めての代入のみ
                if (hmExeHandle == null)
                {
                    hmExeHandle = new UnManagedDll(strExecuteFullpath);

                    pGetTotalTextUnicode    = hmExeHandle.GetProcDelegate <TGetTotalTextUnicode>("Hidemaru_GetTotalTextUnicode");
                    pGetLineTextUnicode     = hmExeHandle.GetProcDelegate <TGetLineTextUnicode>("Hidemaru_GetLineTextUnicode");
                    pGetSelectedTextUnicode = hmExeHandle.GetProcDelegate <TGetSelectedTextUnicode>("Hidemaru_GetSelectedTextUnicode");
                    pGetCursorPosUnicode    = hmExeHandle.GetProcDelegate <TGetCursorPosUnicode>("Hidemaru_GetCursorPosUnicode");
                    pEvalMacro        = hmExeHandle.GetProcDelegate <TEvalMacro>("Hidemaru_EvalMacro");
                    pCheckQueueStatus = hmExeHandle.GetProcDelegate <TCheckQueueStatus>("Hidemaru_CheckQueueStatus");

                    if (version >= 873)
                    {
                        pGetCursorPosUnicodeFromMousePos = hmExeHandle.GetProcDelegate <TGetCursorPosUnicodeFromMousePos>("Hidemaru_GetCursorPosUnicodeFromMousePos");
                        pGetCurrentWindowHandle          = hmExeHandle.GetProcDelegate <TGetCurrentWindowHandle>("Hidemaru_GetCurrentWindowHandle");
                    }
                }
            }
        }
        static void SetUnManagedDll()
        {
            InitVersion();

            // ver 8.6.6以上が対象
            if (_ver >= 866)
            {
                // 初めての代入のみ
                if (hmExeHandle == null)
                {
                    hmExeHandle             = new UnManagedDll(strExecuteFullpath);
                    pGetTotalTextUnicode    = hmExeHandle.GetProcDelegate <TGetTotalTextUnicode>("Hidemaru_GetTotalTextUnicode");
                    pGetLineTextUnicode     = hmExeHandle.GetProcDelegate <TGetLineTextUnicode>("Hidemaru_GetLineTextUnicode");
                    pGetSelectedTextUnicode = hmExeHandle.GetProcDelegate <TGetSelectedTextUnicode>("Hidemaru_GetSelectedTextUnicode");
                    pGetCursorPosUnicode    = hmExeHandle.GetProcDelegate <TGetCursorPosUnicode>("Hidemaru_GetCursorPosUnicode");
                    pEvalMacro        = hmExeHandle.GetProcDelegate <TEvalMacro>("Hidemaru_EvalMacro");
                    pCheckQueueStatus = hmExeHandle.GetProcDelegate <TCheckQueueStatus>("Hidemaru_CheckQueueStatus");

                    if (_ver >= 873)
                    {
                        pGetCursorPosUnicodeFromMousePos = hmExeHandle.GetProcDelegate <TGetCursorPosUnicodeFromMousePos>("Hidemaru_GetCursorPosUnicodeFromMousePos");
                    }
                }
            }
        }