Index: trunk/ab5.0/abdev/abdev/abdev.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/abdev.cpp	(revision 626)
+++ trunk/ab5.0/abdev/abdev/abdev.cpp	(revision 629)
@@ -100,5 +100,5 @@
 	if(!IsWindow(hChild)) return -1;
 	for(i=0;i<MdiInfo.size();i++){
-		if(hChild==MdiInfo[i].hwnd) break;
+		if(hChild==MdiInfo[i]->hwnd) break;
 	}
 	if(i==MdiInfo.size()) i=-1;
@@ -119,5 +119,5 @@
 		projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
 
-		if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0) return i;
+		if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),temporary)==0) return i;
 	}
 	return -1;
@@ -139,13 +139,13 @@
 		if(WndNum==-1) break;
 
-		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){
 			//コントロールタブスペースの幅と行番号の文字数を更新
-			MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace=
-				GetControlTabSpace(WndNum,&MdiInfo[WndNum].pMdiTextEdit->iLineNumberTextCount);
-
-			InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->hEdit,NULL,0);
-			InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,NULL,0);
-
-			SendTextEditResizeEvent(MdiInfo[WndNum].hwnd);
+			MdiInfo[WndNum]->pMdiTextEdit->iWidth_ControlTabSpace=
+				GetControlTabSpace(WndNum,&MdiInfo[WndNum]->pMdiTextEdit->iLineNumberTextCount);
+
+			InvalidateRect(MdiInfo[WndNum]->pMdiTextEdit->hEdit,NULL,0);
+			InvalidateRect(MdiInfo[WndNum]->pMdiTextEdit->pobj_Ruler->hRulerWnd,NULL,0);
+
+			SendTextEditResizeEvent(MdiInfo[WndNum]->hwnd);
 		}
 		else{
@@ -165,9 +165,9 @@
 	WndNum=GetWndNum(hChild);
 	sw=0;
-	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
-		if( MdiInfo[WndNum].pMdiTextEdit->IsModified() ) sw=1;
-	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
-		if(MdiInfo[WndNum].MdiIconEditInfo->bModify) sw=1;
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){
+		if( MdiInfo[WndNum]->pMdiTextEdit->IsModified() ) sw=1;
+	}
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_ICONEDIT){
+		if(MdiInfo[WndNum]->MdiIconEditInfo->bModify) sw=1;
 	}
 
@@ -205,5 +205,5 @@
 	if(WndNum==-1) return;
 	hChild=GetWindow(hChild,GW_CHILD);
-	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){
 		//////////////////////
 		// テキストエディタ
@@ -211,5 +211,5 @@
 
 		//サイズ
-		BufSize=(double)lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer);
+		BufSize=(double)lstrlen(MdiInfo[WndNum]->pMdiTextEdit->buffer);
 		if(IsWindow(hChild)){
 			if(BufSize<1024) sprintf(temporary,"%s: %.0fByte",STRING_SIZE,BufSize);
@@ -231,11 +231,11 @@
 			//日本語
 			sprintf(temporary,"%d 行、%d 列",
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y+1,
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+1);
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y+1,
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x+1);
 #else
 			//英語
 			sprintf(temporary,"%d : %d",
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y+1,
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+1);
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y+1,
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x+1);
 #endif
 		}
@@ -244,21 +244,21 @@
 
 		//文字コード
-		nkf.GetCharCodeName(MdiInfo[WndNum].pMdiTextEdit->iCharCode,temporary);
+		nkf.GetCharCodeName(MdiInfo[WndNum]->pMdiTextEdit->iCharCode,temporary);
 		SendMessage(hStatusBar,SB_SETTEXT,3,(LPARAM)temporary);
 
 		//文字コード
-		nkf.GetLfCodeName(MdiInfo[WndNum].pMdiTextEdit->iLfCode,temporary);
+		nkf.GetLfCodeName(MdiInfo[WndNum]->pMdiTextEdit->iLfCode,temporary);
 		SendMessage(hStatusBar,SB_SETTEXT,4,(LPARAM)temporary);
 	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_RAD){
 		////////////////
 		// RADツール
 		////////////////
 
-		ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[WndNum].path);
+		ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[WndNum]->path);
 		if(RadInfo.NowDragging>=FRAME_CHANGEPOS_START&&RadInfo.NowDragging<=FRAME_CHANGEPOS_END){
 			sprintf(temporary,"pos %d, %d",
-				RadInfo.DraggingRect[0].left-MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
-				RadInfo.DraggingRect[0].top-MdiInfo[WndNum].MdiRadInfo->ClientPos.y);
+				RadInfo.DraggingRect[0].left-MdiInfo[WndNum]->MdiRadInfo->ClientPos.x,
+				RadInfo.DraggingRect[0].top-MdiInfo[WndNum]->MdiRadInfo->ClientPos.y);
 			SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)temporary);
 			sprintf(temporary,"size %d * %d",
@@ -267,5 +267,5 @@
 			SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)temporary);
 		}
-		else if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+		else if(MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
 			SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)"pos 0, 0");
 			sprintf(temporary,"size %d * %d",pWindowInfo->size.cx,pWindowInfo->size.cy);
@@ -274,14 +274,14 @@
 		else{
 			sprintf(temporary,"pos %d, %d",
-				pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->pos.x,
-				pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->pos.y);
+				pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->pos.x,
+				pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->pos.y);
 			SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)temporary);
 			sprintf(temporary,"size %d * %d",
-				pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->size.cx,
-				pWindowInfo->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]]->size.cy);
+				pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->size.cx,
+				pWindowInfo->childWindowInfos[MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]]->size.cy);
 			SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)temporary);
 		}
 	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_MENU){
 		//////////////////
 		// MENU エディタ
@@ -291,5 +291,5 @@
 		SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)"");
 	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_ICONEDIT){
 		//////////////////
 		// ICON エディタ
@@ -314,8 +314,8 @@
 		pobj_StandardToolbar->EnableItem(IDM_REDO,0);
 	}
-	else if(IS_DOCUMENT_TEXT(MdiInfo[i].DocType)){
-		i2=MdiInfo[i].pMdiTextEdit->pTextEditUndoState->NowPos-1;
+	else if(IS_DOCUMENT_TEXT(MdiInfo[i]->DocType)){
+		i2=MdiInfo[i]->pMdiTextEdit->pTextEditUndoState->NowPos-1;
 		if(i2==-1) i2=MAX_UNDONUM-1;
-		if(!MdiInfo[i].pMdiTextEdit->pTextEditUndoState->Command[i2]){
+		if(!MdiInfo[i]->pMdiTextEdit->pTextEditUndoState->Command[i2]){
 			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
 			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
@@ -327,5 +327,5 @@
 			pobj_StandardToolbar->EnableItem(IDM_UNDO,1);
 		}
-		if(!MdiInfo[i].pMdiTextEdit->pTextEditUndoState->Command[MdiInfo[i].pMdiTextEdit->pTextEditUndoState->NowPos]){
+		if(!MdiInfo[i]->pMdiTextEdit->pTextEditUndoState->Command[MdiInfo[i]->pMdiTextEdit->pTextEditUndoState->NowPos]){
 			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
 			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
@@ -338,8 +338,8 @@
 		}
 	}
-	else if(MdiInfo[i].DocType==WNDTYPE_RAD){
-		i2=MdiInfo[i].MdiRadInfo->undo.NowPos-1;
+	else if(MdiInfo[i]->DocType==WNDTYPE_RAD){
+		i2=MdiInfo[i]->MdiRadInfo->undo.NowPos-1;
 		if(i2==-1) i2=MAX_UNDONUM-1;
-		if(!MdiInfo[i].MdiRadInfo->undo.Command[i2]){
+		if(!MdiInfo[i]->MdiRadInfo->undo.Command[i2]){
 			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
 			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
@@ -351,5 +351,5 @@
 			pobj_StandardToolbar->EnableItem(IDM_UNDO,1);
 		}
-		if(!MdiInfo[i].MdiRadInfo->undo.Command[MdiInfo[i].MdiRadInfo->undo.NowPos]){
+		if(!MdiInfo[i]->MdiRadInfo->undo.Command[MdiInfo[i]->MdiRadInfo->undo.NowPos]){
 			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
 			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
@@ -362,5 +362,5 @@
 		}
 	}
-	else if(MdiInfo[i].DocType==WNDTYPE_MENU){
+	else if(MdiInfo[i]->DocType==WNDTYPE_MENU){
 		pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
 		EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
@@ -371,8 +371,8 @@
 		pobj_StandardToolbar->EnableItem(IDM_REDO,0);
 	}
-	else if(MdiInfo[i].DocType==WNDTYPE_ICONEDIT){
-		i2=MdiInfo[i].MdiIconEditInfo->undo[MdiInfo[i].MdiIconEditInfo->SelectIconNum].NowPos-1;
+	else if(MdiInfo[i]->DocType==WNDTYPE_ICONEDIT){
+		i2=MdiInfo[i]->MdiIconEditInfo->undo[MdiInfo[i]->MdiIconEditInfo->SelectIconNum].NowPos-1;
 		if(i2==-1) i2=MAX_ICONEDIT_UNDONUM-1;
-		if(!MdiInfo[i].MdiIconEditInfo->undo[MdiInfo[i].MdiIconEditInfo->SelectIconNum].lpData[i2]){
+		if(!MdiInfo[i]->MdiIconEditInfo->undo[MdiInfo[i]->MdiIconEditInfo->SelectIconNum].lpData[i2]){
 			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
 			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
@@ -384,5 +384,5 @@
 			pobj_StandardToolbar->EnableItem(IDM_UNDO,1);
 		}
-		if(!MdiInfo[i].MdiIconEditInfo->undo[MdiInfo[i].MdiIconEditInfo->SelectIconNum].lpData[MdiInfo[i].MdiIconEditInfo->undo[MdiInfo[i].MdiIconEditInfo->SelectIconNum].NowPos]){
+		if(!MdiInfo[i]->MdiIconEditInfo->undo[MdiInfo[i]->MdiIconEditInfo->SelectIconNum].lpData[MdiInfo[i]->MdiIconEditInfo->undo[MdiInfo[i]->MdiIconEditInfo->SelectIconNum].NowPos]){
 			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
 			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
@@ -454,5 +454,5 @@
 	WndNum=GetWndNum(hChild);
 	if(WndNum==-1) return;
-	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){
 		pobj_MainMenu->EnableItem(IDM_ALLSELECT,MF_BYCOMMAND|MF_ENABLED);
 		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_ENABLED);
@@ -466,6 +466,6 @@
 		hChild=GetWindow(hChild,GW_CHILD);
 		if(!(
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x&&
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y
 			)){
 			MenuMsg=MF_BYCOMMAND|MF_ENABLED;
@@ -502,5 +502,5 @@
 		ResetState_ConvMenu(bConvEnable);
 	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_RAD){
 		//検索、置換、文字カウントを無効化
 		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_GRAYED);
@@ -511,5 +511,5 @@
 		pobj_StandardToolbar->EnableItem(IDM_FIND,0);
 
-		if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+		if(MdiInfo[WndNum]->MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
 			//切り取り、コピー、削除を有効化
 			pobj_MainMenu->EnableItem(IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
@@ -548,5 +548,5 @@
 		ResetState_ConvMenu(0);
 	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_MENU){
 		//検索、置換、文字カウントを無効化
 		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_GRAYED);
@@ -571,5 +571,5 @@
 		ResetState_ConvMenu(0);
 	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_ICONEDIT){
 		//検索、置換、文字カウントを無効化
 		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_GRAYED);
@@ -580,5 +580,5 @@
 		pobj_StandardToolbar->EnableItem(IDM_FIND,0);
 
-		if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==0){
+		if(MdiInfo[WndNum]->MdiIconEditInfo->SelectLevel==0){
 			//切り取り、コピー、削除を無効化
 			pobj_MainMenu->EnableItem(IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
@@ -645,5 +645,5 @@
 	if( WndNum != -1 )
 	{
-		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){
 			pobj_MainMenu->EnableItem(IDM_PAGESET,MF_BYCOMMAND|MF_ENABLED);
 
@@ -726,6 +726,6 @@
 	int i;
 	for(i=0;i<MdiInfo.size();i++){
-		if(MdiInfo[i].hwnd){
-			if(lstrcmpi(MdiInfo[i].title.c_str(),lpszTitle)==0){
+		if(MdiInfo[i]->hwnd){
+			if(lstrcmpi(MdiInfo[i]->title.c_str(),lpszTitle)==0){
 				lstrcat(lpszTitle,"_");
 				DuplicateTitleCheck(lpszTitle);
@@ -735,5 +735,6 @@
 	}
 }
-HWND NewTextEditWindow(char *filepath,_int8 DocumentType,COLORREF TabColor){
+HWND NewTextEditWindow(char *filepath,_int8 DocumentType,COLORREF TabColor)
+{
 	int i;
 	char str[MAX_PATH],str2[32],*buffer;
@@ -746,15 +747,15 @@
 
 		//すでに指定されたファイルが開かれている場合
-		hChild=GetWindow(hClient,GW_CHILD);
+		hChild=::GetWindow(hClient,GW_CHILD);
 		while(hChild){
 			i=GetWndNum(hChild);
-			if(IS_DOCUMENT_TEXT(MdiInfo[i].DocType)){
-				if(lstrcmpi(MdiInfo[i].path.c_str(),filepath)==0) break;
-			}
-			hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+			if(IS_DOCUMENT_TEXT(MdiInfo[i]->DocType)){
+				if(lstrcmpi(MdiInfo[i]->path.c_str(),filepath)==0) break;
+			}
+			hChild=::GetNextWindow(hChild,GW_HWNDNEXT);
 		}
 		if(hChild){
 			//前面に表示して終了
-			BringWindowToTop(hChild);
+			::BringWindowToTop(hChild);
 			return hChild;
 		}
@@ -769,5 +770,5 @@
 		if(hFile==INVALID_HANDLE_VALUE){
 			sprintf(str,STRING_ERROR_CANT_FILEOPEN,filepath);
-			MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			::MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
 			return 0;
 		}
@@ -853,4 +854,5 @@
 	else{
 		buffer=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+		extern int DocumentCounter;
 		DocumentCounter++;
 		sprintf(str,"Document[%d]",DocumentCounter);
@@ -866,7 +868,7 @@
 	mdic.szTitle=str;
 
-	hChild=GetWindow(hClient,GW_CHILD);
-	if(IsWindow(hChild)){
-		if(IsZoomed(hChild)) mdic.style=WS_MAXIMIZE;
+	hChild=::GetWindow(hClient,GW_CHILD);
+	if(::IsWindow(hChild)){
+		if(::IsZoomed(hChild)) mdic.style=WS_MAXIMIZE;
 		else mdic.style=0;
 	}
@@ -883,9 +885,9 @@
 	mdic.lParam=(LPARAM)shfi.hIcon;
 
-	mdic.style|=WS_CLIPCHILDREN;
+	mdic.style |= WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_SYSMENU | WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
 	hChild=(HWND)SendMessage(hClient,WM_MDICREATE,0,(long)&mdic);	//ウィンドウ作成
 
 	//TextEditorコントロールを設置
-	GetClientRect(hChild,&rect);
+	::GetClientRect(hChild,&rect);
 	hEdit=CreateWindow("TextEditor",NULL,
 		WS_CHILD|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE,
@@ -895,40 +897,40 @@
 
 	//ウィンドウのID登録
-	MdiInfo.push_back( MDIINFO() );
+	MdiInfo.push_back( new MDIINFO() );
 	i = MdiInfo.size()-1;
-	MdiInfo[i].hwnd=hChild;
-	MdiInfo[i].DocType=DocumentType;
+	MdiInfo[i]->hwnd=hChild;
+	MdiInfo[i]->DocType=DocumentType;
 	DuplicateTitleCheck(str);
-	MdiInfo[i].title = str;
+	MdiInfo[i]->title = str;
 	if(filepath)
 	{
-		MdiInfo[i].path = filepath;
+		MdiInfo[i]->path = filepath;
 	}
 	else
 	{
-		MdiInfo[i].path = "";
-	}
-
-	MdiInfo[i].pMdiTextEdit = new CMdiTextEdit( &MdiInfo[i] );
-
-	MdiInfo[i].pMdiTextEdit->hEdit=hEdit;
-	MdiInfo[i].pMdiTextEdit->pobj_WebResult=new CWebResult(hChild);
-	MdiInfo[i].pMdiTextEdit->pobj_Ruler=new CRuler(hChild,i);
-	MdiInfo[i].pMdiTextEdit->hIcon=shfi.hIcon;
-	MdiInfo[i].pMdiTextEdit->buffer=buffer;
-	MdiInfo[i].pMdiTextEdit->pColorRef=(COLORREF *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(COLORREF)*lstrlen(buffer));
-	MdiInfo[i].pMdiTextEdit->iUnderStart=-1;
-	MdiInfo[i].pMdiTextEdit->iUnderEnd=-1;
-	MdiInfo[i].pMdiTextEdit->StartCaretPos.x=0;
-	MdiInfo[i].pMdiTextEdit->StartCaretPos.y=0;
-	MdiInfo[i].pMdiTextEdit->EndCaretPos.x=0;
-	MdiInfo[i].pMdiTextEdit->EndCaretPos.y=0;
-	MdiInfo[i].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
-	MdiInfo[i].pMdiTextEdit->bAutoScroll=0;
-	MdiInfo[i].pMdiTextEdit->iWidth_ControlTabSpace=
-		GetControlTabSpace(i,&MdiInfo[i].pMdiTextEdit->iLineNumberTextCount);
-	MdiInfo[i].pMdiTextEdit->iCharCode=iCharCode;
-	MdiInfo[i].pMdiTextEdit->iLfCode=iLfCode;
-	MdiInfo[i].IndentStr=0;
+		MdiInfo[i]->path = "";
+	}
+
+	MdiInfo[i]->pMdiTextEdit = new CMdiTextEdit( MdiInfo[i] );
+
+	MdiInfo[i]->pMdiTextEdit->hEdit=hEdit;
+	MdiInfo[i]->pMdiTextEdit->pobj_WebResult=new CWebResult(hChild);
+	MdiInfo[i]->pMdiTextEdit->pobj_Ruler=new CRuler(hChild,i);
+	MdiInfo[i]->pMdiTextEdit->hIcon=shfi.hIcon;
+	MdiInfo[i]->pMdiTextEdit->buffer=buffer;
+	MdiInfo[i]->pMdiTextEdit->pColorRef=(COLORREF *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(COLORREF)*lstrlen(buffer));
+	MdiInfo[i]->pMdiTextEdit->iUnderStart=-1;
+	MdiInfo[i]->pMdiTextEdit->iUnderEnd=-1;
+	MdiInfo[i]->pMdiTextEdit->StartCaretPos.x=0;
+	MdiInfo[i]->pMdiTextEdit->StartCaretPos.y=0;
+	MdiInfo[i]->pMdiTextEdit->EndCaretPos.x=0;
+	MdiInfo[i]->pMdiTextEdit->EndCaretPos.y=0;
+	MdiInfo[i]->pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+	MdiInfo[i]->pMdiTextEdit->bAutoScroll=0;
+	MdiInfo[i]->pMdiTextEdit->iWidth_ControlTabSpace=
+		GetControlTabSpace(i,&MdiInfo[i]->pMdiTextEdit->iLineNumberTextCount);
+	MdiInfo[i]->pMdiTextEdit->iCharCode=iCharCode;
+	MdiInfo[i]->pMdiTextEdit->iLfCode=iLfCode;
+	MdiInfo[i]->IndentStr=0;
 
 
@@ -944,11 +946,14 @@
 	//Docコンボボックスに追加
 	extern HWND hDocCombo;
-	i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)str);
-	SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+	if( hDocCombo )
+	{
+		i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)str);
+		SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+	}
 
 	//タブに追加
 	pobj_MainTab->InsertItem( str, true, TabColor );
 
-	SetFocus(hEdit);
+	::SetFocus(hEdit);
 	SetStatusText(NULL);
 
@@ -958,5 +963,6 @@
 	if( DocumentType == WNDTYPE_BASIC && !projectInfo.IsOpened() ){
 		// 単体ソースコードを開いたとき
-		if( !IsWindowVisible( hProjectView ) ){
+		extern HWND hProjectView;
+		if( !::IsWindowVisible( hProjectView ) ){
 			// クラスビューを表示する
 			SendMessage(hOwner,WM_COMMAND,IDM_PROJECTVIEW,0);
@@ -973,16 +979,16 @@
 	int i2,i3;
 
-	MdiInfo[WndNum].hwnd=0;
+	MdiInfo[WndNum]->hwnd=0;
 
 	//ドキュメントコンボボックスから文字列を消去
 	extern HWND hDocCombo;
-	i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title.c_str());
+	i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum]->title.c_str());
 	SendMessage(hDocCombo,CB_DELETESTRING,i2,0);
 
 	//タブコントロールからアイテムを消去
-	if(pobj_MainTab) pobj_MainTab->DeleteItem( MdiInfo[WndNum].title.c_str(), true );
-
-
-	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+	if(pobj_MainTab) pobj_MainTab->DeleteItem( MdiInfo[WndNum]->title.c_str(), true );
+
+
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){
 		////////////////////////////
 		// テキストエディタを閉じる
@@ -996,27 +1002,27 @@
 		}
 
-		HeapDefaultFree(MdiInfo[WndNum].pMdiTextEdit->buffer);
-		HeapDefaultFree(MdiInfo[WndNum].pMdiTextEdit->pColorRef);
-
-		if(MdiInfo[WndNum].IndentStr) HeapDefaultFree(MdiInfo[WndNum].IndentStr);
+		HeapDefaultFree(MdiInfo[WndNum]->pMdiTextEdit->buffer);
+		HeapDefaultFree(MdiInfo[WndNum]->pMdiTextEdit->pColorRef);
+
+		if(MdiInfo[WndNum]->IndentStr) HeapDefaultFree(MdiInfo[WndNum]->IndentStr);
 
 		//エディットコントロールを破棄
-		DestroyWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+		DestroyWindow(MdiInfo[WndNum]->pMdiTextEdit->hEdit);
 
 		//Web検索ウィンドウを破棄
-		delete MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult;
-		MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult=0;
+		delete MdiInfo[WndNum]->pMdiTextEdit->pobj_WebResult;
+		MdiInfo[WndNum]->pMdiTextEdit->pobj_WebResult=0;
 
 		//ルーラーウィンドウを破棄
-		delete MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler;
-		MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler=0;
+		delete MdiInfo[WndNum]->pMdiTextEdit->pobj_Ruler;
+		MdiInfo[WndNum]->pMdiTextEdit->pobj_Ruler=0;
 
 		//アイコンを破棄
-		if(MdiInfo[WndNum].pMdiTextEdit->hIcon) DestroyIcon(MdiInfo[WndNum].pMdiTextEdit->hIcon);
-
-		delete MdiInfo[WndNum].pMdiTextEdit;
-		MdiInfo[WndNum].pMdiTextEdit=0;
-	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+		if(MdiInfo[WndNum]->pMdiTextEdit->hIcon) DestroyIcon(MdiInfo[WndNum]->pMdiTextEdit->hIcon);
+
+		delete MdiInfo[WndNum]->pMdiTextEdit;
+		MdiInfo[WndNum]->pMdiTextEdit=0;
+	}
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_RAD){
 		/////////////////////
 		// RADツールを閉じる
@@ -1024,41 +1030,41 @@
 
 		for(i2=0;i2<MAX_UNDONUM;i2++){
-			if(MdiInfo[WndNum].MdiRadInfo->undo.Command[i2])
+			if(MdiInfo[WndNum]->MdiRadInfo->undo.Command[i2])
 				Rad_DeleteUndoData(WndNum,i2);
 		}
-		DestroyWindow(MdiInfo[WndNum].MdiRadInfo->hTools);
-		DestroyWindow(MdiInfo[WndNum].MdiRadInfo->hRad);
-		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,MdiInfo[WndNum].MdiRadInfo->hOldBitmap);
-		DeleteDC(MdiInfo[WndNum].MdiRadInfo->hMemDC);
-		DeleteObject(MdiInfo[WndNum].MdiRadInfo->hBitmap);
-		GlobalFree(MdiInfo[WndNum].MdiRadInfo);
-	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+		DestroyWindow(MdiInfo[WndNum]->MdiRadInfo->hTools);
+		DestroyWindow(MdiInfo[WndNum]->MdiRadInfo->hRad);
+		SelectObject(MdiInfo[WndNum]->MdiRadInfo->hMemDC,MdiInfo[WndNum]->MdiRadInfo->hOldBitmap);
+		DeleteDC(MdiInfo[WndNum]->MdiRadInfo->hMemDC);
+		DeleteObject(MdiInfo[WndNum]->MdiRadInfo->hBitmap);
+		GlobalFree(MdiInfo[WndNum]->MdiRadInfo);
+	}
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_MENU){
 		////////////////////////////
 		// メニューエディタを閉じる
 		////////////////////////////
 
-		DestroyWindow(MdiInfo[WndNum].MdiMenuInfo->hList);
-		GlobalFree(MdiInfo[WndNum].MdiMenuInfo);
-	}
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+		DestroyWindow(MdiInfo[WndNum]->MdiMenuInfo->hList);
+		GlobalFree(MdiInfo[WndNum]->MdiMenuInfo);
+	}
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_ICONEDIT){
 		////////////////////////////
 		// アイコンエディタを閉じる
 		////////////////////////////
 
-		for(i2=0;i2<MdiInfo[WndNum].MdiIconEditInfo->num;i2++){
+		for(i2=0;i2<MdiInfo[WndNum]->MdiIconEditInfo->num;i2++){
 			for(i3=0;i3<MAX_ICONEDIT_UNDONUM;i3++){
-				if(MdiInfo[WndNum].MdiIconEditInfo->undo[i2].lpData[i3])
-					HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo->undo[i2].lpData[i3]);
-			}
-		}
-
-		DeleteDC(MdiInfo[WndNum].MdiIconEditInfo->memdc);
-		DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hMemBmp);
-		DestroyWindow(MdiInfo[WndNum].MdiIconEditInfo->hMain);
-		for(i2=0;i2<MdiInfo[WndNum].MdiIconEditInfo->num;i2++){
-			HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo->pIconImage[i2]);
-		}
-		HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo);
+				if(MdiInfo[WndNum]->MdiIconEditInfo->undo[i2].lpData[i3])
+					HeapDefaultFree(MdiInfo[WndNum]->MdiIconEditInfo->undo[i2].lpData[i3]);
+			}
+		}
+
+		DeleteDC(MdiInfo[WndNum]->MdiIconEditInfo->memdc);
+		DeleteObject(MdiInfo[WndNum]->MdiIconEditInfo->hMemBmp);
+		DestroyWindow(MdiInfo[WndNum]->MdiIconEditInfo->hMain);
+		for(i2=0;i2<MdiInfo[WndNum]->MdiIconEditInfo->num;i2++){
+			HeapDefaultFree(MdiInfo[WndNum]->MdiIconEditInfo->pIconImage[i2]);
+		}
+		HeapDefaultFree(MdiInfo[WndNum]->MdiIconEditInfo);
 	}
 	else
@@ -1067,5 +1073,6 @@
 	}
 
-	Jenga::Common::EraseVectorItem<std::vector<MDIINFO>>( MdiInfo, WndNum );
+	delete MdiInfo[WndNum];
+	Jenga::Common::EraseVectorItem<std::vector<MDIINFO *>>( MdiInfo, WndNum );
 }
 void ResizeTextEditWnd(HWND hwnd,int cx,int cy){
@@ -1082,5 +1089,5 @@
 	if(pobj_nv->bEditor_Ruler){
 		//ルーラー
-		MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->resize(
+		MdiInfo[WndNum]->pMdiTextEdit->pobj_Ruler->resize(
 			0,
 			0,
@@ -1090,14 +1097,14 @@
 		iHeightRuler=HEIGHT_RULER;
 
-		ShowWindow(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,SW_SHOW);
+		ShowWindow(MdiInfo[WndNum]->pMdiTextEdit->pobj_Ruler->hRulerWnd,SW_SHOW);
 	}
 	else{
 		iHeightRuler=0;
 
-		ShowWindow(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,SW_HIDE);
+		ShowWindow(MdiInfo[WndNum]->pMdiTextEdit->pobj_Ruler->hRulerWnd,SW_HIDE);
 	}
 
 	//エディットウィンドウ
-	MoveWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit,
+	MoveWindow(MdiInfo[WndNum]->pMdiTextEdit->hEdit,
 		0,
 		iHeightRuler,
@@ -1107,5 +1114,5 @@
 
 	//Web検索ウィンドウ
-	MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult->resize(
+	MdiInfo[WndNum]->pMdiTextEdit->pobj_WebResult->resize(
 		0,
 		cy-WebResultWndHeight,
@@ -1149,9 +1156,9 @@
 			//ドキュメント セレクト コンボボックス
 			extern HWND hDocCombo;
-			i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i].title.c_str());
+			i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i]->title.c_str());
 			SendMessage(hDocCombo,CB_SETCURSEL,i2,0);
 
 			//タブコントロール
-			pobj_MainTab->MdiActiveEvent(MdiInfo[i].title.c_str());
+			pobj_MainTab->MdiActiveEvent(MdiInfo[i]->title.c_str());
 
 			if( !projectInfo.IsOpened() ){
@@ -1183,146 +1190,4 @@
 	return DefMDIChildProc(hwnd,message,wParam,lParam);
 }
-void ResizeOwnerWnd(void){
-	int width_owner,height_owner;
-	int height_Rebar;
-	int height_MdiClient;
-	RECT rect,StatusRect,RebarRect;
-
-	GetClientRect(hOwner,&rect);
-	width_owner=rect.right;
-	height_owner=rect.bottom;
-
-	//Rebar
-	SendMessage(pobj_Rebar->hRebar,WM_SIZE,0,MAKELONG(width_owner,height_owner));
-	UpdateWindow(pobj_Rebar->hRebar);
-
-	//Status bar
-#define STATUSBAR_PARTS_NUM 5
-	int sb_size[STATUSBAR_PARTS_NUM];
-	sb_size[0]=width_owner-340;
-	sb_size[1]=width_owner-220;
-	sb_size[2]=width_owner-120;
-	sb_size[3]=width_owner-50;
-	sb_size[4]=width_owner;
-	SendMessage(hStatusBar,SB_SETPARTS,STATUSBAR_PARTS_NUM,(LPARAM)sb_size);
-	SendMessage(hStatusBar,WM_SIZE,0,MAKELONG(width_owner,height_owner));
-	UpdateWindow(hStatusBar);
-
-	//Status bar
-	int height_Statusbar;
-	SendMessage(hStatusBar,SB_GETRECT,0,(long)&StatusRect);
-	height_Statusbar=StatusRect.bottom;
-
-	GetWindowRect(pobj_Rebar->hRebar,&RebarRect);
-	height_Rebar=RebarRect.bottom-RebarRect.top+2;
-
-	int height_dv;	//Width of Debugger View
-	int height_cv;	//Width of Compiler View
-	height_dv=0;
-	height_cv=0;
-#ifndef THETEXT
-	if(bClipCompileView){
-		if(pobj_Debugger->IsDebuggerView()){
-			//デバッガビューが表示されているとき
-			height_dv=pobj_nv->height_ClipDebuggerView+LEVER_THICK;
-		}
-		if(hCompileView){
-			//コンパイラビューが表示されているとき
-			height_cv=pobj_nv->height_ClipCompileView+LEVER_THICK;
-		}
-	}
-#endif
-
-	int width_pjv=0;	//Width of Project View
-	if(pobj_nv->bClipProjectView){
-		if(IsWindowVisible(hProjectView)){
-			//プロジェクトビューが表示されているとき
-			width_pjv=pobj_nv->width_ClipProjectView+LEVER_THICK;
-		}
-	}
-
-	int width_SideWeb=0;
-	if( pobj_SideWeb )
-	{
-		if(pobj_SideWeb->bShow){
-			width_SideWeb=pobj_nv->width_WebSearchView+LEVER_THICK;
-		}
-	}
-
-	//MDIクライアントの高さ
-	height_MdiClient=height_owner-(
-		height_Rebar+
-		height_dv+
-		height_cv+
-		height_Statusbar
-		);
-
-	//タブコントロール
-	int tab_height;
-	if(TabCtrl_GetItemCount(pobj_MainTab->hTab)==0) tab_height=0;
-	else{
-		RECT rc;
-		TabCtrl_GetItemRect(pobj_MainTab->hTab,0,&rc);
-		tab_height=rc.bottom-rc.top;
-	}
-	MoveWindow(pobj_MainTab->hTab,
-		width_pjv,
-		height_Rebar,
-		width_owner-width_pjv-width_SideWeb,
-		tab_height,
-		1);
-
-	//MDIクライアント
-	MoveWindow(hClient,
-		width_pjv,
-		height_Rebar+tab_height,
-		width_owner-width_pjv-width_SideWeb,
-		height_MdiClient-tab_height,
-		1);
-
-	if( pobj_SideWeb )
-	{
-		if(pobj_SideWeb->bShow){
-			//SideWeb
-			pobj_SideWeb->resize(
-				width_owner - pobj_nv->width_WebSearchView,
-				height_Rebar,
-				pobj_nv->width_WebSearchView,
-				height_MdiClient);
-		}
-		else pobj_SideWeb->resize(0,0,0,0);
-	}
-
-	if(width_pjv){
-		//プロジェクトビュー
-		MoveWindow(hProjectView,
-			0,
-			height_Rebar,
-			pobj_nv->width_ClipProjectView,
-			height_MdiClient,
-			1);
-		InvalidateRect(hProjectView,NULL,0);
-	}
-
-	if(height_dv){
-#ifndef THETEXT
-		//デバッガビュー
-		pobj_Debugger->resize(
-			0,
-			height_Rebar+height_MdiClient+LEVER_THICK,
-			width_owner,
-			pobj_nv->height_ClipDebuggerView);
-#endif
-	}
-	if(height_cv){
-		//コンパイラビュー
-		MoveWindow(hCompileView,
-			0,
-			height_Rebar+height_MdiClient+height_dv+LEVER_THICK,
-			width_owner,
-			pobj_nv->height_ClipCompileView,
-			1);
-	}
-}
 
 WNDPROC oldMainFrameWndProc;
@@ -1353,5 +1218,5 @@
 			//コンパイラウィンドウ（埋め込み型）が表示されたとき
 			hCompileView=(HWND)lParam;
-			ResizeOwnerWnd();
+			ActiveBasic::IDE::Program::mainFrame.Resized();
 			return 0;
 		case WM_DESTROYCOMPILEVIEW:
@@ -1365,5 +1230,5 @@
 				hCompileView=0;
 				
-				ResizeOwnerWnd();
+				ActiveBasic::IDE::Program::mainFrame.Resized();
 			}
 			return 0;
@@ -1389,16 +1254,12 @@
 			//デバッガウィンドウ（埋め込み型）が表示されたとき
 			pobj_Debugger->watch_start((HWND)lParam);
-			ResizeOwnerWnd();
+			ActiveBasic::IDE::Program::mainFrame.Resized();
 			return 0;
 		case WM_DESTROYDEBUGGERVIEW:
 			//デバッガウィンドウ（埋め込み型）が破棄されたとき
 			pobj_Debugger->watch_quit();
-			ResizeOwnerWnd();
+			ActiveBasic::IDE::Program::mainFrame.Resized();
 			return 0;
 #endif
-
-		case WM_SIZE:
-			ResizeOwnerWnd();
-			return 0;
 
 
@@ -1442,5 +1303,5 @@
 				}
 
-				ResizeOwnerWnd();
+				ActiveBasic::IDE::Program::mainFrame.Resized();
 				UpdateWindow(hwnd);
 			}
@@ -1717,6 +1578,6 @@
 			if( projectInfo.IsOpened() ){
 				for(i=0,i2=0;i<MdiInfo.size();i++){
-					if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){
-						if(IsDialogMessage(MdiInfo[i].MdiRadInfo->hProp_Dlg,&msg)) i2=1;
+					if(MdiInfo[i]->hwnd&&MdiInfo[i]->DocType==WNDTYPE_RAD){
+						if(IsDialogMessage(MdiInfo[i]->MdiRadInfo->hProp_Dlg,&msg)) i2=1;
 					}
 				}
