|
haruさん、こんにちは。
> 以前教えていただいた記録用マクロを使用させていただいています。
> フォルダ毎にソート方法も記録しておいて、復元したいのですが。
これでいけると思います。
// 記録用マクロ
// GetFolderStatus.mac
loaddll "TKinfo.dll";
openreg "CURRENTUSER", "Software\\Hidemaruo\\TuruKame\\Config";
#flag = getregnum("AutoSelectUnread");
if (#flag && 3) {
writeregnum "AutoSelectUnread", 0;
closereg;
#n = dllfunc("EnvChanged");
} else {
closereg;
}
#n = dllfunc("DisableDraw", 1);
$ini = macrodir + "\\FOLDERS.INI";
$key = "Folders";
writeinistr $ini, $key, 0, 0;
$account = dllfuncstr("CurrentAccount");
$folder = dllfuncstr("CurrentFolder");
writeinistr $ini, $key, "account", $account;
writeinistr $ini, $key, "folder", $folder;
#i = 0;
#n = dllfunc("SelectFolder", dllfuncstr("Account", 0), "");
$a = dllfuncstr("CurrentAccount");
$f = dllfuncstr("CurrentFolder");
while ($a != "") {
#p = dllfunc("GetFolderExpandState", $a, $f);
#n = dllfunc("SelectFolder", $a, $f);
#v = dllfunc("ViewArea");
#t = dllfunc("IsThreadView");
#s = dllfunc("SortMethod");
writeinistr $ini, $key, str(#i), $a;
writeinistr $ini, $key, str(#i + 1), $f;
writeininum $ini, $key, str(#i + 2), (#s + 1) * 128 + (#t + 1) * 32 + (#
v + 1) * 4 + #p;
#i = #i + 3;
$s = dllfuncstr("GetNextFolder", $a, $f);
#x = strstr( $s, "\\");
if (#x >= 0) {
$a = leftstr($s, #x);
$f = midstr($s, #x + 1, 256);
} else {
$a = $s;
$f = "";
}
}
writeininum $ini, $key, "number", #i - 1;
execmacro "SetFolderStatus.mac";
if (#flag && 3) {
openreg "CURRENTUSER", "Software\\Hidemaruo\\TuruKame\\Config";
writeregnum "AutoSelectUnread", #flag;
closereg;
#n = dllfunc("EnvChanged");
}
#n = dllfunc("EnableDraw");
// 復元用マクロ
// SetFolderStatus.mac
loaddll "TKinfo.dll";
openreg "CURRENTUSER", "Software\\Hidemaruo\\TuruKame\\Config";
#flag = getregnum("AutoSelectUnread");
if (#flag && 3) {
writeregnum "AutoSelectUnread", 0;
closereg;
#n = dllfunc("EnvChanged");
} else {
closereg;
}
#n = dllfunc("DisableDraw", 1);
$ini = macrodir + "\\FOLDERS.INI";
$key = "Folders";
#i = getininum($ini, $key, "number");
while (#i > 0) {
$a = getinistr($ini, $key, str(#i - 2));
$f = getinistr($ini, $key, str(#i - 1));
#p = getininum($ini, $key, str(#i));
#s = (#p / 128) & 31;
#v = (#p / 4) & 7;
#t = (#p / 32) & 3;
#p = #p & 3;
#n = dllfunc("SelectFolder", $a, $f);
if (#p < 2) #n = dllfunc("ExpandFolder", #p);
if (#v) #n = dllfunc("SetViewArea", #v - 1);
if (#t) #n = dllfunc("SetThreadView", #t - 1);
if (#s) #n = dllfunc("SetSortMethod", #s - 1);
#i = #i - 3;
}
$account = getinistr($ini, $key, "account");
$folder = getinistr($ini, $key, "folder");
#n = dllfunc("SelectFolder", $account, $folder);
if (#flag && 3) {
openreg "CURRENTUSER", "Software\\Hidemaruo\\TuruKame\\Config";
writeregnum "AutoSelectUnread", #flag;
closereg;
#n = dllfunc("EnvChanged");
}
#n = dllfunc("EnableDraw");
|
|