#7077
kshi
参加者

palazzo さん、コメントありがとうございます。
できました!!

ふだんはEmEditorウィンドウを縦幅いっぱいにして
タブを有効にしていますが、別文書を並べて表示したあとは
サイズを元に戻すのが手間でした。

結合したあと元の文書をアクティブにするのは
まだうまく行きませんが、快適になりました。

if (existAnotherWindow(/- EmEditor$/, Window)) {
editor.ExecuteCommandByID(4407); //タブ有効化&ウィンドウ結合
var h = new ActiveXObject(“htmlfile”);
// SetPosition(0, 0, h.Script.screen.availWidth, h.Script.screen.availHeight);
SetPosition(h.Script.screen.availWidth/8, 0,
h.Script.screen.availWidth * 3/4, h.Script.screen.availHeight); // 横幅 3/4
editor.ExecuteCommandByID(5376); //最初の文書をアクティブにする ??
} else {
editor.ExecuteCommandByID(4394); //新しい水平グループ
}

function existAnotherWindow(regExpCaption, wSelf) {
var wnds = new Enumerator(shell.windows);
for( ; !wnds .atEnd(); wnds.moveNext() ){
wnd = wnds.item();
if( wnd.Caption.search(regExpCaption) >= 0) {
if (wnd.Caption != wSelf.Caption) {
return true;
}
}
}
return false;
}