English help on website



Hidemaru_SetStaticVariable(Ver9.30対応版)
目次DLL側から秀丸エディタの関数呼び出し− Hidemaru_SetStaticVariable
Hidemaru_SetStaticVariable関数
BOOL WINAPI Hidemaru_SetStaticVariable( const WCHAR* pwszKey, const WCHAR* pwszValue, int nType );

setstaticvariableに相当する文字列値を設定します。(V9.15以降)
成功したときは0以外、失敗したときは0を返します。

例:マクロ側
loaddll @"C:\Folder\Test.dll";
#a = dllfunc("DllFuncTest",hidemaruhandle(0));
message getstaticvariable("hoge",0);
endmacro;

例:DLL側
#include <windows.h>

extern "C" __declspec( dllexport )
INT_PTR _cdecl DllFuncTest( INT_PTR nHwnd ) {
    HINSTANCE hinstExe = GetModuleHandle( NULL );
    BOOL (WINAPI* pfnHidemaru_SetStaticVariable)( const WCHAR*, const WCHAR*, int );
    (FARPROC&)pfnHidemaru_SetStaticVariable = GetProcAddress( hinstExe, "Hidemaru_SetStaticVariable" );
    
    if( pfnHidemaru_SetStaticVariable ) {
        BOOL f = pfnHidemaru_SetStaticVariable( L"hoge",L"DLLでセット",0);
    }
    return 0;
}


参照:
setstaticvariable
Hidemaru_SetStaticVariable
hidemaru.setStaticVariable