Index: trunk/ab5.0/abdev/abdev/Backup.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Backup.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Backup.cpp	(revision 625)
@@ -48,5 +48,5 @@
 	sprintf(temp2,"%x\r\n",hOwner);
 
-	for(i=0;i<MAX_WNDNUM;i++){
+	for(i=0;i<MdiInfo.size();i++){
 		if(MdiInfo[i].hwnd){
 			int WndNum;
@@ -60,5 +60,5 @@
 
 			//情報を追加
-			sprintf(temp2+lstrlen(temp2),"%s\r\n",MdiInfo[WndNum].path);
+			sprintf(temp2+lstrlen(temp2),"%s\r\n",MdiInfo[WndNum].path.c_str());
 
 			iNum++;
@@ -115,7 +115,5 @@
 
 		//パスを変更
-		GlobalFree(MdiInfo[WndNum].path);
-		MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(szBeforeFilePath)+1);
-		lstrcpy(MdiInfo[WndNum].path,szBeforeFilePath);
+		MdiInfo[WndNum].path = szBeforeFilePath;
 
 		//ドキュメント セレクト コンボボックスに挿入
Index: trunk/ab5.0/abdev/abdev/Caret.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Caret.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Caret.cpp	(revision 625)
@@ -122,5 +122,4 @@
 	// 選択範囲（バッファインデックス）を取得
 	//////////////////////////////////////////
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	pCharRange->cpMin=GetBufferIndexFromCaretPos(
@@ -149,5 +148,4 @@
 }
 void TextEdit_GetSelText(int WndNum,CHARRANGE *pCharRange,char *buffer){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	memcpy(buffer,
@@ -158,5 +156,4 @@
 
 void GetScrollBaseCaretPos(int WndNum,int *pNaturalBaseX,int *pNaturalBaseY){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	HWND hEdit;
@@ -176,5 +173,4 @@
 
 void GetNaturalBaseCaretPos(int WndNum,int *pScrollBaseX,int *pScrollBaseY){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	HWND hEdit;
@@ -194,5 +190,4 @@
 
 void TextEdit_SetSel(int WndNum,int StartIndex,int EndIndex,BOOL bShowCenter){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	GetCaretPosFromBufferIndex(
@@ -216,5 +211,4 @@
 }
 void TextEdit_SelectOneLine(int WndNum,int code_pos,BOOL bShowCenter){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	///////////////////////
@@ -235,5 +229,4 @@
 void ResetCaretPos(int WndNum,BOOL bInputAndReset){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int x,y;
 
@@ -465,5 +458,4 @@
 }
 BOOL TextEdit_ScrollCaret(int WndNum,BOOL bScrollOneStep_x,BOOL bShowCenter){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int x,y;
 	BOOL bScroll=0;
@@ -537,5 +529,4 @@
 
 void CaretPos_LooseToNatural(int WndNum,int loose_x,int loose_y,POINT *pCaretPos){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,LastPos;
 	int x,y;
@@ -650,5 +641,4 @@
 	/////////////////////////////
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	//ピクセル座標をカーソル座標（文字単位）に変更
@@ -664,5 +654,4 @@
 	///////////////////////////
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	int x,y;
@@ -719,5 +708,4 @@
 	///////////////////////////
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	char *pBuf;
@@ -773,5 +761,4 @@
 	// キャレット移動（上キー）
 	///////////////////////////
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	if(pCaretPos->y==0){
@@ -795,5 +782,4 @@
 	// キャレット移動（下キー）
 	///////////////////////////
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
@@ -812,5 +798,4 @@
 	// キャレット移動（PageUpキー）
 	///////////////////////////////
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	if(pCaretPos->y==0){
@@ -839,5 +824,4 @@
 	// キャレット移動（PageUpキー）
 	///////////////////////////////
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
Index: trunk/ab5.0/abdev/abdev/ChildWndOnRebar.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/ChildWndOnRebar.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/ChildWndOnRebar.cpp	(revision 625)
@@ -40,5 +40,4 @@
 LRESULT CALLBACK DocComboProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern WNDPROC OldDocComboProc;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	char str[MAX_PATH];
@@ -48,5 +47,5 @@
 			if(HIWORD(wParam)==CBN_SELCHANGE){
 				SendMessage(hwnd,CB_GETLBTEXT,SendMessage(hwnd,CB_GETCURSEL,0,0),(long)str);
-				for(i=0;i<MAX_WNDNUM;i++){
+				for(i=0;i<MdiInfo.size();i++){
 					if(lstrcmpi(str,MdiInfo[i].title)==0) break;
 				}
@@ -181,5 +180,4 @@
 	extern WNDPROC OldDocComboProc;
 	extern HFONT hStatusFont;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	HWND hTempWnd;
@@ -200,5 +198,5 @@
 	hTempWnd=GetWindow(hClient,GW_CHILD);
 	if(IsWindow(hTempWnd)){
-		for(i=0,i2=0;i<MAX_WNDNUM;i++){
+		for(i=0,i2=0;i<MdiInfo.size();i++){
 			if(MdiInfo[i].hwnd){
 				GetWindowText(MdiInfo[i].hwnd,buffer,MAX_PATH);
Index: trunk/ab5.0/abdev/abdev/ClassTree.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/ClassTree.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/ClassTree.cpp	(revision 625)
@@ -444,13 +444,15 @@
 }
 void SetClassTreeFromOneFile(char *lpszFilePath,int iFileNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int WndNum;
 	HWND hChild=GetWindow(hClient,GW_CHILD);
 	while(hChild){
 		WndNum=GetWndNum(hChild);
-		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
-			if(lstrcmpi(MdiInfo[WndNum].path,lpszFilePath)==0) break;
-		}
-		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+		if( WndNum != -1 )
+		{
+			if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+				if(lstrcmpi(MdiInfo[WndNum].path.c_str(),lpszFilePath)==0) break;
+			}
+			hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+		}
 	}
 
Index: trunk/ab5.0/abdev/abdev/Common.h
===================================================================
--- trunk/ab5.0/abdev/abdev/Common.h	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Common.h	(revision 625)
@@ -258,6 +258,4 @@
 struct RAD_UNDOSTATE_NAME{
 	std::string name;
-	std::string HandleName;
-	char *CallBackName;
 };
 #define RAD_UNDO_INSERTWND	1
@@ -357,5 +355,5 @@
 	int DocType;
 	char *title;
-	char *path;
+	std::string path;
 
 	union{
@@ -368,5 +366,5 @@
 	char *IndentStr;
 };
-extern MDIINFO MdiInfo[MAX_WNDNUM];
+extern std::vector<MDIINFO> MdiInfo;
 
 //RADツールのマウスドラッグ
@@ -483,8 +481,4 @@
 #define EVENTTYPE_MMSYS		2
 
-//ウィンドウ タイプ
-#define WNDTYPE_DEFAULT		0
-#define WNDTYPE_MODALDLG	1
-#define WNDTYPE_MODELESSDLG	3
 
 struct NEWPROJECTINFO{
@@ -648,5 +642,5 @@
 char *ReadBuffer( const std::string &path );
 char *ReadBuffer_NonErrMsg( const std::string &path );
-_int8 WriteBuffer(const std::string &path,char *buffer,int length, bool isEnableError = true);
+_int8 WriteBuffer(const std::string &path,const char *buffer,int length, bool isEnableError = true);
 _int8 WriteBuffer_NonErrMsg(const std::string &path,char *buffer,int length);
 void GetRelationalPath(char *path,char *dir);
@@ -738,5 +732,5 @@
 void SetupWindow(HWND hwnd);
 BOOL SetRunning(HWND hChild);
-BOOL IsNeedCompile(char *FileName,BOOL bDebug);
+BOOL IsNeedCompile( const std::string &filepath, BOOL bDebug );
 std::string GetLastErrorString();
 
@@ -875,5 +869,5 @@
 
 	void add(char *path);
-	void insert(char *path);
+	void insert(const char *path);
 
 	void ResetFileMenu(CSubMenuEx *pobj_SubMenu,BOOL bOwnerDraw);
@@ -969,9 +963,10 @@
 
 //WindowControl.cpp
-int GetWndInfoNum(char *name);
-ActiveBasic::PM::WindowInfo *GetWndInfo( char *name );
+int GetWndInfoNum( const std::string &name );
+ActiveBasic::PM::WindowInfo *GetWndInfo( const std::string &name );
 HGLOBAL Rad_GetChildInfoClipboardData(int WndNum,int WndInfoNum);
 void Rad_PasteChildInfoClipboardData(int WndNum,HGLOBAL hGlobal);
 char *PermutationWndPgmTemplate(char *pBuf,const char *pPjName, char *pWndName, char *pHandleName, char *pProcName);
+const std::string PermutationWndPgmTemplate( const std::string &templateFilePath, const std::string &projectName, std::string &windowName, std::string &handleName, std::string &procName );
 void GetItemClassName(char *buffer,int Control);
 void SaveWindowProgram();
@@ -1057,5 +1052,5 @@
 
 //MenuProc.cpp
-int GetMenuInfoNum(const char *name);
+int GetMenuInfoNum(const std::string &name);
 void HeapMenuDataFree(MENU_INFO *pMenuInfo,int ItemNum,int *NumberOfFreedItem);
 BOOL CALLBACK DlgProject_MenuID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
Index: trunk/ab5.0/abdev/abdev/Complement.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Complement.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Complement.cpp	(revision 625)
@@ -388,5 +388,4 @@
 	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern int font_width,font_height;
 	POINT pos;
@@ -612,5 +611,4 @@
 
 LRESULT CALLBACK ComplementListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
 	int i,WndNum;
Index: trunk/ab5.0/abdev/abdev/Debugger.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Debugger.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Debugger.cpp	(revision 625)
@@ -251,5 +251,5 @@
 
 		char temporary[MAX_PATH];
-		sprintf(temporary,"\"%s\",%d",MdiInfo[WndNum].path,MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+		sprintf(temporary,"\"%s\",%d",MdiInfo[WndNum].path.c_str(),MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
 
 		char temp2[MAX_PATH];
@@ -281,5 +281,5 @@
 //////////////////////////
 
-CFileBreakPoint::CFileBreakPoint(char *lpszFileName,int iLineNum){
+CFileBreakPoint::CFileBreakPoint(const char *lpszFileName,int iLineNum){
 	this->lpszFileName=(char *)HeapAlloc(hHeap,0,lstrlen(lpszFileName)+1);
 	lstrcpy(this->lpszFileName,lpszFileName);
@@ -389,5 +389,5 @@
 	HeapDefaultFree(ppItem);
 }
-void CDBBreakPoint::insert(char *lpszFileName,int iLineNum){
+void CDBBreakPoint::insert( const char *lpszFileName,int iLineNum){
 	int i;
 	for(i=0;i<num;i++){
@@ -404,5 +404,5 @@
 	}
 }
-void CDBBreakPoint::remove(char *lpszFileName,int iLineNum){
+void CDBBreakPoint::remove( const char *lpszFileName,int iLineNum){
 	int i;
 	for(i=0;i<num;i++){
@@ -429,9 +429,12 @@
 	if(WndNum==-1) return;
 
-	if(!IsExistFile(MdiInfo[WndNum].path)) return;
+	if( !Jenga::Common::Path( MdiInfo[WndNum].path ).IsExistFile() )
+	{
+		return;
+	}
 
 	int i,i2,sw=0;
 	for(i=0;i<num;i++){
-		if(lstrcmpi(MdiInfo[WndNum].path,ppItem[i]->lpszFileName)==0){
+		if(lstrcmpi(MdiInfo[WndNum].path.c_str(),ppItem[i]->lpszFileName)==0){
 			for(i2=0;i2<ppItem[i]->num;i2++){
 				if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==ppItem[i]->piLine[i2]){
@@ -446,9 +449,9 @@
 	if(sw==0){
 		//ブレークポイントを追加
-		insert(MdiInfo[WndNum].path,MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+		insert(MdiInfo[WndNum].path.c_str(),MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
 	}
 	else{
 		//ブレークポイントを削除
-		remove(MdiInfo[WndNum].path,MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+		remove(MdiInfo[WndNum].path.c_str(),MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
 	}
 
@@ -500,5 +503,5 @@
 
 
-CFileBreakPoint *CDBBreakPoint::EnumLines(char *lpszFilePath){
+CFileBreakPoint *CDBBreakPoint::EnumLines(const char *lpszFilePath){
 	int i;
 	for(i=0;i<num;i++){
@@ -510,5 +513,5 @@
 }
 
-void CDBBreakPoint::replace(LPSTR lpszFilePath,LPSTR lpszBuffer,CHARRANGE *pDelRange,CHARRANGE *pRange,LPSTR lpszNewStr){
+void CDBBreakPoint::replace(const char *lpszFilePath,LPSTR lpszBuffer,CHARRANGE *pDelRange,CHARRANGE *pRange,LPSTR lpszNewStr){
 	int i;
 	for(i=0;i<num;i++){
Index: trunk/ab5.0/abdev/abdev/Debugger.h
===================================================================
--- trunk/ab5.0/abdev/abdev/Debugger.h	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Debugger.h	(revision 625)
@@ -53,5 +53,5 @@
 	int num;
 
-	CFileBreakPoint(char *lpszFileName,int iLineNum);
+	CFileBreakPoint(const char *lpszFileName,int iLineNum);
 	~CFileBreakPoint();
 
@@ -72,12 +72,12 @@
 	~CDBBreakPoint();
 
-	void insert(char *lpszFileName,int iLineNum);
-	void remove(char *lpszFileName,int iLineNum);
+	void insert( const char *lpszFileName,int iLineNum);
+	void remove( const char *lpszFileName,int iLineNum);
 
 	void Event_BreakPoint(void);
 	void SaveToTempFile(void);
 
-	CFileBreakPoint *EnumLines(char *lpszFilePath);
+	CFileBreakPoint *EnumLines(const char *lpszFilePath);
 
-	void replace(LPSTR lpszFilePath,LPSTR lpszBuffer,CHARRANGE *pDelRange,CHARRANGE *pRange,LPSTR lpszNewStr);
+	void replace(const char *lpszFilePath,LPSTR lpszBuffer,CHARRANGE *pDelRange,CHARRANGE *pRange,LPSTR lpszNewStr);
 };
Index: trunk/ab5.0/abdev/abdev/DocumentAdvice.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/DocumentAdvice.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/DocumentAdvice.cpp	(revision 625)
@@ -179,11 +179,10 @@
 
 #define MEM_SPACE 1024 //強制終了を防ぐためのゆとりスペース
-			extern MDIINFO MdiInfo[MAX_WNDNUM];
-			for(i3=0;i3<MAX_WNDNUM;i3++){
+			for(i3=0;i3<MdiInfo.size();i3++){
 				if(MdiInfo[i3].hwnd){
-					if(lstrcmpi(temporary,MdiInfo[i3].path)==0) break;
-				}
-			}
-			if(i3==MAX_WNDNUM){
+					if(lstrcmpi(temporary,MdiInfo[i3].path.c_str())==0) break;
+				}
+			}
+			if(i3==MdiInfo.size()){
 				//ファイルから開く
 				HANDLE fh;
Index: trunk/ab5.0/abdev/abdev/DrawBuffer.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/DrawBuffer.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/DrawBuffer.cpp	(revision 625)
@@ -193,9 +193,9 @@
 			if( projectInfo.IsOpened() ){
 				pobj_FileBreakPoint=
-					projectInfo.pobj_DBBreakPoint->EnumLines(MdiInfo[m_WndNum].path);
+					projectInfo.pobj_DBBreakPoint->EnumLines(MdiInfo[m_WndNum].path.c_str());
 			}
 			else{
 				extern CDBBreakPoint *pobj_DBBreakPoint;
-				pobj_FileBreakPoint=pobj_DBBreakPoint->EnumLines(MdiInfo[m_WndNum].path);
+				pobj_FileBreakPoint=pobj_DBBreakPoint->EnumLines(MdiInfo[m_WndNum].path.c_str());
 			}
 
@@ -266,5 +266,4 @@
 
 void TextEdit_DrawBuffer(HDC hdc,int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	int x,y;
Index: trunk/ab5.0/abdev/abdev/DrawWindow.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/DrawWindow.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/DrawWindow.cpp	(revision 625)
@@ -4,5 +4,4 @@
 
 void DrawLineInClient(int WndNum,long StartX,long StartY,long EndX,long EndY){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	MoveToEx(MdiInfo[WndNum].MdiRadInfo->hMemDC,
 		StartX+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
@@ -14,5 +13,4 @@
 }
 void DrawRectangleInClient(int WndNum,long left,long top,long right,long bottom,COLORREF RGB_Pen,COLORREF RGB_Brush,BOOL bBrushing){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HPEN hPen,hOldPen;
 	HBRUSH hBrush,hOldBrush;
@@ -36,5 +34,4 @@
 }
 void DrawButtonEdge(int WndNum,POINT *pPos,SIZE *pSize){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HPEN hPen,hOldPen;
 
@@ -86,5 +83,4 @@
 }
 void DrawItemEdgeByExStyle(int WndNum,int ExStyle,POINT *pPos,SIZE *pSize){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HPEN hPen,hOldPen;
 	RECT rect;
@@ -172,5 +168,4 @@
 }
 void DrawScrollBar(int WndNum,DWORD style,BOOL bSwitch,POINT *pPos,SIZE *pSize){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	HPEN hPen,hOldPen;
@@ -487,5 +482,4 @@
 }
 void DrawUpDownControl(int WndNum,DWORD style,BOOL bSwitch,POINT *pPos,SIZE *pSize){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	HPEN hPen,hOldPen;
@@ -688,5 +682,4 @@
 }
 void DesigningWindow(int WndNum,HDC hdc,POINT *pBasePos,const ActiveBasic::PM::WindowInfo *pWindowInfo){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3,i4;
 	double red,green,blue,d_red,d_green,d_blue;
@@ -1773,5 +1766,4 @@
 }
 void DrawRadWindow(int WndNum,const ActiveBasic::PM::WindowInfo *pWindowInfo){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HBRUSH hOldBrush;
 	POINT pos;
Index: trunk/ab5.0/abdev/abdev/ExtensionLink.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/ExtensionLink.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/ExtensionLink.cpp	(revision 625)
@@ -197,8 +197,9 @@
 }
 
-COLORREF CExtLink::GetTabColorFromFilePath(char *path){
+COLORREF CExtLink::GetTabColorFromFilePath( const std::string &filepath )
+{
 	//拡張子を識別し、タブの色を決定
 	char szExt[255],*lpszTemp;
-	_splitpath(path,NULL,NULL,NULL,szExt);
+	_splitpath(filepath.c_str(),NULL,NULL,NULL,szExt);
 	if(szExt[0]=='.') lpszTemp=szExt+1;
 	else lpszTemp=szExt;
Index: trunk/ab5.0/abdev/abdev/ExtensionLink.h
===================================================================
--- trunk/ab5.0/abdev/abdev/ExtensionLink.h	(revision 624)
+++ trunk/ab5.0/abdev/abdev/ExtensionLink.h	(revision 625)
@@ -31,5 +31,5 @@
 	void ResetListView(HWND hListView);
 
-	COLORREF GetTabColorFromFilePath(char *path);
+	COLORREF GetTabColorFromFilePath( const std::string &filepath );
 };
 
Index: trunk/ab5.0/abdev/abdev/FileOperation.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/FileOperation.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/FileOperation.cpp	(revision 625)
@@ -57,5 +57,6 @@
 	return buffer;
 }
-_int8 WriteBuffer(const std::string &path,char *buffer,int length, bool isEnableError){
+_int8 WriteBuffer(const std::string &path,const char *buffer,int length, bool isEnableError)
+{
 	HANDLE hFile;
 	DWORD dw;
@@ -328,5 +329,5 @@
 
 	COLORREF TabColor;
-	TabColor=pobj_nv->pobj_ExtLink->GetTabColorFromFilePath(OpenFileName);
+	TabColor=pobj_nv->pobj_ExtLink->GetTabColorFromFilePath( filePath );
 
 	return NewTextEditWindow(OpenFileName,DocumentType,TabColor);
@@ -335,5 +336,4 @@
 	extern LPSTR IconFileFilter;
 	extern HWND hClient,hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int WndNum,i2;
 	char temporary[MAX_PATH],str[MAX_PATH],str2[32];
@@ -380,7 +380,5 @@
 
 			//新しいパスをセット
-			GlobalFree(MdiInfo[WndNum].path);
-			MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(temporary)+1);
-			lstrcpy(MdiInfo[WndNum].path,temporary);
+			MdiInfo[WndNum].path = temporary;
 
 			//ドキュメント セレクト コンボボックスに挿入
@@ -398,5 +396,5 @@
 		}
 		else{
-			if(MdiInfo[WndNum].path[0]=='\0'){
+			if(MdiInfo[WndNum].path.empty()){
 				//"保存先のファイルを指定してください"
 get_file_path:
@@ -418,5 +416,5 @@
 				return 1;
 			}
-			lstrcpy(temporary,MdiInfo[WndNum].path);
+			lstrcpy(temporary,MdiInfo[WndNum].path.c_str());
 		}
 
@@ -475,7 +473,5 @@
 			}
 			CloseHandle(fh);
-			GlobalFree(MdiInfo[WndNum].path);
-			MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(temporary)+1);
-			lstrcpy(MdiInfo[WndNum].path,temporary);
+			MdiInfo[WndNum].path = temporary;
 			i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title);
 			SendMessage(hDocCombo,CB_DELETESTRING,i2,0);
@@ -489,5 +485,5 @@
 		}
 		else{
-			if(MdiInfo[WndNum].path[0]=='\0'){
+			if(MdiInfo[WndNum].path.empty()){
 				//"保存先のファイルを指定してください"
 				if(!GetFilePathDialog(hOwner,temporary,IconFileFilter,STRING_FILESAVETITLE_DEFAULT,FALSE)) return 0;
@@ -495,5 +491,5 @@
 				return 1;
 			}
-			lstrcpy(temporary,MdiInfo[WndNum].path);
+			lstrcpy(temporary,MdiInfo[WndNum].path.c_str());
 		}
 		SaveIconFile(temporary,hChild);
@@ -515,5 +511,5 @@
 
 	//「最近使ったファイル」を更新
-	pobj_nv->pobj_History->insert(MdiInfo[WndNum].path);
+	pobj_nv->pobj_History->insert(MdiInfo[WndNum].path.c_str());
 
 	return 1;
Index: trunk/ab5.0/abdev/abdev/History.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/History.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/History.cpp	(revision 625)
@@ -57,5 +57,5 @@
 	iNum++;
 }
-void CHistory::insert(char *path){
+void CHistory::insert(const char *path){
 	//重複チェック
 	int i;
Index: trunk/ab5.0/abdev/abdev/IconEditor.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/IconEditor.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/IconEditor.cpp	(revision 625)
@@ -29,5 +29,4 @@
 }
 void ResetIconType(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	HWND hCombo;
@@ -127,5 +126,4 @@
 void AddIconType(int WndNum,int IconType){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,width,BitCount;
 
@@ -192,5 +190,4 @@
 }
 void DeleteIconType(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
@@ -241,5 +238,4 @@
 	extern HANDLE hHeap;
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,IconNum;
 	char str[MAX_PATH],str2[32],*buffer;
@@ -257,5 +253,5 @@
 			i=GetWndNum(hChild);
 			if(MdiInfo[i].DocType==WNDTYPE_ICONEDIT){
-				if(lstrcmpi(MdiInfo[i].path,filepath)==0) break;
+				if(lstrcmpi(MdiInfo[i].path.c_str(),filepath)==0) break;
 			}
 			hChild=GetNextWindow(hChild,GW_HWNDNEXT);
@@ -373,48 +369,50 @@
 
 	//ウィンドウのID登録
-	for(i=0;i<MAX_WNDNUM;i++){
-		if(MdiInfo[i].hwnd==0){
-			MdiInfo[i].hwnd=hChild;
-			MdiInfo[i].DocType=WNDTYPE_ICONEDIT;
-			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(str)+1);
-			lstrcpy(MdiInfo[i].title,str);
-			if(filepath){
-				MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(filepath)+1);
-				lstrcpy(MdiInfo[i].path,filepath);
-			}
-			else MdiInfo[i].path=(char *)GlobalAlloc(GPTR,1);
-
-			MdiInfo[i].MdiIconEditInfo=(MDIICONEDITINFO *)HeapAlloc(hHeap,0,sizeof(MDIICONEDITINFO));
-			MdiInfo[i].MdiIconEditInfo->hMain=hMain;
-			MdiInfo[i].MdiIconEditInfo->hToolDlg=hToolDlg;
-			MdiInfo[i].MdiIconEditInfo->hButtonsDlg=hButtonsDlg;
-			MdiInfo[i].MdiIconEditInfo->hColorDlg=hColorDlg;
-			hdc=GetDC(hMain);
-			MdiInfo[i].MdiIconEditInfo->memdc=CreateCompatibleDC(hdc);
-			MdiInfo[i].MdiIconEditInfo->hMemBmp=CreateCompatibleBitmap(hdc,600,400);
-			SelectObject(MdiInfo[i].MdiIconEditInfo->memdc,MdiInfo[i].MdiIconEditInfo->hMemBmp);
-			ReleaseDC(hMain,hdc);
-
-			MdiInfo[i].MdiIconEditInfo->SelectLevel=0;
-
-			MdiInfo[i].MdiIconEditInfo->num=IconNum;
-			MdiInfo[i].MdiIconEditInfo->SelectIconNum=0;
-			memcpy(MdiInfo[i].MdiIconEditInfo->pIconImage,pImageBuffer,sizeof(DWORD)*IconNum);
-
-			memcpy(MdiInfo[i].MdiIconEditInfo->dwBytesInRes,dwBytesInRes,sizeof(DWORD)*IconNum);
-
-			MdiInfo[i].MdiIconEditInfo->NowTool=IDC_TOOL_PEN;
-			MdiInfo[i].MdiIconEditInfo->MainColor=RGB(0,0,0);
-			extern COLORREF TransparentClrRef;
-			MdiInfo[i].MdiIconEditInfo->SubColor=TransparentClrRef;
-
-			for(i2=0;i2<MdiInfo[i].MdiIconEditInfo->num;i2++){
-				MdiInfo[i].MdiIconEditInfo->undo[i2].NowPos=0;
-				memset(MdiInfo[i].MdiIconEditInfo->undo[i2].lpData,0,sizeof(BYTE *)*MAX_ICONEDIT_UNDONUM);
-			}
-			MdiInfo[i].MdiIconEditInfo->bModify=0;
-			break;
-		}
-	}
+	MdiInfo.push_back( MDIINFO() );
+	i = MdiInfo.size()-1;
+	MdiInfo[i].hwnd=hChild;
+	MdiInfo[i].DocType=WNDTYPE_ICONEDIT;
+	MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(str)+1);
+	lstrcpy(MdiInfo[i].title,str);
+	if(filepath)
+	{
+		MdiInfo[i].path = filepath;
+	}
+	else
+	{
+		MdiInfo[i].path = "";
+	}
+
+	MdiInfo[i].MdiIconEditInfo=(MDIICONEDITINFO *)HeapAlloc(hHeap,0,sizeof(MDIICONEDITINFO));
+	MdiInfo[i].MdiIconEditInfo->hMain=hMain;
+	MdiInfo[i].MdiIconEditInfo->hToolDlg=hToolDlg;
+	MdiInfo[i].MdiIconEditInfo->hButtonsDlg=hButtonsDlg;
+	MdiInfo[i].MdiIconEditInfo->hColorDlg=hColorDlg;
+	hdc=GetDC(hMain);
+	MdiInfo[i].MdiIconEditInfo->memdc=CreateCompatibleDC(hdc);
+	MdiInfo[i].MdiIconEditInfo->hMemBmp=CreateCompatibleBitmap(hdc,600,400);
+	SelectObject(MdiInfo[i].MdiIconEditInfo->memdc,MdiInfo[i].MdiIconEditInfo->hMemBmp);
+	ReleaseDC(hMain,hdc);
+
+	MdiInfo[i].MdiIconEditInfo->SelectLevel=0;
+
+	MdiInfo[i].MdiIconEditInfo->num=IconNum;
+	MdiInfo[i].MdiIconEditInfo->SelectIconNum=0;
+	memcpy(MdiInfo[i].MdiIconEditInfo->pIconImage,pImageBuffer,sizeof(DWORD)*IconNum);
+
+	memcpy(MdiInfo[i].MdiIconEditInfo->dwBytesInRes,dwBytesInRes,sizeof(DWORD)*IconNum);
+
+	MdiInfo[i].MdiIconEditInfo->NowTool=IDC_TOOL_PEN;
+	MdiInfo[i].MdiIconEditInfo->MainColor=RGB(0,0,0);
+	extern COLORREF TransparentClrRef;
+	MdiInfo[i].MdiIconEditInfo->SubColor=TransparentClrRef;
+
+	for(i2=0;i2<MdiInfo[i].MdiIconEditInfo->num;i2++){
+		MdiInfo[i].MdiIconEditInfo->undo[i2].NowPos=0;
+		memset(MdiInfo[i].MdiIconEditInfo->undo[i2].lpData,0,sizeof(BYTE *)*MAX_ICONEDIT_UNDONUM);
+	}
+	MdiInfo[i].MdiIconEditInfo->bModify=0;
+
+
 
 	//メモリへ初期描画を行う
@@ -449,5 +447,4 @@
 }
 void SaveIconFile(char *filepath,HWND hwnd){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,WndNum;
 	char buffer[8192],temporary[MAX_PATH];
@@ -534,5 +531,4 @@
 LRESULT CALLBACK MDIClientWindow_IconEdit(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,WndNum;
 
Index: trunk/ab5.0/abdev/abdev/IconEditor_Color.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/IconEditor_Color.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/IconEditor_Color.cpp	(revision 625)
@@ -7,5 +7,4 @@
 BOOL CALLBACK DlgIconColorProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern COLORREF TransparentClrRef;
 	int i,i2,WndNum;
Index: trunk/ab5.0/abdev/abdev/IconEditor_Main.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/IconEditor_Main.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/IconEditor_Main.cpp	(revision 625)
@@ -13,5 +13,4 @@
 void LimitRectFormat(int WndNum,RECT *pRect){
 	//はみ出した場合は範囲内におさめる
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	if(pRect->left<0) pRect->left=0;
 	if(pRect->top<0) pRect->top=0;
@@ -33,5 +32,4 @@
 }
 void SetZoomedPixel(HDC hdc,int WndNum,int x,int y){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	POINT pos;
 
@@ -47,5 +45,4 @@
 }
 DWORD GetColorCode(int WndNum,COLORREF ColorRef){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	RGBQUAD *pRgbq;
@@ -70,5 +67,4 @@
 	//////////////////////////////////////////////
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HDC hDC;
 	HBITMAP hBmp;
@@ -114,5 +110,4 @@
 	////////////////////////////////////
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HDC hDC,hDC2;
 	BITMAP Bitmap;
@@ -147,5 +142,4 @@
 
 void IconEdit_SelectImage(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	SIZE size;
 	HDC hDC;
@@ -169,5 +163,4 @@
 void IconEdit_PasteImage(int WndNum){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3,x,y,y2,selecting_x,selecting_y;
 	DWORD dwRgbq;
@@ -299,5 +292,4 @@
 
 void DrawIconToMemBmp(int WndNum,RECT *pRect){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HPEN hPen,hOldPen;
 	HBRUSH hBrush,hOldBrush;
@@ -406,5 +398,4 @@
 
 void PixelChange(int WndNum,int x,int y,DWORD ColorCode){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	int y2;
@@ -467,5 +458,4 @@
 }
 COLORREF IconEdit_GetPixel(int WndNum,int x,int y){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	int y2;
@@ -525,5 +515,4 @@
 }
 void IconEdit_DrawLine(int WndNum,int x1,int y1,int x2,int y2,DWORD ColorCode){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int dx,dy,s,step;
 
@@ -576,5 +565,4 @@
 }
 void IconEdit_FloodFill(int WndNum,int x,int y,COLORREF FilledColor,DWORD ColorCode){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	if(x<0||y<0) return;
@@ -610,5 +598,4 @@
 }
 void IconEdit_DrawEllipse(int WndNum,int x1,int y1,int x2,int y2,DWORD ColorCode){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	RECT rect,rc2;
 
@@ -680,5 +667,4 @@
 
 void IconEdit_EraseRect(int WndNum,RECT *pRect){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	//変更情報
@@ -698,5 +684,4 @@
 
 void IconEdit_DrawFrame(HWND hwnd,int WndNum,RECT *pRect){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HDC hdc;
 	HPEN hPen,hOldPen;
@@ -744,5 +729,4 @@
 }
 void IconEdit_DrawSelectingRect(HDC hdc,int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i2,i3;
 	HPEN hPen,hOldPen;
@@ -817,5 +801,4 @@
 void DrawZoomedBitmap(HDC hdc,int WndNum,POINT *pPos){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int x,y;
 	RGBQUAD rgbq;
@@ -869,5 +852,4 @@
 }
 int IconEdit_GetStateOfDraggingFrame(int WndNum,int x,int y){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	POINT pos;
 	RECT rect;
@@ -892,5 +874,4 @@
 	// 選択されているイメージを表示
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HDC hDC2;
 	SIZE size;
@@ -914,5 +895,4 @@
 }
 void TempLine(HDC hdc,int WndNum,int x1,int y1,int x2,int y2,COLORREF ColorRef){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int dx,dy,s,step;
 	HPEN hPen,hOldPen;
@@ -977,5 +957,4 @@
 }
 void TempRectangle(HDC hdc,int WndNum,int x1,int y1,int x2,int y2,COLORREF ColorRef,COLORREF FillClrRef,BOOL bFill){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int x,y;
 	HPEN hPen,hOldPen;
@@ -1038,5 +1017,4 @@
 }
 void TempEllipse(HDC hdc,int WndNum,int x1,int y1,int x2,int y2,COLORREF ColorRef){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HPEN hPen,hOldPen;
 	HBRUSH hBrush,hOldBrush;
@@ -1137,5 +1115,4 @@
 }
 LRESULT CALLBACK IconEditWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int WndNum,dx,dy;
 	BOOL bRedrawMemBmp;
Index: trunk/ab5.0/abdev/abdev/IconEditor_Tool.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/IconEditor_Tool.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/IconEditor_Tool.cpp	(revision 625)
@@ -32,5 +32,4 @@
 
 BOOL CALLBACK DlgIconButtons(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int WndNum;
 	RECT rect;
@@ -105,5 +104,4 @@
 }
 BOOL CALLBACK DlgIconType(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,WndNum;
 	HWND hList;
@@ -180,5 +178,4 @@
 }
 BOOL CALLBACK DlgIconToolProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,WndNum;
 
Index: trunk/ab5.0/abdev/abdev/IconEditor_UndoRedo.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/IconEditor_UndoRedo.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/IconEditor_UndoRedo.cpp	(revision 625)
@@ -4,5 +4,4 @@
 
 void IconEdit_UndoCommand(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	BYTE *pByte;
@@ -40,5 +39,4 @@
 }
 void IconEdit_RedoCommand(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	BYTE *pByte;
 	ICONEDIT_UNDOSTATE *pUndoState;
@@ -68,5 +66,4 @@
 void IconEdit_NoticeChanging(int WndNum){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	ICONEDIT_UNDOSTATE *pUndoState;
Index: trunk/ab5.0/abdev/abdev/MenuProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/MenuProc.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/MenuProc.cpp	(revision 625)
@@ -11,8 +11,8 @@
 #endif
 
-int GetMenuInfoNum(const char *name){
+int GetMenuInfoNum(const std::string &name){
 	int i;
 	for(i=0;i<projectInfo.NumberOfMenu;i++){
-		if(lstrcmpi(name,projectInfo.pMenuInfo[i].IdName)==0) return i;
+		if(lstrcmpi(name.c_str(),projectInfo.pMenuInfo[i].IdName)==0) return i;
 	}
 	return -1;
@@ -68,5 +68,4 @@
 void Project_Menu_Insert(void){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern char NewIdName[MAX_PATH];
 	int i;
@@ -121,5 +120,5 @@
 	////////////////////////////////
 	// ウィンドウ プロパティを更新
-	for(i=0;i<MAX_WNDNUM;i++){
+	for(i=0;i<MdiInfo.size();i++){
 		if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){
 			if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
@@ -132,10 +131,9 @@
 void Project_Menu_Delete(int MenuInfoNum){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
 	//ウィンドウが開かれている場合は閉じる
-	for(i=0;i<MAX_WNDNUM;i++){
-		if(MdiInfo[i].hwnd&&lstrcmpi(projectInfo.pMenuInfo[MenuInfoNum].IdName,MdiInfo[i].path)==0){
+	for(i=0;i<MdiInfo.size();i++){
+		if(MdiInfo[i].hwnd&&lstrcmpi(projectInfo.pMenuInfo[MenuInfoNum].IdName,MdiInfo[i].path.c_str())==0){
 			SendMessage(MdiInfo[i].hwnd,WM_CLOSE,0,0);
 			break;
@@ -166,8 +164,8 @@
 	////////////////////////////////
 	// ウィンドウ プロパティを更新
-	for(i=0;i<MAX_WNDNUM;i++){
+	for(i=0;i<MdiInfo.size();i++){
 		if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){
 			if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
-				ChangePropertyWindow(i,GetWndInfoNum(MdiInfo[i].path));
+				ChangePropertyWindow(i,GetWndInfoNum(MdiInfo[i].path.c_str()));
 		}
 	}
@@ -192,5 +190,4 @@
 	extern HINSTANCE hInst;
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	HWND hChild,hListWnd,hMenuEdit;
@@ -203,5 +200,5 @@
 		i=GetWndNum(hChild);
 		if(MdiInfo[i].DocType==WNDTYPE_MENU){
-			if(lstrcmpi(MdiInfo[i].path,pMenuInfo->IdName)==0) break;
+			if(lstrcmpi(MdiInfo[i].path.c_str(),pMenuInfo->IdName)==0) break;
 		}
 		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
@@ -249,40 +246,38 @@
 		hChild,NULL,hInst,NULL);
 
+
 	//ウィンドウのID登録
-	for(i=0;i<MAX_WNDNUM;i++){
-		if(MdiInfo[i].hwnd==0){
-			MdiInfo[i].hwnd=hChild;
-			MdiInfo[i].DocType=WNDTYPE_MENU;
-			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pMenuInfo->IdName)+1);
-			lstrcpy(MdiInfo[i].title,pMenuInfo->IdName);
-			MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pMenuInfo->IdName)+1);
-			lstrcpy(MdiInfo[i].path,pMenuInfo->IdName);
-
-
-			/////////////////////
-			//MENU ウィンドウ情報
-
-			MdiInfo[i].MdiMenuInfo=(MDIMENUINFO *)GlobalAlloc(GPTR,sizeof(MDIMENUINFO));
-
-			MdiInfo[i].MdiMenuInfo->hList=hListWnd;
-
-			MdiInfo[i].MdiMenuInfo->hMenuEdit=hMenuEdit;
-			MdiInfo[i].MdiMenuInfo->hEdit_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_PROJECT_MENUEDIT),hMenuEdit,(DLGPROC)MenuEditDlg);
-
-			SCROLLINFO ScrollInfo;
-			ScrollInfo.cbSize=sizeof(SCROLLINFO);
-			ScrollInfo.fMask=SIF_POS;
-			ScrollInfo.nPos=0;
-			SetScrollInfo(MdiInfo[i].MdiMenuInfo->hMenuEdit,SB_VERT,&ScrollInfo,1);
-
-			SendMessage(hListWnd,LB_RESETCONTENT,0,0);
-			SetMenuDataList(hListWnd,pMenuInfo,0);
-			if(pMenuInfo->NumberOfMenu){
-				SendMessage(hListWnd,LB_SETCURSEL,0,0);
-				SendMessage(hChild,WM_COMMAND,MAKELONG(0,LBN_SELCHANGE),(long)hListWnd);
-			}
-			break;
-		}
-	}
+	MdiInfo.push_back( MDIINFO() );
+	i = MdiInfo.size()-1;
+	MdiInfo[i].hwnd=hChild;
+	MdiInfo[i].DocType=WNDTYPE_MENU;
+	MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pMenuInfo->IdName)+1);
+	lstrcpy(MdiInfo[i].title,pMenuInfo->IdName);
+	MdiInfo[i].path = pMenuInfo->IdName;
+
+
+	/////////////////////
+	//MENU ウィンドウ情報
+
+	MdiInfo[i].MdiMenuInfo=(MDIMENUINFO *)GlobalAlloc(GPTR,sizeof(MDIMENUINFO));
+
+	MdiInfo[i].MdiMenuInfo->hList=hListWnd;
+
+	MdiInfo[i].MdiMenuInfo->hMenuEdit=hMenuEdit;
+	MdiInfo[i].MdiMenuInfo->hEdit_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_PROJECT_MENUEDIT),hMenuEdit,(DLGPROC)MenuEditDlg);
+
+	SCROLLINFO ScrollInfo;
+	ScrollInfo.cbSize=sizeof(SCROLLINFO);
+	ScrollInfo.fMask=SIF_POS;
+	ScrollInfo.nPos=0;
+	SetScrollInfo(MdiInfo[i].MdiMenuInfo->hMenuEdit,SB_VERT,&ScrollInfo,1);
+
+	SendMessage(hListWnd,LB_RESETCONTENT,0,0);
+	SetMenuDataList(hListWnd,pMenuInfo,0);
+	if(pMenuInfo->NumberOfMenu){
+		SendMessage(hListWnd,LB_SETCURSEL,0,0);
+		SendMessage(hChild,WM_COMMAND,MAKELONG(0,LBN_SELCHANGE),(long)hListWnd);
+	}
+
 
 	//ウィンドウ位置を初期化
@@ -332,5 +327,4 @@
 	extern HANDLE hHeap;
 	extern HWND hClient,hOwner;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	char temporary[MAX_PATH];
@@ -744,5 +738,4 @@
 LRESULT CALLBACK MenuEditWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HINSTANCE hInst;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	RECT rect;
@@ -797,5 +790,4 @@
 LRESULT CALLBACK MDIClientWindow_Menu(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3,WndNum,MenuInfoNum;
 	MENU_INFO *pMenuInfo;
Index: trunk/ab5.0/abdev/abdev/MessageCallOperation.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/MessageCallOperation.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/MessageCallOperation.cpp	(revision 625)
@@ -39,7 +39,7 @@
 
 	NameLen=pWindowInfo->GetName().size();
-	CallBackNameLen=lstrlen(pWindowInfo->CallBackName);
-
-	buffer = ReadBuffer( projectInfo.GetWorkDir().GetPath() + pWindowInfo->filepath );
+	CallBackNameLen=pWindowInfo->GetCallbackName().size();
+
+	buffer = ReadBuffer( projectInfo.GetWorkDir().GetPath() + pWindowInfo->GetSourceFileName() );
 
 	*num=0;
@@ -117,5 +117,5 @@
 				i2+=9;
 				while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
-				if(memicmp(buffer+i2,pWindowInfo->CallBackName,CallBackNameLen)==0&&
+				if(memicmp(buffer+i2,pWindowInfo->GetCallbackName().c_str(),CallBackNameLen)==0&&
 					(buffer[i2+CallBackNameLen]==' '||buffer[i2+CallBackNameLen]=='\t'||buffer[i2+CallBackNameLen]=='(')){
 					*pbAlways=1;
@@ -129,5 +129,4 @@
 }
 void SelectProcedureOfMessageCall(int WndInfoNum,char *ProcedureName,char *Parameter){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3,WndNum;
 	char temporary[MAX_PATH],*pBuf;
@@ -137,5 +136,5 @@
 	ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
 
-	hChild=OpenFileWithExtension( projectInfo.GetWorkDir().GetPath() + pWindowInfo->filepath );
+	hChild=OpenFileWithExtension( projectInfo.GetWorkDir().GetPath() + pWindowInfo->GetSourceFileName() );
 	if(!hChild) return;
 	WndNum=GetWndNum(hChild);
@@ -216,5 +215,4 @@
 }
 BOOL GetEventProcedureNameFromListView(HWND hList,int WndNum,int WndInfoNum,char *EventName,char *Parameter,DWORD dwEventType){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,MaxCount;
 	char temporary[MAX_PATH];
@@ -394,5 +392,4 @@
 }
 void SetEventToList(HWND hDlg,DWORD dwEventType){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,WndNum;
 	HWND hList;
@@ -586,5 +583,4 @@
 }
 BOOL CALLBACK DlgEventCode(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int WndNum,WndInfoNum,i,i2;
 	char temporary[MAX_PATH],temp2[MAX_PATH];
Index: trunk/ab5.0/abdev/abdev/ParameterHint.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/ParameterHint.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/ParameterHint.cpp	(revision 625)
@@ -38,11 +38,10 @@
 		lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
 
-		extern MDIINFO MdiInfo[MAX_WNDNUM];
-		for(i=0;i<MAX_WNDNUM;i++){
+		for(i=0;i<MdiInfo.size();i++){
 			if(MdiInfo[i].hwnd){
-				if(lstrcmpi(MdiInfo[i].path,temporary)==0) break;
-			}
-		}
-		if(i==MAX_WNDNUM){
+				if(lstrcmpi(MdiInfo[i].path.c_str(),temporary)==0) break;
+			}
+		}
+		if(i==MdiInfo.size()){
 			//ファイルから開く
 			pBuf=ReadBuffer(temporary);
@@ -56,5 +55,4 @@
 	else{
 		//単体ソースコードのとき
-		extern MDIINFO MdiInfo[MAX_WNDNUM];
 		int WndNum;
 
@@ -682,5 +680,4 @@
 void ShowParameterHint(int WndNum){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern METHODCHECKINFO MethodCheckInfo;
 	int i,i2,i3,IsStr,IsComment,PareNum,iPos;
@@ -1238,5 +1235,4 @@
 		extern HINSTANCE hInst;
 		extern METHODCHECKINFO MethodCheckInfo;
-		extern MDIINFO MdiInfo[MAX_WNDNUM];
 		HDC hdc,memdc;
 		RECT rect,rc2;
Index: trunk/ab5.0/abdev/abdev/ProjectControl.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/ProjectControl.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/ProjectControl.cpp	(revision 625)
@@ -42,5 +42,4 @@
 LRESULT CALLBACK TabProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern LPSTR DefFileFilter;
 	int i,i2,WndNum;
@@ -1057,5 +1056,4 @@
 		windowInfos.push_back( new ActiveBasic::PM::WindowInfo() );
 		windowInfos.back()->SetName( "MainWnd" );
-		windowInfos.back()->SetHandleName( "hMainWnd" );
 		windowInfos.back()->pos.x=CW_USEDEFAULT;
 		windowInfos.back()->pos.y=CW_USEDEFAULT;
@@ -1077,7 +1075,5 @@
 		windowInfos.back()->SetIconResourceName( "" );
 		windowInfos.back()->SetClassName( "NORMAL" );
-		windowInfos.back()->CallBackName="MainWndProc";
-		windowInfos.back()->type=WNDTYPE_DEFAULT;
-		windowInfos.back()->filepath="MainWnd.ab";
+		windowInfos.back()->SetType( ActiveBasic::PM::WindowType::Default );
 		sprintf(temporary,"%s%s.wnd",dir,NewProjectInfo.name);
 
@@ -1244,5 +1240,4 @@
 	//////////////////////////////////////////
 	//ワークファイル（*.wrk）をオープン
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HTREEITEM hTreeItem;
 	HANDLE hFind;
@@ -1571,5 +1566,4 @@
 }
 BOOL ProjectModifyCheck(BOOL bRun){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,WndNum,sw;
 	HWND hChild;
@@ -1601,5 +1595,5 @@
 				for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){
 					projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
-					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) sw=1;
+					if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0) sw=1;
 				}
 			}
@@ -1611,5 +1605,5 @@
 					lstrcpy(temporary,resourceItem.filepath.c_str());
 					lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
-					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) sw=1;
+					if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0) sw=1;
 				}
 			}
@@ -1639,5 +1633,4 @@
 }
 void MakeWorkFile(void){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,WndNum;
 	char temporary[MAX_PATH],buffer[32767];
@@ -1658,5 +1651,5 @@
 			for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){
 				projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
-				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+				if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0){
 					TextEdit_GetSel(WndNum,&CharRange);
 
@@ -1684,6 +1677,6 @@
 			BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 			{
-				if(lstrcmpi(MdiInfo[WndNum].path,pWindowInfo->GetName().c_str())==0){
-					sprintf(buffer+i2,"rad,%s\r\n",MdiInfo[WndNum].path);
+				if(lstrcmpi(MdiInfo[WndNum].path.c_str(),pWindowInfo->GetName().c_str())==0){
+					sprintf(buffer+i2,"rad,%s\r\n",MdiInfo[WndNum].path.c_str());
 					i2+=lstrlen(buffer+i2);
 					break;
@@ -1693,6 +1686,6 @@
 		else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
 			for(i=0;i<projectInfo.NumberOfMenu;i++){
-				if(lstrcmpi(MdiInfo[WndNum].path,projectInfo.pMenuInfo[i].IdName)==0){
-					sprintf(buffer+i2,"menu,%s\r\n",MdiInfo[WndNum].path);
+				if(lstrcmpi(MdiInfo[WndNum].path.c_str(),projectInfo.pMenuInfo[i].IdName)==0){
+					sprintf(buffer+i2,"menu,%s\r\n",MdiInfo[WndNum].path.c_str());
 					i2+=lstrlen(buffer+i2);
 					break;
@@ -1705,5 +1698,5 @@
 				lstrcpy(temporary,resourceItem.filepath.c_str());
 				lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
-				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+				if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0){
 					sprintf(buffer+i2,"icon,%s\r\n",resourceItem.filepath.c_str());
 					i2+=lstrlen(buffer+i2);
Index: trunk/ab5.0/abdev/abdev/RadProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/RadProc.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/RadProc.cpp	(revision 625)
@@ -8,5 +8,4 @@
 	extern HINSTANCE hInst,hResInst;
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	HWND hChild;
@@ -19,5 +18,5 @@
 		i=GetWndNum(hChild);
 		if(MdiInfo[i].DocType==WNDTYPE_RAD){
-			if(lstrcmpi(MdiInfo[i].path,windowInfo.GetName().c_str())==0) break;
+			if(lstrcmpi(MdiInfo[i].path.c_str(),windowInfo.GetName().c_str())==0) break;
 		}
 		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
@@ -81,57 +80,53 @@
 	//ウィンドウのID登録
 	HDC hdc;
-	for(i=0;i<MAX_WNDNUM;i++){
-		if(MdiInfo[i].hwnd==0){
-			MdiInfo[i].hwnd=hChild;
-			MdiInfo[i].DocType=WNDTYPE_RAD;
-			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,windowInfo.GetName().size()+1);
-			lstrcpy(MdiInfo[i].title,windowInfo.GetName().c_str());
-			MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,windowInfo.GetName().size()+1);
-			lstrcpy(MdiInfo[i].path,windowInfo.GetName().c_str());
-
-
-			////////////////////////////
-			// MDIRADINFO構造体をセット
-			////////////////////////////
-
-			MdiInfo[i].MdiRadInfo=(MDIRADINFO *)GlobalAlloc(GPTR,sizeof(MDIRADINFO));
-
-			MdiInfo[i].MdiRadInfo->hTools=hTools;
-			MdiInfo[i].MdiRadInfo->hProperty=hProperty;
-			MdiInfo[i].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW),hProperty,(DLGPROC)RadProperty_WindowProc);
-
-			SCROLLINFO ScrollInfo;
-			ScrollInfo.cbSize=sizeof(SCROLLINFO);
-			ScrollInfo.fMask=SIF_POS;
-			ScrollInfo.nPos=0;
-			SetScrollInfo(MdiInfo[i].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
-
-			MdiInfo[i].MdiRadInfo->hRad=hRad;
-
-			MdiInfo[i].MdiRadInfo->hSupport=hSupport;
-
-			hdc=GetDC(hRad);
-			MdiInfo[i].MdiRadInfo->hBitmap=CreateCompatibleBitmap(hdc,ScreenX*2,ScreenY*2);
-			MdiInfo[i].MdiRadInfo->hMemDC=CreateCompatibleDC(hdc);
-			MdiInfo[i].MdiRadInfo->hOldBitmap=
-				(HBITMAP)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,MdiInfo[i].MdiRadInfo->hBitmap);
-			ReleaseDC(hRad,hdc);
-
-			for(i2=0;i2<MAX_RAD_SELITEM;i2++) MdiInfo[i].MdiRadInfo->SelectingItem[i2]=-1;
-			MdiInfo[i].MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE;
-
-			//変更情報を初期化
-			MdiInfo[i].MdiRadInfo->undo.NowPos=0;
-			memset(MdiInfo[i].MdiRadInfo->undo.Command,0,sizeof(int)*MAX_UNDONUM);
-
-
-			DrawRadWindow(i,&windowInfo);
-
-			//サポートダイアログの内容をセット
-			SetSupportDlgData(i,windowInfo);
-
-			break;
-		}
-	}
+	MdiInfo.push_back( MDIINFO() );
+	i = MdiInfo.size()-1;
+
+	MdiInfo[i].hwnd=hChild;
+	MdiInfo[i].DocType=WNDTYPE_RAD;
+	MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,windowInfo.GetName().size()+1);
+	lstrcpy(MdiInfo[i].title,windowInfo.GetName().c_str());
+	MdiInfo[i].path = windowInfo.GetName();
+
+
+	////////////////////////////
+	// MDIRADINFO構造体をセット
+	////////////////////////////
+
+	MdiInfo[i].MdiRadInfo=(MDIRADINFO *)GlobalAlloc(GPTR,sizeof(MDIRADINFO));
+
+	MdiInfo[i].MdiRadInfo->hTools=hTools;
+	MdiInfo[i].MdiRadInfo->hProperty=hProperty;
+	MdiInfo[i].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW),hProperty,(DLGPROC)RadProperty_WindowProc);
+
+	SCROLLINFO ScrollInfo;
+	ScrollInfo.cbSize=sizeof(SCROLLINFO);
+	ScrollInfo.fMask=SIF_POS;
+	ScrollInfo.nPos=0;
+	SetScrollInfo(MdiInfo[i].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
+
+	MdiInfo[i].MdiRadInfo->hRad=hRad;
+
+	MdiInfo[i].MdiRadInfo->hSupport=hSupport;
+
+	hdc=GetDC(hRad);
+	MdiInfo[i].MdiRadInfo->hBitmap=CreateCompatibleBitmap(hdc,ScreenX*2,ScreenY*2);
+	MdiInfo[i].MdiRadInfo->hMemDC=CreateCompatibleDC(hdc);
+	MdiInfo[i].MdiRadInfo->hOldBitmap=
+		(HBITMAP)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,MdiInfo[i].MdiRadInfo->hBitmap);
+	ReleaseDC(hRad,hdc);
+
+	for(i2=0;i2<MAX_RAD_SELITEM;i2++) MdiInfo[i].MdiRadInfo->SelectingItem[i2]=-1;
+	MdiInfo[i].MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE;
+
+	//変更情報を初期化
+	MdiInfo[i].MdiRadInfo->undo.NowPos=0;
+	memset(MdiInfo[i].MdiRadInfo->undo.Command,0,sizeof(int)*MAX_UNDONUM);
+
+	DrawRadWindow(i,&windowInfo);
+
+	//サポートダイアログの内容をセット
+	SetSupportDlgData(i,windowInfo);
+
 
 	ShowWindow(hSupport,SW_SHOW);
@@ -160,5 +155,4 @@
 
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,NewItemNum;
 	char temporary[MAX_PATH];
@@ -271,5 +265,4 @@
 void DeleteDlgItem(int WndNum,int WndInfoNum,int ItemNum,BOOL bNoticeChanging){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
@@ -335,5 +328,4 @@
 }
 void DrawFrame(HWND hwnd,int WndNum,int WndInfoNum,RECT *NewRect,RECT *OldRect,BOOL bLA){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	static int swLineStop;
 	int i,sw;
@@ -446,5 +438,4 @@
 }
 void GetSelectingRect(int WndNum,int WndInfoNum,int num,RECT *rect){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
@@ -466,5 +457,4 @@
 }
 void DrawSelectingRect(HWND hwnd,int WndNum,int WndInfoNum,int ButtonSelect){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern RADINFO RadInfo;
 	int i,i2,i3;
@@ -541,5 +531,4 @@
 }
 void ChangePropertyWindow(int WndNum,int WndInfoNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	RECT rect;
 	SCROLLINFO ScrollInfo;
@@ -603,5 +592,4 @@
 }
 int GetItemNumOnMouse(int WndNum,int WndInfoNum,int x,int y){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
@@ -648,5 +636,4 @@
 void SelectItemNumOnMouse(int WndNum,int WndInfoNum,int x,int y){
 	//マウス座標をもとにコントロールアイテムを選択
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
@@ -671,5 +658,4 @@
 }
 void SetItemNumOnFrame(int WndNum,int WndInfoNum,RECT *pRect){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,sw;
 	RECT rect;
@@ -696,5 +682,4 @@
 }
 int GetStateOfDraggingFrame(int WndNum,int WndInfoNum,int x,int y){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	RECT rect;
@@ -757,5 +742,4 @@
 }
 void ResetScrollbarOfRadEditor(int WndNum,int weight,int height){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	SCROLLINFO ScrollInfo;
 	SIZE NeedSize;
@@ -791,5 +775,4 @@
 }
 LRESULT CALLBACK RadWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern RADINFO RadInfo;
 	int i,i2,i3,i4;
@@ -1964,5 +1947,4 @@
 }
 void ResizeToRadToolWindows(int WndNum,int weight,int height){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	RECT rect;
@@ -2002,5 +1984,4 @@
 LRESULT CALLBACK MDIClientWindow_Rad(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,WndNum;
 
Index: trunk/ab5.0/abdev/abdev/RadSupport.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/RadSupport.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/RadSupport.cpp	(revision 625)
@@ -189,5 +189,4 @@
 	// サポートダイアログの内容をセット
 	////////////////////////////////////
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern RADINFO RadInfo;
 	char temporary[255];
@@ -268,5 +267,4 @@
 
 BOOL CALLBACK DlgRadSupport(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	static BOOL bTimer;
 	int i,i3;
Index: trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp	(revision 625)
@@ -100,5 +100,4 @@
 }
 BOOL CALLBACK RadToolButtonsProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,WndNum;
 	HWND hParent;
@@ -198,5 +197,4 @@
 }
 LRESULT CALLBACK RadToolsWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern HFONT hStatusFont;
 	int i;
@@ -352,5 +350,4 @@
 	extern HANDLE hHeap;
 	extern HWND hClient,hOwner;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i3;
 	char temporary[MAX_PATH],temp2[MAX_PATH];
@@ -361,14 +358,7 @@
 				i=GetWndNum(GetWindow(hClient,GW_CHILD));
 				ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
-				sprintf(temporary,"h%s",pWindowInfo->GetName().c_str());
-				sprintf(temp2,"%sProc",pWindowInfo->GetName().c_str());
-				if( pWindowInfo->GetHandleName() == temporary &&
-					lstrcmp(temp2,pWindowInfo->CallBackName)==0){
-					SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_SETCHECK,BST_CHECKED,0);
-					SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
-				}
 				SetDlgItemText(hwnd,IDC_WINDOWNAME,pWindowInfo->GetName().c_str());
-				SetDlgItemText(hwnd,IDC_WINDOWHANDLE,pWindowInfo->GetHandleName().c_str());
-				SetDlgItemText(hwnd,IDC_WINDOWPROC,pWindowInfo->CallBackName);
+				SetDlgItemText(hwnd,IDC_WINDOWHANDLE,( "h" + pWindowInfo->GetName() ).c_str());
+				SetDlgItemText(hwnd,IDC_WINDOWPROC,( pWindowInfo->GetName() + "Proc" ).c_str());
 				break;
 			}
@@ -402,16 +392,6 @@
 						names.name = temporary;
 
-						i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWHANDLE))+1;
-						GetDlgItemText(hwnd,IDC_WINDOWHANDLE,temporary,i3);
-						names.HandleName = temporary;
-
-						i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWPROC))+1;
-						names.CallBackName=(char *)HeapAlloc(hHeap,0,i3);
-						GetDlgItemText(hwnd,IDC_WINDOWPROC,names.CallBackName,i3);
-
-						if( names.name == pWindowInfo->GetName() &&
-							pWindowInfo->GetHandleName() == names.HandleName &&
-							lstrcmp(names.CallBackName,pWindowInfo->CallBackName)==0){
-							HeapDefaultFree(names.CallBackName);
+						if( names.name == pWindowInfo->GetName() )
+						{
 							SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
 							return 1;
@@ -423,17 +403,8 @@
 						//変更情報を更新
 						NoticeNames.name=pWindowInfo->GetName();
-						NoticeNames.HandleName=pWindowInfo->GetHandleName();
-						NoticeNames.CallBackName=pWindowInfo->CallBackName;
 						Rad_NoticeChanging(i,RAD_UNDO_NAME,SELECT_WINDOW,(DWORD)&NoticeNames);
 
 						pWindowInfo->SetName( names.name );
-						GlobalFree(MdiInfo[i].path);
-						MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,names.name.size()+1);
-						lstrcpy(MdiInfo[i].path,names.name.c_str());
-
-						pWindowInfo->SetHandleName( names.HandleName );
-
-						HeapDefaultFree(pWindowInfo->CallBackName);
-						pWindowInfo->CallBackName=names.CallBackName;
+						MdiInfo[i].path = names.name;
 
 						EndDialog(hwnd,1);
@@ -444,10 +415,5 @@
 					return 1;
 				case IDC_WINDOWNAME:
-					if(HIWORD(wParam)==EN_CHANGE) SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
-					return 1;
-				case IDC_AUTOSET:
-					if(SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_GETCHECK,0,0)){
-						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,1,0);
-						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,1,0);
+					{
 						GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,MAX_PATH);
 						if(temporary[0]){
@@ -462,8 +428,4 @@
 						}
 					}
-					else{
-						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,0,0);
-						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,0,0);
-					}
 					return 1;
 			}
@@ -473,5 +435,4 @@
 }
 BOOL CALLBACK DlgRadProperty_Window_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
@@ -544,5 +505,4 @@
 BOOL CALLBACK RadProperty_WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i3,i4;
 	static BOOL bInitial;
@@ -568,6 +528,6 @@
 					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)resourceItem.idName.c_str());
 				}
-				if(pWindowInfo->type==WNDTYPE_MODALDLG||
-					pWindowInfo->type==WNDTYPE_MODELESSDLG){
+				if( pWindowInfo->IsModalDlg() || pWindowInfo->IsModelessDlg() )
+				{
 					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0);
 					EnableWindow(GetDlgItem(hwnd,IDC_BGCOLOR),0);
@@ -688,14 +648,19 @@
 				//////////
 				//タイプ
-				switch(pWindowInfo->type){
-					case WNDTYPE_DEFAULT:
-						SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_SETCHECK,BST_CHECKED,0);
-						break;
-					case WNDTYPE_MODALDLG:
-						SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0);
-						break;
-					case WNDTYPE_MODELESSDLG:
-						SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_SETCHECK,BST_CHECKED,0);
-						break;
+				if( pWindowInfo->IsDefaultWindow() )
+				{
+					SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_SETCHECK,BST_CHECKED,0);
+				}
+				else if( pWindowInfo->IsModalDlg() )
+				{
+					SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0);
+				}
+				else if( pWindowInfo->IsModelessDlg() )
+				{
+					SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_SETCHECK,BST_CHECKED,0);
+				}
+				else
+				{
+					throw;
 				}
 
@@ -1115,12 +1080,18 @@
 
 						//変更情報
-						Rad_NoticeChanging(i,RAD_UNDO_TYPE,SELECT_WINDOW,pWindowInfo->type);
+						Rad_NoticeChanging(i,RAD_UNDO_TYPE,SELECT_WINDOW,(DWORD)pWindowInfo->GetType());
 
 						if(SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_GETCHECK,0,0))
-							pWindowInfo->type=WNDTYPE_DEFAULT;
+						{
+							pWindowInfo->SetType( ActiveBasic::PM::WindowType::Default );
+						}
 						else if(SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_GETCHECK,0,0))
-							pWindowInfo->type=WNDTYPE_MODALDLG;
+						{
+							pWindowInfo->SetType( ActiveBasic::PM::WindowType::ModalDlg );
+						}
 						else if(SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_GETCHECK,0,0))
-							pWindowInfo->type=WNDTYPE_MODELESSDLG;
+						{
+							pWindowInfo->SetType( ActiveBasic::PM::WindowType::ModelessDlg );
+						}
 						return 1;
 					}
@@ -1134,5 +1105,4 @@
 BOOL CALLBACK DlgRadProperty_Item_RenameCaption(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i3;
 	char *temporary;
@@ -1267,5 +1237,4 @@
 	extern HANDLE hHeap;
 	extern HWND hClient,hOwner;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i3;
 	char *temporary;
@@ -1323,5 +1292,4 @@
 BOOL DefaultItemStyles(HWND hwnd,int WndNum,int WndInfoNum,WPARAM wParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
@@ -1389,5 +1357,4 @@
 }
 BOOL CALLBACK DlgRadProperty_Item_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
@@ -1451,5 +1418,4 @@
 
 BOOL CALLBACK RadProperty_ButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -1673,5 +1639,4 @@
 // CHECKBOX プロパティ
 BOOL CALLBACK RadProperty_CheckBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -1964,5 +1929,4 @@
 }
 BOOL CALLBACK RadProperty_ComboBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -2232,5 +2196,4 @@
 }
 BOOL CALLBACK RadProperty_EditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -2518,5 +2481,4 @@
 
 BOOL CALLBACK RadProperty_GroupBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -2670,5 +2632,4 @@
 BOOL CALLBACK RadProperty_ImageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	char temporary[MAX_PATH];
@@ -3066,5 +3027,4 @@
 // LISTVIEW プロパティ
 BOOL CALLBACK RadProperty_ListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -3358,5 +3318,4 @@
 }
 BOOL CALLBACK RadProperty_ListBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -3616,5 +3575,4 @@
 // PROGRESSBAR プロパティ
 BOOL CALLBACK RadProperty_ProgressBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	static BOOL bInitial;
@@ -3701,5 +3659,4 @@
 
 BOOL CALLBACK RadProperty_RadioButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -3935,5 +3892,4 @@
 
 BOOL CALLBACK RadProperty_ScrollBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -4020,5 +3976,4 @@
 
 BOOL CALLBACK RadProperty_StaticProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -4151,5 +4106,4 @@
 // TRACKBAR プロパティ
 BOOL CALLBACK RadProperty_TrackBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -4304,5 +4258,4 @@
 // TREEVIEW プロパティ
 BOOL CALLBACK RadProperty_TreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	static BOOL bInitial;
@@ -4516,5 +4469,4 @@
 // UPDOWN プロパティ
 BOOL CALLBACK RadProperty_UpDownProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -4689,5 +4641,4 @@
 
 LRESULT CALLBACK RadPropertyWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	RECT rect;
Index: trunk/ab5.0/abdev/abdev/Rad_UndoRedo.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Rad_UndoRedo.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Rad_UndoRedo.cpp	(revision 625)
@@ -5,8 +5,6 @@
 void Rad_UndoCommand(int WndNum){
 	extern HINSTANCE hInst;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	DWORD dw;
-	char *temporary;
 	RAD_UNDOSTATE *pUndoState;
 
@@ -47,15 +45,5 @@
 				names->name = tempStr;
 
-				GlobalFree(MdiInfo[WndNum].path);
-				MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,pWindowInfo->GetName().size()+1);
-				lstrcpy(MdiInfo[WndNum].path,pWindowInfo->GetName().c_str());
-
-				tempStr = pWindowInfo->GetHandleName();
-				pWindowInfo->SetHandleName( names->HandleName );
-				names->HandleName = tempStr;
-
-				temporary=pWindowInfo->CallBackName;
-				pWindowInfo->CallBackName=names->CallBackName;
-				names->CallBackName=temporary;
+				MdiInfo[WndNum].path = pWindowInfo->GetName();
 			}
 			else{
@@ -195,7 +183,8 @@
 			break;
 		case RAD_UNDO_TYPE:
-			dw=pWindowInfo->type;
-			pWindowInfo->type=pUndoState->lpdwData[pUndoState->NowPos];
+			dw=(DWORD)pWindowInfo->GetType();
+			pWindowInfo->SetType( (ActiveBasic::PM::WindowType::EnumType)pUndoState->lpdwData[pUndoState->NowPos] );
 			pUndoState->lpdwData[pUndoState->NowPos]=dw;
+
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
 				ChangePropertyWindow(WndNum,WndInfoNum);
@@ -209,7 +198,5 @@
 void Rad_RedoCommand(int WndNum){
 	extern HINSTANCE hInst;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	DWORD dw;
-	char *temporary;
 	RAD_UNDOSTATE *pUndoState;
 	ActiveBasic::PM::ChildWindowInfo *pChildInfo;
@@ -247,15 +234,5 @@
 				names->name = tempStr;
 
-				GlobalFree(MdiInfo[WndNum].path);
-				MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,pWindowInfo->GetName().size()+1);
-				lstrcpy(MdiInfo[WndNum].path,pWindowInfo->GetName().c_str());
-
-				tempStr = pWindowInfo->GetHandleName();
-				pWindowInfo->SetHandleName( names->HandleName );
-				names->HandleName = tempStr;
-
-				temporary=pWindowInfo->CallBackName;
-				pWindowInfo->CallBackName=names->CallBackName;
-				names->CallBackName=temporary;
+				MdiInfo[WndNum].path = pWindowInfo->GetName();
 			}
 			else{
@@ -394,7 +371,8 @@
 			}
 		case RAD_UNDO_TYPE:
-			dw=pWindowInfo->type;
-			pWindowInfo->type=pUndoState->lpdwData[pUndoState->NowPos];
+			dw=(DWORD)pWindowInfo->GetType();
+			pWindowInfo->SetType( (ActiveBasic::PM::WindowType::EnumType)pUndoState->lpdwData[pUndoState->NowPos] );
 			pUndoState->lpdwData[pUndoState->NowPos]=dw;
+
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
 				ChangePropertyWindow(WndNum,WndInfoNum);
@@ -411,5 +389,4 @@
 void Rad_DeleteUndoData(int WndNum,int pos){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	RAD_UNDOSTATE *pUndoState;
 
@@ -425,5 +402,4 @@
 			if(pUndoState->SelectItemNum[pos]==SELECT_WINDOW){
 				RAD_UNDOSTATE_NAME *names = (RAD_UNDOSTATE_NAME *)pUndoState->lpdwData[pos];
-				HeapDefaultFree(names->CallBackName);
 				delete names;
 			}
@@ -471,5 +447,4 @@
 void Rad_NoticeChanging(int WndNum,int Command,int SelectItemNum,DWORD dwData){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	RAD_UNDOSTATE *pUndoState;
@@ -510,7 +485,4 @@
 				RAD_UNDOSTATE_NAME *SaveNames = new RAD_UNDOSTATE_NAME();
 				SaveNames->name = names->name;
-				SaveNames->HandleName = names->HandleName;
-				SaveNames->CallBackName=(char *)HeapAlloc(hHeap,0,lstrlen(names->CallBackName)+1);
-				lstrcpy(SaveNames->CallBackName,names->CallBackName);
 				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)SaveNames;
 			}
Index: trunk/ab5.0/abdev/abdev/Replace.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Replace.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Replace.cpp	(revision 625)
@@ -5,5 +5,4 @@
 void TextEdit_ResetWordColor(int WndNum,CHARRANGE *pCharRange,int DocType){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,IsStr;
 	char *pBuf,*pTemp;
@@ -82,5 +81,4 @@
 void TextEdit_Replace(int WndNum,char *str,BOOL bRedraw){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	CHARRANGE Range,DelRange;
 
@@ -116,5 +114,5 @@
 	if( projectInfo.IsOpened() ){
 		projectInfo.pobj_DBBreakPoint->replace(
-			MdiInfo[WndNum].path,
+			MdiInfo[WndNum].path.c_str(),
 			MdiInfo[WndNum].pMdiTextEdit->buffer,
 			&DelRange,
@@ -125,5 +123,5 @@
 		extern CDBBreakPoint *pobj_DBBreakPoint;
 		pobj_DBBreakPoint->replace(
-			MdiInfo[WndNum].path,
+			MdiInfo[WndNum].path.c_str(),
 			MdiInfo[WndNum].pMdiTextEdit->buffer,
 			&DelRange,
@@ -190,5 +188,4 @@
 void TextEdit_ReplaceUpdateUndoData(int WndNum,char *str,BOOL bPaste,BOOL bRedraw){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int Command;
 	char *KeyStr,*DelStr;
Index: trunk/ab5.0/abdev/abdev/Resource.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Resource.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Resource.cpp	(revision 625)
@@ -161,6 +161,5 @@
 	////////////////////////////////
 	// ウィンドウ プロパティを更新
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
-	for(i2=0;i2<MAX_WNDNUM;i2++){
+	for(i2=0;i2<MdiInfo.size();i2++){
 		if(MdiInfo[i2].hwnd&&MdiInfo[i2].DocType==WNDTYPE_RAD){
 			if(MdiInfo[i2].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
@@ -269,6 +268,5 @@
 	////////////////////////////////
 	// ウィンドウ プロパティを更新
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
-	for(i2=0;i2<MAX_WNDNUM;i2++){
+	for(i2=0;i2<MdiInfo.size();i2++){
 		if(MdiInfo[i2].hwnd&&MdiInfo[i2].DocType==WNDTYPE_RAD){
 			if(MdiInfo[i2].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
@@ -304,6 +302,5 @@
 	////////////////////////////////
 	// ウィンドウ プロパティを更新
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
-	for(i2=0;i2<MAX_WNDNUM;i2++){
+	for(i2=0;i2<MdiInfo.size();i2++){
 		if(MdiInfo[i2].hwnd&&MdiInfo[i2].DocType==WNDTYPE_RAD){
 			if(MdiInfo[i2].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
Index: trunk/ab5.0/abdev/abdev/Search.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Search.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/Search.cpp	(revision 625)
@@ -27,5 +27,4 @@
 void SetSearchData(HWND hDlg,char *str,_int8 IsBigSmall, bool isWordUnit){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3,i4,i5,length;
 	int WndNum;
@@ -82,5 +81,4 @@
 }
 BOOL CALLBACK DlgFindAll(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,WndNum;
 
@@ -139,5 +137,4 @@
 }
 BOOL StartSearch(HWND hDlg,char *FindString,_int8 IsBigSmall, bool isWordUnit, BOOL IsShowMessage){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	char *pBuf,msg[255];
@@ -213,5 +210,4 @@
 BOOL CALLBACK DlgFind(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HWND FindAllDlg;
 	int i,WndNum;
@@ -314,5 +310,4 @@
 	extern HANDLE hHeap;
 	extern HINSTANCE hInst;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	int WndNum;
Index: trunk/ab5.0/abdev/abdev/SubOperation.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/SubOperation.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/SubOperation.cpp	(revision 625)
@@ -891,7 +891,6 @@
 	if(bRedraw){
 		//再描画
-		extern MDIINFO MdiInfo[MAX_WNDNUM];
 		int i;
-		for(i=0;i<MAX_WNDNUM;i++){
+		for(i=0;i<MdiInfo.size();i++){
 			if(MdiInfo[i].hwnd){
 				if(IS_DOCUMENT_TEXT(MdiInfo[i].DocType)){
@@ -1456,5 +1455,4 @@
 //実行コマンド
 BOOL SetRunning(HWND hChild){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern LPSTR DefFileFilter;
 	int WndNum;
@@ -1474,5 +1472,5 @@
 	WndNum=GetWndNum(hChild);
 	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
-		if(MdiInfo[WndNum].path[0]=='\0'){
+		if(MdiInfo[WndNum].path.empty()){
 			//"保存先のファイルを指定してください"
 			if(!GetFilePathDialog(hOwner,temp2,DefFileFilter,STRING_FILESAVETITLE_DEFAULT,0)) return FALSE;
@@ -1485,5 +1483,5 @@
 			}
 			else{
-				if(hFind=FindFirstFile(MdiInfo[WndNum].path,&wfd)){
+				if(hFind=FindFirstFile(MdiInfo[WndNum].path.c_str(),&wfd)){
 					if(hFind==INVALID_HANDLE_VALUE){
 						if(!SaveDocument(hChild,NULL)) return 0;
@@ -1497,5 +1495,6 @@
 }
 
-BOOL IsNeedCompile(char *FileName,BOOL bDebug){
+BOOL IsNeedCompile( const std::string &filepath, BOOL bDebug )
+{
 	char temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH];
 	HANDLE hFind,hFile;
@@ -1503,5 +1502,5 @@
 	FILETIME SourceTime,ExeTime;
 
-	_splitpath(FileName,temporary,temp2,temp3,NULL);
+	_splitpath(filepath.c_str(),temporary,temp2,temp3,NULL);
 	lstrcat(temporary,temp2);
 	lstrcat(temporary,temp3);
@@ -1513,5 +1512,5 @@
 	FindClose(hFind);
 
-	hFile=CreateFile(FileName,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	hFile=CreateFile(filepath.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
 	GetFileTime(hFile,NULL,NULL,&SourceTime);
 	CloseHandle(hFile);
Index: trunk/ab5.0/abdev/abdev/TabCtrl.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/TabCtrl.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/TabCtrl.cpp	(revision 625)
@@ -261,6 +261,5 @@
 	}
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
-	for(i=0;i<MAX_WNDNUM;i++){
+	for(i=0;i<MdiInfo.size();i++){
 		if(lstrcmpi(ItemText,MdiInfo[i].title)==0) break;
 	}
Index: trunk/ab5.0/abdev/abdev/TextEditor.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/TextEditor.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/TextEditor.cpp	(revision 625)
@@ -9,5 +9,4 @@
 int GetControlTabSpace(int WndNum,int *piCount){
 	if(pobj_nv->bEditor_LineNumber){
-		extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 		char *pBuf;
@@ -82,5 +81,4 @@
 }
 void SetTextEditWordColor(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3,IsStr;
 	char str[255];
@@ -153,5 +151,4 @@
 }
 void ResetScrollbar(int WndNum,int max_x,int max_y){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	RECT rect;
 
@@ -215,5 +212,4 @@
 }
 void TextEdit_GetWordCaret(HWND hwnd,int WndNum,POINT *pPos,int *piStart,int *piEnd,BOOL bBeforeAfterFlag){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,start,end;
 	char *pBuf;
@@ -328,5 +324,4 @@
 }
 void CancelBeforeAutoIndent(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
Index: trunk/ab5.0/abdev/abdev/TextEditor_EventProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/TextEditor_EventProc.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/TextEditor_EventProc.cpp	(revision 625)
@@ -30,5 +30,4 @@
 	extern HANDLE hHeap;
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	static DWORD dwAutoScroll;
 	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
Index: trunk/ab5.0/abdev/abdev/TextEditor_KeyEvent.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/TextEditor_KeyEvent.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/TextEditor_KeyEvent.cpp	(revision 625)
@@ -156,5 +156,4 @@
 
 int TextEdit_GetLineIndex(int WndNum,int iPos){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	char *pBuf;
Index: trunk/ab5.0/abdev/abdev/TextEditor_MouseEvent.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/TextEditor_MouseEvent.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/TextEditor_MouseEvent.cpp	(revision 625)
@@ -152,5 +152,4 @@
 	//////////////////////////////
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int WndNum;
 	POINT pos;
Index: trunk/ab5.0/abdev/abdev/TextEditor_UndoRedo.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/TextEditor_UndoRedo.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/TextEditor_UndoRedo.cpp	(revision 625)
@@ -4,5 +4,4 @@
 
 void TextEdit_UndoCommand(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	TEXTEDIT_UNDOSTATE *pUndoState;
@@ -48,5 +47,4 @@
 }
 void TextEdit_RedoCommand(int WndNum){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	TEXTEDIT_UNDOSTATE *pUndoState;
 
@@ -106,5 +104,4 @@
 void TextEdit_NoticeChanging(int WndNum,int Command,char *KeyStr,char *DelStr,CHARRANGE *Range,CHARRANGE *DelRange){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	TEXTEDIT_UNDOSTATE *pUndoState;
Index: trunk/ab5.0/abdev/abdev/WebSearch.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/WebSearch.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/WebSearch.cpp	(revision 625)
@@ -590,5 +590,4 @@
 
 
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult->add(WndNum,str);
 
@@ -863,5 +862,4 @@
 
 void CSideWeb::SelChangeEvent(){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	char temporary[MAX_PATH];
 
Index: trunk/ab5.0/abdev/abdev/WindowControl.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/WindowControl.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/WindowControl.cpp	(revision 625)
@@ -13,15 +13,16 @@
 #endif
 
-int GetWndInfoNum(char *name){
+int GetWndInfoNum( const std::string &name )
+{
 	for( int i=0;i<static_cast<int>(projectInfo.windowInfos.size());i++){
-		if(lstrcmpi(name,projectInfo.windowInfos[i]->GetName().c_str())==0) return i;
+		if(lstrcmpi(name.c_str(),projectInfo.windowInfos[i]->GetName().c_str())==0) return i;
 	}
 	return -1;
 }
-ActiveBasic::PM::WindowInfo *GetWndInfo( char *name )
+ActiveBasic::PM::WindowInfo *GetWndInfo( const std::string &name )
 {
 	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
-		if(lstrcmpi(name,pWindowInfo->GetName().c_str())==0) return pWindowInfo;
+		if(lstrcmpi(name.c_str(),pWindowInfo->GetName().c_str())==0) return pWindowInfo;
 	}
 	return NULL;
@@ -66,5 +67,4 @@
 HGLOBAL Rad_GetChildInfoClipboardData(int WndNum,int WndInfoNum){
 	//ChildWindowInfo構造体をクリップボード用データ（pByteが示すバッファ）に変換する
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HGLOBAL hGlobal;
 	BYTE *pByte;
@@ -141,5 +141,4 @@
 void Rad_PasteChildInfoClipboardData(int WndNum,HGLOBAL hGlobal){
 	//hGlobalに格納されているクリップボードデータをRAD画面に挿入する
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	BYTE *pByte;
 	int i2,i3,WndInfoNum;
@@ -307,4 +306,16 @@
 
 	return pBuf;
+}
+const std::string PermutationWndPgmTemplate( const std::string &templateFilePath, const std::string &projectName, const std::string &windowName, const std::string &handleName, const std::string &procName )
+{
+	Jenga::Common::SourceTemplate sourceTemplate( templateFilePath );
+	Jenga::Common::SourceTemplate::Values values;
+
+	values.Insert( "#name#", projectName );
+	values.Insert( "#window#", windowName );
+	values.Insert( "#handle#", handleName );
+	values.Insert( "#procedure#", procName );
+
+	return sourceTemplate.GetResult( values );
 }
 
@@ -535,7 +546,12 @@
 	}
 	else if(lstrcmp(MessageName,"Create")==0){
-		if(pWindowInfo->type==WNDTYPE_MODALDLG||pWindowInfo->type==WNDTYPE_MODELESSDLG)
+		if( pWindowInfo->IsModalDlg() || pWindowInfo->IsModelessDlg() )
+		{
 			sprintf(Command,"%sCase WM_INITDIALOG\r\n",spaces);
-		else sprintf(Command,"%sCase WM_CREATE\r\n",spaces);
+		}
+		else
+		{
+			sprintf(Command,"%sCase WM_CREATE\r\n",spaces);
+		}
 		i=lstrlen(Command);
 
@@ -833,12 +849,18 @@
 		sprintf(Command+i,"%s\tDim cancel=0 As Integer\r\n",spaces);
 		i+=lstrlen(Command+i);
-		if(bProcedureCall){
+		if(bProcedureCall)
+		{
 			sprintf(Command+i,"%s\t%s_%s(cancel)\r\n",spaces,pWindowInfo->GetName().c_str(),MessageName);
 			i+=lstrlen(Command+i);
 		}
-		if(pWindowInfo->type==WNDTYPE_MODALDLG)
+
+		if( pWindowInfo->IsModalDlg() )
+		{
 			sprintf(Command+i,"%s\tIf cancel=0 Then EndDialog(hWnd,0)\r\n",spaces);
+		}
 		else
+		{
 			sprintf(Command+i,"%s\tIf cancel=0 Then DestroyWindow(hWnd)\r\n",spaces);
+		}
 		return WM_CLOSE;
 	}
@@ -1362,5 +1384,6 @@
 	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
-		if(pWindowInfo->type==WNDTYPE_MODALDLG){
+		if( pWindowInfo->IsModalDlg() )
+		{
 			if(sw1==0){
 				sprintf(buffer+i2,"\tIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",pWindowInfo->GetName().c_str());
@@ -1388,5 +1411,5 @@
 				sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(%s) As LONG_PTR)\r\n",
 					pWindowInfo->GetHandleName().c_str(),
-					pWindowInfo->CallBackName);
+					pWindowInfo->GetCallbackName().c_str());
 			}
 			else{
@@ -1461,5 +1484,6 @@
 	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
-		if(pWindowInfo->type==WNDTYPE_MODELESSDLG){
+		if( pWindowInfo->IsModelessDlg() )
+		{
 			sprintf(buffer+i2,"\tIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",pWindowInfo->GetName().c_str());
 			i2+=lstrlen(buffer+i2);
@@ -1480,5 +1504,5 @@
 				sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(%s) As LONG_PTR)\r\n",
 					pWindowInfo->GetHandleName().c_str(),
-					pWindowInfo->CallBackName);
+					pWindowInfo->GetCallbackName().c_str());
 			}
 			else{
@@ -1534,5 +1558,6 @@
 	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
-		if(pWindowInfo->type==WNDTYPE_DEFAULT){
+		if( pWindowInfo->IsDefaultWindow() )
+		{
 			//////////////////////
 			//通常ウィンドウ作成
@@ -1558,5 +1583,5 @@
 			i2+=lstrlen(buffer+i2);
 			if(bAvailUserProc[i])
-				sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(%s)\r\n",pWindowInfo->CallBackName);
+				sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(%s)\r\n",pWindowInfo->GetCallbackName().c_str());
 			else sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(EventCall_%s)\r\n",pWindowInfo->GetName().c_str());
 			i2+=lstrlen(buffer+i2);
@@ -1631,5 +1656,4 @@
 {
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,size;
 	char *buffer,*temporary;
@@ -1638,9 +1662,7 @@
 	buffer=(char *)HeapAlloc(hHeap,0,GENERAL_SIZE*size);
 	i2=0;
-	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, windowInfos )
 	{
 		sprintf(buffer+i2,"WINDOW:%s\r\n",pWindowInfo->GetName().c_str());
-		i2+=lstrlen(buffer+i2);
-		sprintf(buffer+i2,"    HANDLE    = %s\r\n",pWindowInfo->GetHandleName().c_str());
 		i2+=lstrlen(buffer+i2);
 		sprintf(buffer+i2,"    POINT     = %d,%d\r\n",pWindowInfo->pos.x,pWindowInfo->pos.y);
@@ -1684,9 +1706,5 @@
 		sprintf(buffer+i2,"    CLASS     = \"%s\"\r\n",pWindowInfo->GetClassName().c_str());
 		i2+=lstrlen(buffer+i2);
-		sprintf(buffer+i2,"    CALLBACK  = %s\r\n",pWindowInfo->CallBackName);
-		i2+=lstrlen(buffer+i2);
-		sprintf(buffer+i2,"    TYPE      = %d\r\n",pWindowInfo->type);
-		i2+=lstrlen(buffer+i2);
-		sprintf(buffer+i2,"    FILEPATH  = %s\r\n",pWindowInfo->filepath);
+		sprintf(buffer+i2,"    TYPE      = %d\r\n",(DWORD)pWindowInfo->GetType());
 		i2+=lstrlen(buffer+i2);
 		BOOST_FOREACH( const ActiveBasic::PM::ChildWindowInfo *pChildInfo, pWindowInfo->childWindowInfos )
@@ -1887,5 +1905,5 @@
 			}
 			else if(lstrcmpi(temporary,"HANDLE")==0&&i3==1){
-				projectInfo.windowInfos.back()->SetHandleName( temp2 );
+				//無視
 			}
 			else if(lstrcmpi(temporary,"POINT")==0&&i3==1){
@@ -1977,16 +1995,16 @@
 				}
 			}
-			else if(lstrcmpi(temporary,"CALLBACK")==0&&i3==1){
-				projectInfo.windowInfos.back()->CallBackName=(char *)HeapAlloc(hHeap,0,i2+1);
-				lstrcpy(projectInfo.windowInfos.back()->CallBackName,temp2);
+			else if(lstrcmpi(temporary,"CALLBACK")==0&&i3==1)
+			{
+				// 無視
 			}
 
 			//以前のバージョンとの互換用
-			else if(lstrcmpi(temporary,"DLGTMP")==0&&i3==1) projectInfo.windowInfos.back()->type=GetValue(temp2);
-
-			else if(lstrcmpi(temporary,"TYPE")==0&&i3==1) projectInfo.windowInfos.back()->type=GetValue(temp2);
-			else if(lstrcmpi(temporary,"FILEPATH")==0&&i3==1){
-				projectInfo.windowInfos.back()->filepath=(char *)HeapAlloc(hHeap,0,i2+1);
-				lstrcpy(projectInfo.windowInfos.back()->filepath,temp2);
+			else if(lstrcmpi(temporary,"DLGTMP")==0&&i3==1) projectInfo.windowInfos.back()->SetType( (ActiveBasic::PM::WindowType::EnumType)GetValue(temp2) );
+
+			else if(lstrcmpi(temporary,"TYPE")==0&&i3==1) projectInfo.windowInfos.back()->SetType( (ActiveBasic::PM::WindowType::EnumType)GetValue(temp2) );
+			else if(lstrcmpi(temporary,"FILEPATH")==0&&i3==1)
+			{
+				// 無視
 			}
 			else if(lstrcmpi(temporary,"ITEM")==0&&i3==1){
@@ -2082,7 +2100,5 @@
 struct NEW_WINDOW{
 	char name[MAX_PATH];
-	char HandleName[MAX_PATH];
-	char CallBackName[MAX_PATH];
-	BOOL type;
+	ActiveBasic::PM::WindowType::EnumType type;
 };
 NEW_WINDOW NewWindow;
@@ -2092,6 +2108,4 @@
 		case WM_INITDIALOG:
 			SetPosCenter(hwnd);
-			SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_SETCHECK,BST_CHECKED,0);
-			SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
 			SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0);
 			break;
@@ -2100,12 +2114,16 @@
 				case IDOK:
 					GetDlgItemText(hwnd,IDC_WINDOWNAME,NewWindow.name,MAX_PATH);
-					GetDlgItemText(hwnd,IDC_WINDOWHANDLE,NewWindow.HandleName,MAX_PATH);
-					GetDlgItemText(hwnd,IDC_WINDOWPROC,NewWindow.CallBackName,MAX_PATH);
 					if(SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_GETCHECK,0,0))
-						NewWindow.type=WNDTYPE_DEFAULT;
+					{
+						NewWindow.type = ActiveBasic::PM::WindowType::Default;
+					}
 					else if(SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_GETCHECK,0,0))
-						NewWindow.type=WNDTYPE_MODALDLG;
+					{
+						NewWindow.type = ActiveBasic::PM::WindowType::ModalDlg;
+					}
 					else if(SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_GETCHECK,0,0))
-						NewWindow.type=WNDTYPE_MODELESSDLG;
+					{
+						NewWindow.type = ActiveBasic::PM::WindowType::ModelessDlg;
+					}
 					EndDialog(hwnd,1);
 					return 1;
@@ -2114,10 +2132,6 @@
 					return 1;
 				case IDC_WINDOWNAME:
-					if(HIWORD(wParam)==EN_CHANGE) SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
-					return 1;
-				case IDC_AUTOSET:
-					if(SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_GETCHECK,0,0)){
-						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,1,0);
-						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,1,0);
+					if(HIWORD(wParam)==EN_CHANGE)
+					{
 						GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,MAX_PATH);
 						if(temporary[0]){
@@ -2131,8 +2145,4 @@
 							SetDlgItemText(hwnd,IDC_WINDOWPROC,"");
 						}
-					}
-					else{
-						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,0,0);
-						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,0,0);
 					}
 					return 1;
@@ -2160,5 +2170,5 @@
 void Project_Window_Insert(void){
 	extern HANDLE hHeap;
-	char temporary[MAX_PATH],temp2[1024],*pTemp;
+	char temporary[MAX_PATH],temp2[1024];
 
 	if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_PROJECT_NEWWINDOW),hOwner,(DLGPROC)DlgProject_NewWindow)) return;
@@ -2179,16 +2189,4 @@
 			return;
 		}
-		if(lstrcmpi(NewWindow.HandleName,pWindowInfo->GetHandleName().c_str())==0){
-			//"\"%s\" ハンドルは既にプロジェクト内に存在します。"
-			sprintf(temporary,STRING_DUPLICATIONERROR_HANDLE_IN_PROJECT,pWindowInfo->GetHandleName().c_str());
-			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
-			return;
-		}
-		if(lstrcmpi(NewWindow.CallBackName,pWindowInfo->CallBackName)==0){
-			//"\"%s\" プロシージャは既にプロジェクト内に存在します。"
-			sprintf(temporary,STRING_DUPLICATIONERROR_PROC_IN_PROJECT,pWindowInfo->CallBackName);
-			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
-			return;
-		}
 	}
 
@@ -2202,7 +2200,4 @@
 	//ウィンドウ名
 	projectInfo.windowInfos.back()->SetName( NewWindow.name );
-
-	//ハンドル名
-	projectInfo.windowInfos.back()->SetHandleName( NewWindow.HandleName );
 
 	//位置情報
@@ -2217,10 +2212,10 @@
 	//スタイル
 	switch(NewWindow.type){
-		case WNDTYPE_DEFAULT:
+		case ActiveBasic::PM::WindowType::Default:
 			//通常ウィンドウ
 			projectInfo.windowInfos.back()->SetStyle( WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX );
 			break;
-		case WNDTYPE_MODALDLG:
-		case WNDTYPE_MODELESSDLG:
+		case ActiveBasic::PM::WindowType::ModalDlg:
+		case ActiveBasic::PM::WindowType::ModelessDlg:
 			//ダイアログ テンプレート（最大化、最小化ボタンをなくして、細枠にする）
 			projectInfo.windowInfos.back()->SetStyle( WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU );
@@ -2247,16 +2242,7 @@
 	projectInfo.windowInfos.back()->SetClassName( temporary );
 
-	//コールバック関数名
-	projectInfo.windowInfos.back()->CallBackName=(char *)HeapAlloc(hHeap,0,lstrlen(NewWindow.CallBackName)+1);
-	lstrcpy(projectInfo.windowInfos.back()->CallBackName,NewWindow.CallBackName);
-
 	//タイプ識別
-	projectInfo.windowInfos.back()->type=NewWindow.type;
-
-
-	//メッセージ処理ファイル名
-	sprintf(temporary,"%s.ab",projectInfo.windowInfos.back()->GetName().c_str());
-	projectInfo.windowInfos.back()->filepath=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-	lstrcpy(projectInfo.windowInfos.back()->filepath,temporary);
+	projectInfo.windowInfos.back()->SetType( NewWindow.type );
+
 
 
@@ -2265,22 +2251,19 @@
 	//////////////////////////
 
-	//テンプレートを読み込む
-	const std::string newWindowTemplateSbpPath = ActiveBasic::Common::Environment::GetAbdevSystemDirPath() + "\\new_window_template.sbp";
-	pTemp = ReadBuffer( newWindowTemplateSbpPath );
-
-	//#name#をプロジェクト名に置換
-	pTemp=PermutationWndPgmTemplate(pTemp,
-		projectInfo.GetName().c_str(),
-		NewWindow.name,
-		NewWindow.HandleName,
-		NewWindow.CallBackName);
+	// テンプレートを使ってMainWnd.abを生成する
+	const std::string resultStr = PermutationWndPgmTemplate(
+		ActiveBasic::Common::Environment::GetAbdevSystemDirPath() + "\\new_window_template.sbp",
+		projectInfo.GetName(),
+		(std::string)NewWindow.name,
+		(std::string)"h" + NewWindow.name,
+		(std::string)NewWindow.name + "Proc"
+	);
 
 	sprintf(temporary,"%s%s.ab",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.windowInfos.back()->GetName().c_str());
 
 	//書き込み
-	WriteBuffer(temporary,pTemp,lstrlen(pTemp));
+	WriteBuffer(temporary,resultStr.c_str(),resultStr.size());
 	Project_File_Insert(temporary);
 
-	HeapDefaultFree(pTemp);
 
 
@@ -2309,5 +2292,4 @@
 void Project_Window_Delete(int WndInfoNum){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
@@ -2315,14 +2297,10 @@
 
 	//ウィンドウが開かれている場合は閉じる
-	for(i=0;i<MAX_WNDNUM;i++){
-		if(MdiInfo[i].hwnd&&lstrcmpi(pWindowInfo->GetName().c_str(),MdiInfo[i].path)==0){
+	for(i=0;i<MdiInfo.size();i++){
+		if(MdiInfo[i].hwnd&&lstrcmpi(pWindowInfo->GetName().c_str(),MdiInfo[i].path.c_str())==0){
 			SendMessage(MdiInfo[i].hwnd,WM_CLOSE,0,0);
 			break;
 		}
 	}
-
-	//ウィンドウ情報のメモリを解放
-	HeapDefaultFree(pWindowInfo->filepath);
-	HeapDefaultFree(pWindowInfo->CallBackName);
 
 	//子ウィンドウのメモリを解放
Index: trunk/ab5.0/abdev/abdev/abdev.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/abdev.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/abdev.cpp	(revision 625)
@@ -99,8 +99,8 @@
 	int i;
 	if(!IsWindow(hChild)) return -1;
-	for(i=0;i<MAX_WNDNUM;i++){
+	for(i=0;i<MdiInfo.size();i++){
 		if(hChild==MdiInfo[i].hwnd) break;
 	}
-	if(i==MAX_WNDNUM) i=-1;
+	if(i==MdiInfo.size()) i=-1;
 	return i;
 }
@@ -119,5 +119,5 @@
 		projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
 
-		if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) return i;
+		if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0) return i;
 	}
 	return -1;
@@ -643,17 +643,20 @@
 	}
 	WndNum=GetWndNum(hChild);
-	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
-		pobj_MainMenu->EnableItem(IDM_PAGESET,MF_BYCOMMAND|MF_ENABLED);
-
-		pobj_MainMenu->EnableItem(IDM_PREVIEW,MF_BYCOMMAND|MF_ENABLED);
-
-		pobj_MainMenu->EnableItem(IDM_PRINTOUT,MF_BYCOMMAND|MF_ENABLED);
-	}
-	else{
-		pobj_MainMenu->EnableItem(IDM_PAGESET,MF_BYCOMMAND|MF_GRAYED);
-
-		pobj_MainMenu->EnableItem(IDM_PREVIEW,MF_BYCOMMAND|MF_GRAYED);
-
-		pobj_MainMenu->EnableItem(IDM_PRINTOUT,MF_BYCOMMAND|MF_GRAYED);
+	if( WndNum != -1 )
+	{
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+			pobj_MainMenu->EnableItem(IDM_PAGESET,MF_BYCOMMAND|MF_ENABLED);
+
+			pobj_MainMenu->EnableItem(IDM_PREVIEW,MF_BYCOMMAND|MF_ENABLED);
+
+			pobj_MainMenu->EnableItem(IDM_PRINTOUT,MF_BYCOMMAND|MF_ENABLED);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_PAGESET,MF_BYCOMMAND|MF_GRAYED);
+
+			pobj_MainMenu->EnableItem(IDM_PREVIEW,MF_BYCOMMAND|MF_GRAYED);
+
+			pobj_MainMenu->EnableItem(IDM_PRINTOUT,MF_BYCOMMAND|MF_GRAYED);
+		}
 	}
 }
@@ -722,5 +725,5 @@
 void DuplicateTitleCheck(char *lpszTitle){
 	int i;
-	for(i=0;i<MAX_WNDNUM;i++){
+	for(i=0;i<MdiInfo.size();i++){
 		if(MdiInfo[i].hwnd){
 			if(lstrcmpi(MdiInfo[i].title,lpszTitle)==0){
@@ -747,5 +750,5 @@
 			i=GetWndNum(hChild);
 			if(IS_DOCUMENT_TEXT(MdiInfo[i].DocType)){
-				if(lstrcmpi(MdiInfo[i].path,filepath)==0) break;
+				if(lstrcmpi(MdiInfo[i].path.c_str(),filepath)==0) break;
 			}
 			hChild=GetNextWindow(hChild,GW_HWNDNEXT);
@@ -890,53 +893,54 @@
 		hChild,NULL,hInst,NULL);
 
+
 	//ウィンドウのID登録
-	for(i=0;i<MAX_WNDNUM;i++){
-		if(MdiInfo[i].hwnd==0){
-			MdiInfo[i].hwnd=hChild;
-			MdiInfo[i].DocType=DocumentType;
-			DuplicateTitleCheck(str);
-			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(str)+1);
-			lstrcpy(MdiInfo[i].title,str);
-			if(filepath){
-				MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(filepath)+1);
-				lstrcpy(MdiInfo[i].path,filepath);
-			}
-			else{
-				MdiInfo[i].path=(char *)GlobalAlloc(GPTR,1);
-			}
-
-			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;
-
-			int flag;
-			if(mdic.style&WS_MAXIMIZE) flag=SIZE_MAXIMIZED;
-			else flag=0;
-			SendTextEditResizeEvent(hChild);
-			break;
-		}
-	}
+	MdiInfo.push_back( MDIINFO() );
+	i = MdiInfo.size()-1;
+	MdiInfo[i].hwnd=hChild;
+	MdiInfo[i].DocType=DocumentType;
+	MdiInfo[i].title="";
+	DuplicateTitleCheck(str);
+	MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(str)+1);
+	lstrcpy(MdiInfo[i].title,str);
+	if(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;
+
+
+	int flag;
+	if(mdic.style&WS_MAXIMIZE) flag=SIZE_MAXIMIZED;
+	else flag=0;
+	SendTextEditResizeEvent(hChild);
+
 
 	//ワードカラーをセット
-	if(IS_DOCUMENT_TEXT(DocumentType)) SetTextEditWordColor(i);
+	if(IS_DOCUMENT_TEXT(DocumentType)) SetTextEditWordColor(MdiInfo.size()-1);
 
 	//Docコンボボックスに追加
@@ -983,5 +987,4 @@
 
 	GlobalFree(MdiInfo[WndNum].title);
-	GlobalFree(MdiInfo[WndNum].path);
 
 	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
@@ -1063,4 +1066,10 @@
 		HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo);
 	}
+	else
+	{
+		throw;
+	}
+
+	Jenga::Common::EraseVectorItem<std::vector<MDIINFO>>( MdiInfo, WndNum );
 }
 void ResizeTextEditWnd(HWND hwnd,int cx,int cy){
@@ -1711,5 +1720,5 @@
 		if(!TranslateAccelerator(hOwner,hAccel,&msg)){
 			if( projectInfo.IsOpened() ){
-				for(i=0,i2=0;i<MAX_WNDNUM;i++){
+				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;
Index: trunk/ab5.0/abdev/abdev/abdev.h
===================================================================
--- trunk/ab5.0/abdev/abdev/abdev.h	(revision 624)
+++ trunk/ab5.0/abdev/abdev/abdev.h	(revision 625)
@@ -48,5 +48,5 @@
 HWND hClient;					//MDIクライアントウィンドウ
 HWND hStatusBar;				//ステータスバー
-MDIINFO MdiInfo[MAX_WNDNUM];	//MDIドキュメントウィンドウ情報
+std::vector<MDIINFO> MdiInfo;	//MDIドキュメントウィンドウ情報
 
 /* メニュー */
Index: trunk/ab5.0/abdev/abdev/abdev.vcproj
===================================================================
--- trunk/ab5.0/abdev/abdev/abdev.vcproj	(revision 624)
+++ trunk/ab5.0/abdev/abdev/abdev.vcproj	(revision 625)
@@ -433,4 +433,12 @@
 					>
 				</File>
+				<Filter
+					Name="PartialManager"
+					>
+					<File
+						RelativePath=".\src\WindowComponents\PartialManager\TextEditPartialManager.cpp"
+						>
+					</File>
+				</Filter>
 			</Filter>
 			<Filter
@@ -2768,5 +2776,5 @@
 			</Filter>
 			<Filter
-				Name="Window Components"
+				Name="WindowComponents"
 				>
 				<File
@@ -2790,4 +2798,16 @@
 					>
 				</File>
+				<Filter
+					Name="PartialManager"
+					>
+					<File
+						RelativePath=".\include\WindowComponents\PartialManager\PartialManager.h"
+						>
+					</File>
+					<File
+						RelativePath=".\include\WindowComponents\PartialManager\TextEditPartialManager.h"
+						>
+					</File>
+				</Filter>
 			</Filter>
 			<Filter
Index: trunk/ab5.0/abdev/abdev/include/ProjectManager/WindowManager.h
===================================================================
--- trunk/ab5.0/abdev/abdev/include/ProjectManager/WindowManager.h	(revision 624)
+++ trunk/ab5.0/abdev/abdev/include/ProjectManager/WindowManager.h	(revision 625)
@@ -105,12 +105,23 @@
 };
 typedef std::vector<ChildWindowInfo *> ChildWindowInfos;
+
+struct WindowType
+{
+	enum EnumType
+	{
+		Default = 0,
+		ModalDlg = 1,
+		ModelessDlg = 3,
+	};
+};
+
 class WindowInfo
 	: public WindowInfoBase
 {
 public:
-	WindowInfo()
-		: WindowInfoBase()
-		, CallBackName( NULL )
-	{
+
+	const std::string GetSourceFileName() const
+	{
+		return this->GetName() + ".ab";
 	}
 
@@ -124,11 +135,12 @@
 	}
 
-	const std::string &GetHandleName() const
-	{
-		return handleName;
-	}
-	void SetHandleName( const std::string &handleName )
-	{
-		this->handleName = handleName;
+	const std::string GetHandleName() const
+	{
+		return "h" + this->GetName();
+	}
+
+	const std::string GetCallbackName() const
+	{
+		return this->GetName() + "Proc";
 	}
 
@@ -166,11 +178,29 @@
 	{
 		return !iconResourceName.empty();
+	}
+
+	WindowType::EnumType GetType() const
+	{
+		return type;
+	}
+	void SetType( WindowType::EnumType type )
+	{
+		this->type = type;
+	}
+	bool IsDefaultWindow() const
+	{
+		return ( type == WindowType::Default );
+	}
+	bool IsModalDlg() const
+	{
+		return ( type == WindowType::ModalDlg );
+	}
+	bool IsModelessDlg() const
+	{
+		return ( type == WindowType::ModelessDlg );
 	}
 
 	//ウィンドウデータ
 	LOGFONT LogFont;
-	char *CallBackName;
-	long type;
-	char *filepath;
 
 	//子ウィンドウ管理
@@ -186,4 +216,5 @@
 	int backgroundColor;
 	std::string iconResourceName;
+	WindowType::EnumType type;
 };
 
@@ -211,7 +242,9 @@
 	{
 		WindowInfos::iterator it = this->begin();
-		for( int i=0; i!=index ;i++, it++ )
+		int i = 0;
+		while( i < index )
 		{
-			delete *it;
+			i ++;
+			it ++;
 		}
 		this->erase( it );
Index: trunk/ab5.0/abdev/abdev/nkf_class.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/nkf_class.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/nkf_class.cpp	(revision 625)
@@ -156,5 +156,4 @@
 
 BOOL CALLBACK nkfDlgCodeSave(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	static int WndNum;
 	HWND hList;
Index: trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/src/MainFrame.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/src/MainFrame.cpp	(revision 625)
@@ -316,6 +316,6 @@
 				mii.dwTypeData=temporary;
 				mii.fType=MFT_STRING;
-				if(MdiInfo[WndNum].path[0]){
-					_splitpath(MdiInfo[WndNum].path,NULL,NULL,temporary,temp2);
+				if(!MdiInfo[WndNum].path.empty()){
+					_splitpath(MdiInfo[WndNum].path.c_str(),NULL,NULL,temporary,temp2);
 					lstrcat(temporary,temp2);
 					lstrcat(temporary," を保存(&S)");
@@ -329,5 +329,5 @@
 				/*「絶対パスをコピー」「フォルダを開く」「ファイルを削除」
 												コマンドを場合によって無効化にする */
-				if(MdiInfo[WndNum].path[0]){
+				if(!MdiInfo[WndNum].path.empty()){
 					EnableMenuItem(hTabMenu,IDM_PATH_COPY,MF_BYCOMMAND|MF_ENABLED);
 					EnableMenuItem(hTabMenu,IDM_FOLDER_OPEN,MF_BYCOMMAND|MF_ENABLED);
@@ -383,5 +383,5 @@
 		WndNum=GetWndNum(hChild);
 		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
-			if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) break;
+			if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0) break;
 		}
 		hChild=::GetNextWindow(hChild,GW_HWNDNEXT);
@@ -548,5 +548,5 @@
 void MainFrame::OnCmdAllSave( UINT uNotifyCode, int nID, CWindow wndCtl )
 {
-	for( int i=0;i<MAX_WNDNUM;i++){
+	for( int i=0;i<MdiInfo.size();i++){
 		if(MdiInfo[i].hwnd) SaveDocument(MdiInfo[i].hwnd,NULL);
 	}
@@ -585,10 +585,16 @@
 	if(!hChild) return;
 	int WndNum=GetWndNum(hChild);
-	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType))
+	if( IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType) )
+	{
 		TextEdit_UndoCommand(WndNum);
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD)
+	}
+	else if( MdiInfo[WndNum].DocType == WNDTYPE_RAD )
+	{
 		Rad_UndoCommand(WndNum);
-	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT)
+	}
+	else if( MdiInfo[WndNum].DocType == WNDTYPE_ICONEDIT )
+	{
 		IconEdit_UndoCommand(WndNum);
+	}
 }
 
@@ -986,7 +992,7 @@
 		if(!SetRunning(hChild)) return;
 		if(IsNeedCompile(MdiInfo[GetWndNum(hChild)].path,1))
-			sprintf(temporary,"\"%s\" /debug /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,m_hWnd);
+			sprintf(temporary,"\"%s\" /debug /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path.c_str(),m_hWnd);
 		else
-			sprintf(temporary,"\"%s\" /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,m_hWnd);
+			sprintf(temporary,"\"%s\" /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path.c_str(),m_hWnd);
 
 		//ブレークポイントをセーブ
@@ -1051,5 +1057,5 @@
 		//単独ソースコード
 		if(!SetRunning(hChild)) return;
-		sprintf(temporary,"\"%s\" /debug /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,m_hWnd);
+		sprintf(temporary,"\"%s\" /debug /wnd:%08x",MdiInfo[GetWndNum(hChild)].path.c_str(),m_hWnd);
 	}
 
@@ -1165,5 +1171,5 @@
 		//単独ソースコード
 		if(!SetRunning(hChild)) return;
-		sprintf(temporary,"\"%s\" /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,m_hWnd);
+		sprintf(temporary,"\"%s\" /wnd:%08x",MdiInfo[GetWndNum(hChild)].path.c_str(),m_hWnd);
 	}
 
@@ -1224,5 +1230,5 @@
 
 		//単独ソースコード
-		_splitpath(MdiInfo[GetWndNum(hChild)].path,temporary,temp2,temp3,NULL);
+		_splitpath(MdiInfo[GetWndNum(hChild)].path.c_str(),temporary,temp2,temp3,NULL);
 		lstrcat(temporary,temp2);
 		lstrcat(temporary,temp3);
@@ -1403,5 +1409,5 @@
 	HWND hChild=::GetWindow(hClient,GW_CHILD);
 	int WndNum=GetWndNum(hChild);
-	for(int i=0;i<MAX_WNDNUM;i++){
+	for(int i=0;i<MdiInfo.size();i++){
 		if(i==WndNum) continue;
 		if(MdiInfo[i].hwnd) SendMessage(MdiInfo[i].hwnd,WM_CLOSE,0,0);
@@ -1415,7 +1421,7 @@
 
 	//絶対パスをコピー
-	HGLOBAL hGlobal=(char *)GlobalAlloc(GMEM_MOVEABLE,lstrlen(MdiInfo[WndNum].path)+1);
+	HGLOBAL hGlobal=(char *)GlobalAlloc(GMEM_MOVEABLE,MdiInfo[WndNum].path.size()+1);
 	char *pTemp=(char *)GlobalLock(hGlobal);
-	lstrcpy(pTemp,MdiInfo[WndNum].path);
+	lstrcpy(pTemp,MdiInfo[WndNum].path.c_str());
 	GlobalUnlock(hGlobal);
 
@@ -1433,5 +1439,5 @@
 
 	char temporary[1024], temp2[1024];
-	_splitpath(MdiInfo[WndNum].path,temporary,temp2,NULL,NULL);
+	_splitpath(MdiInfo[WndNum].path.c_str(),temporary,temp2,NULL,NULL);
 	lstrcat(temporary,temp2);
 
@@ -1445,5 +1451,5 @@
 
 	char temporary[1024], temp2[1024];
-	_splitpath(MdiInfo[WndNum].path,NULL,NULL,temporary,temp2);
+	_splitpath(MdiInfo[WndNum].path.c_str(),NULL,NULL,temporary,temp2);
 	lstrcat(temporary,temp2);
 
@@ -1455,5 +1461,5 @@
 	fo.hwnd=m_hWnd;
 	fo.wFunc=FO_DELETE;
-	fo.pFrom =MdiInfo[WndNum].path;
+	fo.pFrom =MdiInfo[WndNum].path.c_str();
 	fo.pTo="\0";
 	fo.fFlags =FOF_ALLOWUNDO|FOF_NOCONFIRMATION;
Index: trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp	(revision 625)
@@ -267,5 +267,4 @@
 void Project::Save()
 {
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3,WndNum;
 	char temporary[MAX_PATH],buffer[32767];
@@ -284,5 +283,5 @@
 				for(i=0;i<this->pobj_DBFileInfo->iNum;i++){
 					this->pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
-					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+					if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0){
 						SaveDocument(hChild,NULL);
 						break;
@@ -297,5 +296,5 @@
 					lstrcpy(temporary,resourceItem.filepath.c_str());
 					lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
-					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+					if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0){
 						SaveDocument(hChild,NULL);
 						break;
@@ -533,5 +532,4 @@
 {
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,WndNum;
 	HWND hChild,hCloseChild;
@@ -553,5 +551,5 @@
 			for(i=0;i<this->pobj_DBFileInfo->iNum;i++){
 				this->pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
-				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+				if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0){
 
 					//変更フラグをオフにする
@@ -575,5 +573,6 @@
 		else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
 			for(i=0;i<this->NumberOfMenu;i++){
-				if(lstrcmp(MdiInfo[WndNum].path,this->pMenuInfo[i].IdName)==0){
+				if( MdiInfo[WndNum].path == this->pMenuInfo[i].IdName )
+				{
 					SendMessage(hCloseChild,WM_CLOSE,0,0);
 					break;
@@ -585,5 +584,5 @@
 				lstrcpy(temporary,this->resourceManager.iconResources[i].filepath.c_str());
 				lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
-				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+				if(lstrcmpi(MdiInfo[WndNum].path.c_str(),temporary)==0){
 					SendMessage(hCloseChild,WM_CLOSE,0,0);
 					break;
@@ -602,7 +601,4 @@
 	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, windowInfos )
 	{
-		HeapDefaultFree(pWindowInfo->CallBackName);
-		HeapDefaultFree(pWindowInfo->filepath);
-
 		//子ウィンドウのメモリを解放
 		BOOST_FOREACH( ActiveBasic::PM::ChildWindowInfo *pChildWindowInfo, pWindowInfo->childWindowInfos )
