|
杉浦さん今日は、ひろです。
田楽の話題は、掲示板でなくこちらでもよいでしょうか?
Ver.2.00 で今まで動いていたマクロがまともに動作しません(;_;)。具体
的には、Windows の標準設定で、edit, list, reffilebutton 等多岐にわた
ります。
こちらの環境は、Windows98 ですが、Ver.1.75 にヴァージョン・ダウンし
たら問題ありません。また動かないマクロを末尾に記載しておきます。
P.S Ver.1.7x 系列の最終版をダウンロード可能にしておいて頂けると助か
ります。
//ファイルタイプ別にキーの割り当て、ヘルプファイルなどを変更する。
title "ファイルタイプ別設定拡張マクロ実行中";
$setfile=macrodir+"\\mac_change.ini";
main:
##shift=iskeydown(0x10);
call GetType;
$$type=$$return;
##set=getininum($setfile,$$type,"set");
if((!##set)||##shift)call ConfigExtension $$type;
call Setting $$type;
call SetHilight $$type;
endmacro;
SetHilight:
if(hilighttitle == ""){
if($$1 == "共通")
openreg "CURRENTUSER","Software\\Hidemaruo\\Hidemaru\\Default";
else openreg "CURRENTUSER","Software\\Hidemaruo\\Hidemaru\\Config\\" + $$1;
$$HilightTitle = getregstr("HilightTitle");
closereg;
if($$HilightTitle != "")loadhilight $$HilightTitle,1;
}
else if(hilighttitle != "hilight.tmp" || $$HilightTitle != "hilight.temp")
loadhilight hilighttitle, 1;
return;
GetType:
openreg "CURRENTUSER","Software\\Hidemaruo\\TuruKame\\Config";
if(result){//鶴亀メールの処理
loaddll getregstr("TuruKameDir") + "tkinfo.dll";
if(dllfunc("IsTuruKame")){
##type = dllfunc("MailType");
if(##type == -1){
freedll;
endmacro;
}
else if(##type == 3)$$type = "受信したメール/ログの時";
else if(##type == 4){
openreg "CURRENTUSER","Software\\Hidemaruo\\TuruKame\\Config\\Edit";
if(getregnum("SentViewIsRecvView"))$$type = "受信したメール/ログの時";
else $$type = "送信用メールの時";
closereg;
}
else $$type = "送信用メールの時";
if(getininum($setfile,"受信したメール/ログの時","MacroMenu")){
##main = findwindowclass("TuruKameFrame");
if( ##main ){
if( $$type == "受信したメール/ログの時" && readonly == 1 )
writeregnum "EditMacAssign",1;
else writeregnum "EditMacAssign",0;
#tmp = dllfunc("ExecAt",##main,"EnvChanged");
}
else
message "本体が起動していないので、マクロメニューの変更はできません。";
}
closereg;
}
}
freedll;
if($$type == ""){
openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\" + filetype;
if(result){
$$type=getregstr("");
closereg;
}
else $$type="共通";
}
return $$type;
ConfigExtension:
question "ファイル別の設定しますか?\n「いいえ」で macro 終了。";
if(result){
if(existfile(hidemarudir+"\\DengakuDLL.dll")==false){
message "DLL ファイルがありません。マクロを終了します。";
endmacro;
}
loaddll "DengakuDLL.dll";
if(!result)loaddll hidemarudir+"\\DengakuDLL.dll";
call MakeDialog $$1;
if(##return)call SetConfig,$$1;
else endmacro;
freedll;
return;
}else endmacro;
MakeDialog:
if(!dllfunc("NEWDIALOG",$$1+"の設定",60,""))call Error;
call FileSet $$1,"key ファイル","'key ファイル (*.key)'",100,"K","key";
call FileSet $$1,"外部ヘルプファイル 1","'ヘルプファイル (*.hlp;*.col;*.chm)'
",
101,"1","HelpFile";
call FileSet $$1,"外部ヘルプファイル 2","'ヘルプファイル (*.hlp;*.col;*.chm)'
",
102,"2","HelpFile2";
call FileSet $$1,"外部ヘルプファイル 3","'ヘルプファイル (*.hlp;*.col;*.chm)'
",
103,"3","HelpFile3";
$$set=getinistr($setfile,$$1,"NumWord");
if(!dllfunc("NEWCONTROL","check","NumWord",
"単語の検索で\"abc\"を検索する時、\"abc123\"にはヒットさせない(&W)"))
call Error;
if(!dllfunc("SETCTRLSTATE","",$$set))call Error;
if(!dllfunc("NEWCONTROL","okcancel","",""))call Error;
if(!dllfunc("SHOWDIALOG",hidemaruhandle(0),0))call Error;
while(1){
$$set="";
while(strlen($$set)==0)$$set=dllfuncstr("WAITCTRLNOTIFY",1);
##set=val($$set);//取り敢えずこの変数 ##separate を使う
if(##set<=1)break;
else if(##set==100)call Dialog1 "key";
else if(##set==101)call Dialog2 "HelpFile";
else if(##set==102)call Dialog2 "HelpFile2";
else if(##set==103)call Dialog2 "HelpFile3";
}if(!dllfunc("ENDDIALOG"))call Error;
return ##set;
FileSet:
$$set=getinistr($setfile,$$1,$$6);
openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env";
if($$set=="")$$set=getregstr($$6);
closereg;
if(!dllfunc("NEWCONTROL","text","",$$2))call Error;
if(!dllfunc("SETCTRLWIDTH","",27))call Error;
if(!dllfunc("NEWCONTROL","edit",$$6,$$set))call Error;
if(!dllfunc("SETCTRLWIDTH","",25))call Error;
if(!dllfunc("NEWCONTROL","reffilebutton",$$6+"ref","参照(&"+$$5+")"))
call Error;
if(!dllfunc("SETCTRLNOTIFY","",str(##4)))call Error;
if(!dllfunc("SETCTRLITEM","",""))call Error;
if(!dllfunc("SETCTRLITEM","",hidemarudir))call Error;
if(!dllfunc("SETCTRLITEM","",$$3))call Error;
return;
Dialog1:
$$file=dllfuncstr("GETCTRLSTRING",$$1+"ref");
call RelativePath $$file;
$$file=$$return;
if(!dllfunc("SETCTRLSTRING",$$1,$$file))call Error;
if(!dllfunc("CHANGECTRLITEM",$$1+"ref",$$file,"2"))call Error;
return;
Dialog2:
$$file=dllfuncstr("GETCTRLSTRING",$$1+"ref");
if(!dllfunc("SETCTRLSTRING",$$1,$$file))call Error;
if(!dllfunc("CHANGECTRLITEM",$$1+"ref",$$file,"2"))call Error;
return;
Error:
##tmp=dllfunc("ENDDIALOG");
freedll;
message "DLL 機能の利用が出来ませんでした。\nマクロを終了します。";
endmacro;
RelativePath:
$$path=hidemarudir+"\\";
$$1=dllfuncstr("TOLOWER",$$1);
if(leftstr($$path,3)!=leftstr($$1,3))return $$1;
while(1){
##yen=strstr($$path,"\\")+1;
if((leftstr($$1,##yen)!=leftstr($$path,##yen))||##yen==0)break;
$$path=rightstr($$path,strlen($$path)-##yen);
$$1=rightstr($$1,strlen($$1)-##yen);
}##i=0;
while(1){
##yen=strstr($$path,"\\")+1;
$$path=rightstr($$path,strlen($$path)-##yen);
if(##yen==0)break
##i=##i+1;
}##j=0;
while(##i>##j){
##j=##j+1;
$$1="..\\"+$$1;
}return $$1;
SetConfig:
writeininum $setfile,$$1,"set",1;
call SaveSetting,$$1,"key";
call SaveSetting,$$1,"HelpFile";
call SaveSetting,$$1,"HelpFile2";
call SaveSetting,$$1,"HelpFile3";
$$string=dllfuncstr("GETCTRLSTATE","NumWord");
writeinistr $setfile,$$1,"NumWord", "\"" + $$string + "\"";
if($$1 == "受信したメール/ログの時"){
question
"編集不可に限りマクロメニューに鶴亀独自のものに変更しますか?\n" +
"[いいえ] で、鶴亀の設定を常に変化しない";
if( result )writeininum $setfile,"受信したメール/ログの時","MacroMenu",1;
else writeininum $setfile,"受信したメール/ログの時","MacroMenu",0;
}
return;
SaveSetting:
$$set=dllfuncstr("GETCTRLSTRING",$$2);
writeinistr $setfile,$$1,$$2, "\"" + $$set + "\"";
return;
Setting:
$$string=getinistr($setfile,$$1,"key");
loadkeyassign $$string;
openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env";
call SetString $$1,"HelpFile";
call SetString $$1,"HelpFile2";
call SetString $$1,"HelpFile3";
##num=getininum($setfile,$$1,"NumWord");
writeregnum "NumWord",##num;
envchanged;
closereg;
return;
SetString:
$$string=getinistr($setfile,$$1,$$2);
writeregstr $$2, $$string;
return;
|
|