Index: trunk/ab5.0/abdev/abdev/TextEditor_KeyEvent.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/TextEditor_KeyEvent.cpp	(revision 625)
+++ trunk/ab5.0/abdev/abdev/TextEditor_KeyEvent.cpp	(revision 629)
@@ -14,8 +14,8 @@
 		WndNum=GetWndNum(GetParent(hwnd));
 
-		if(MdiInfo[WndNum].pMdiTextEdit->iUnderStart!=-1){
+		if(MdiInfo[WndNum]->pMdiTextEdit->iUnderStart!=-1){
 			//ハイパーリンク下線の表示を解除
-			MdiInfo[WndNum].pMdiTextEdit->iUnderStart=-1;
-			MdiInfo[WndNum].pMdiTextEdit->iUnderEnd=-1;
+			MdiInfo[WndNum]->pMdiTextEdit->iUnderStart=-1;
+			MdiInfo[WndNum]->pMdiTextEdit->iUnderEnd=-1;
 
 			//再描画
@@ -159,5 +159,5 @@
 	char *pBuf;
 
-	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 	for(i=iPos;i>0;i--){
 		if(pBuf[i-1]=='\r'&&pBuf[i]=='\n') return i+1;
@@ -242,10 +242,10 @@
 			hide_caret_switch=1;
 
-			if(MdiInfo[WndNum].IndentStr){
+			if(MdiInfo[WndNum]->IndentStr){
 				//以前の自動インデントを消去する
 				CancelBeforeAutoIndent(WndNum);
 			}
 
-			pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+			pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 			int StartX;
@@ -253,11 +253,11 @@
 			//リプレイス前のカーソルバッファ位置を取得
 			i=GetBufferIndexFromCaretPos(pBuf,
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
-			StartX=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x,
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y);
+			StartX=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x;
 
 			//リプレイス
 			TextEdit_ReplaceUpdateUndoData(WndNum,temporary,0,1);
-			pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+			pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 			//リプレイス後のカーソル行のインデントをi3に取得
@@ -281,5 +281,5 @@
 			}
 
-			if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC){
+			if(MdiInfo[WndNum]->DocType==WNDTYPE_BASIC){
 				//インデント追加のコマンドかどうかを判断
 				if(IsIndentAdditionCommand_FromBuffer(pBuf+i+i2)) i2++;
@@ -302,13 +302,13 @@
 			*/
 			i=GetBufferIndexFromCaretPos(pBuf,
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x,
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y);
 			if(pBuf[i]=='\r'&&
 				pBuf[i+1]=='\n'){
 				//自動インデントを開始する（「\t\tⅠ」のような場合）
-				MdiInfo[WndNum].IndentStr=(char *)HeapAlloc(hHeap,0,i2+1);
-				memset(MdiInfo[WndNum].IndentStr,'\t',i2);
-				MdiInfo[WndNum].IndentStr[i2]=0;
-				TextEdit_Replace(WndNum,MdiInfo[WndNum].IndentStr,1);
+				MdiInfo[WndNum]->IndentStr=(char *)HeapAlloc(hHeap,0,i2+1);
+				memset(MdiInfo[WndNum]->IndentStr,'\t',i2);
+				MdiInfo[WndNum]->IndentStr[i2]=0;
+				TextEdit_Replace(WndNum,MdiInfo[WndNum]->IndentStr,1);
 			}
 			else{
@@ -334,5 +334,5 @@
 	}
 	else if(nVirtualKey==VK_TAB){
-		pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+		pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 		TextEdit_GetSel(WndNum,&CharRange);
@@ -421,5 +421,5 @@
 			//リプレイス
 			TextEdit_ReplaceUpdateUndoData(WndNum,pTemp,0,0);
-			pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+			pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 			HeapDefaultFree(pTemp);
@@ -474,7 +474,7 @@
 	////////////////////////////////////////////
 
-	if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC)
+	if(MdiInfo[WndNum]->DocType==WNDTYPE_BASIC)
 		TextEditEvent_StartAnalysis_Basic(hwnd,WndNum,nVirtualKey);
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_HTML){
+	else if(MdiInfo[WndNum]->DocType==WNDTYPE_HTML){
 		TextEditEvent_StartAnalysis_Html(hwnd,WndNum,nVirtualKey);
 	}
@@ -490,5 +490,5 @@
 
 	if(nVirtualKey==VK_LEFT||nVirtualKey==VK_UP||nVirtualKey==VK_RIGHT||nVirtualKey==VK_DOWN||nVirtualKey==VK_PRIOR||nVirtualKey==VK_NEXT){
-		if(MdiInfo[WndNum].IndentStr){
+		if(MdiInfo[WndNum]->IndentStr){
 			//自動インデント中のインデントを無効にする
 			CancelBeforeAutoIndent(WndNum);
@@ -508,8 +508,8 @@
 			case VK_LEFT:
 				//上下キャレット移動時の左右位置保持機能を解除
-				MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
-
-				if((MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)||
+				MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+
+				if((MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x&&
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)||
 					GetKeyState(VK_SHIFT)&0x8000){
 					//選択中でないとき、またはシフトキーが押されているとき
@@ -518,13 +518,13 @@
 				else{
 					//選択中のとき
-					if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
-						MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
-					else if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
-						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+					if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
+					else if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos=MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos;
 					else{
-						if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x)
-							MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+						if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x)
+							MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 						else
-							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+							MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos=MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos;
 					}
 				}
@@ -532,24 +532,24 @@
 			case VK_RIGHT:
 				//上下キャレット移動時の左右位置保持機能を解除
-				MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
-
-				if((MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)||
+				MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+
+				if((MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x&&
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)||
 					GetKeyState(VK_SHIFT)&0x8000){
 					//選択中でないとき、またはシフトキーが押されているとき
 					GetNaturalCaretPos_Right(WndNum,
-						&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+						&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 				}
 				else{
 					//選択中のとき
-					if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
-						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
-					else if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
-						MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+					if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos=MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos;
+					else if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 					else{
-						if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x)
-							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+						if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x)
+							MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos=MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos;
 						else
-							MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+							MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 					}
 				}
@@ -557,67 +557,67 @@
 			case VK_UP:
 				if((GetKeyState(VK_CONTROL)&0x8000)&&
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x!=0){
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x!=0){
 					//行の先頭へキャレットを移動
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x=0;
 
 					//上下キャレット移動時の左右位置保持機能を解除
-					MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+					MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
 				}
 				else{
-					if((MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
-						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)||
+					if((MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x&&
+						MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)||
 						GetKeyState(VK_SHIFT)&0x8000){
 						//選択中でないとき、またはシフトキーが押されているとき
 						GetNaturalCaretPos_Up(WndNum,
-							&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+							&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 					}
 					else{
 						//選択中のとき
-						if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
-							MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
-						else if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
-							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+						if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)
+							MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
+						else if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)
+							MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos=MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos;
 						else{
-							if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x)
-								MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+							if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x)
+								MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 							else
-								MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+								MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos=MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos;
 						}
 
 						GetNaturalCaretPos_Up(WndNum,
-							&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+							&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 					}
 				}
 				break;
 			case VK_DOWN:
-				i2=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
-				if((MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)||
+				i2=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y;
+				if((MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x&&
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)||
 					GetKeyState(VK_SHIFT)&0x8000){
 					//選択中でないとき、またはシフトキーが押されているとき
 					GetNaturalCaretPos_Down(WndNum,
-						&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+						&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 				}
 				else{
 					//選択中のとき
-					if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
-						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
-					else if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
-						MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+					if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos=MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos;
+					else if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 					else{
-						if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x)
-							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+						if(MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos.x)
+							MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos=MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos;
 						else
-							MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+							MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 					}
 
 					GetNaturalCaretPos_Down(WndNum,
-						&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+						&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 				}
 
 				if(GetKeyState(VK_CONTROL)&0x8000){
-					if(i2!=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y){
+					if(i2!=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y){
 						//行の先頭へキャレットを移動
-						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
+						MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x=0;
 					}
 					else{
@@ -625,19 +625,19 @@
 						CaretPos_LooseToNatural(WndNum,
 							INT_MAX,
-							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y,
-							&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+							MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y,
+							&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 					}
 
 					//上下キャレット移動時の左右位置保持機能を解除
-					MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+					MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
 				}
 				break;
 			case VK_PRIOR:
 				GetNaturalCaretPos_PageUp(WndNum,
-					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+					&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 				break;
 			case VK_NEXT:
 				GetNaturalCaretPos_PageDown(WndNum,
-					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+					&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 				break;
 		}
@@ -645,5 +645,5 @@
 		if(!(GetKeyState(VK_SHIFT)&0x8000)){
 			//シフトキーが押されていない、通常時
-			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+			MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 		}
 
@@ -672,11 +672,11 @@
 
 		//上下キャレット移動時の左右位置保持機能を解除
-		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+		MdiInfo[WndNum]->pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
 
 		if(GetKeyState(VK_CONTROL)&0x8000){
 			//ファイルの先頭または末端へキャレットを移動
 			if(nVirtualKey==VK_HOME){
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
-				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y=0;
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x=0;
+				MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y=0;
 			}
 			else if(nVirtualKey==VK_END){
@@ -685,16 +685,16 @@
 					INT_MAX,
 					INT_MAX,
-					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+					&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 			}
 		}
 		else{
 			//行の先頭または末端へキャレットを移動
-			if(nVirtualKey==VK_HOME) MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
+			if(nVirtualKey==VK_HOME) MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x=0;
 			else if(nVirtualKey==VK_END){
 				//存在するキャレット位置に変換
 				CaretPos_LooseToNatural(WndNum,
 					INT_MAX,
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y,
-					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y,
+					&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 			}
 		}
@@ -702,5 +702,5 @@
 		if(!(GetKeyState(VK_SHIFT)&0x8000)){
 			//シフトキーが押されていない、通常時
-			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+			MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos;
 		}
 
@@ -721,5 +721,5 @@
 		TextEdit_GetSel(WndNum,&CharRange);
 
-		pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+		pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 		//キャレットがファイルの終端にあるとき
@@ -727,8 +727,8 @@
 
 		if(CharRange.cpMin==CharRange.cpMax){
-			if(MdiInfo[WndNum].IndentStr){
+			if(MdiInfo[WndNum]->IndentStr){
 				//自動インデントを有効にする
 				char temporary[1024];
-				lstrcpy(temporary,MdiInfo[WndNum].IndentStr);
+				lstrcpy(temporary,MdiInfo[WndNum]->IndentStr);
 
 				CancelBeforeAutoIndent(WndNum);
@@ -743,7 +743,7 @@
 
 			GetCaretPosFromBufferIndex(
-				MdiInfo[WndNum].pMdiTextEdit->buffer,
+				MdiInfo[WndNum]->pMdiTextEdit->buffer,
 				CharRange.cpMax,
-				&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
+				&MdiInfo[WndNum]->pMdiTextEdit->EndCaretPos);
 		}
 
@@ -755,21 +755,21 @@
 		/////////////////
 
-		if(MdiInfo[WndNum].IndentStr){
+		if(MdiInfo[WndNum]->IndentStr){
 			//自動インデント中のインデントの場合、インデントの1文字を削除する
-			if(lstrlen(MdiInfo[WndNum].IndentStr)==1){
+			if(lstrlen(MdiInfo[WndNum]->IndentStr)==1){
 				//1文字しか残っていない場合は自動インデントそのものを消去する
 				CancelBeforeAutoIndent(WndNum);
 			}
 			else{
-				MdiInfo[WndNum].IndentStr[lstrlen(MdiInfo[WndNum].IndentStr)-1]=0;
+				MdiInfo[WndNum]->IndentStr[lstrlen(MdiInfo[WndNum]->IndentStr)-1]=0;
 
 				i=GetBufferIndexFromCaretPos(
-					MdiInfo[WndNum].pMdiTextEdit->buffer,
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
-					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+					MdiInfo[WndNum]->pMdiTextEdit->buffer,
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x,
+					MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y);
 				GetCaretPosFromBufferIndex(
-					MdiInfo[WndNum].pMdiTextEdit->buffer,
+					MdiInfo[WndNum]->pMdiTextEdit->buffer,
 					i-1,
-					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+					&MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos);
 				TextEdit_Replace(WndNum,"",1);
 			}
@@ -801,5 +801,5 @@
 
 	char *pBuf;
-	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 
@@ -836,6 +836,6 @@
 
 		i=GetBufferIndexFromCaretPos(pBuf,
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x,
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y);
 
 		i2=i-2;
@@ -974,5 +974,5 @@
 
 	char *pBuf;
-	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer;
 
 
@@ -985,6 +985,6 @@
  
 		i=GetBufferIndexFromCaretPos(pBuf,
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
-			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x,
+			MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y);
 
 		if(GetNowTagInfo(pBuf,i-1)){
