Index: trunk/ab5.0/abdev/abdev/WindowControl.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/WindowControl.cpp	(revision 623)
+++ trunk/ab5.0/abdev/abdev/WindowControl.cpp	(revision 624)
@@ -19,7 +19,7 @@
 	return -1;
 }
-WindowInfo *GetWndInfo( char *name )
+ActiveBasic::PM::WindowInfo *GetWndInfo( char *name )
 {
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		if(lstrcmpi(name,pWindowInfo->GetName().c_str())==0) return pWindowInfo;
@@ -65,5 +65,5 @@
 
 HGLOBAL Rad_GetChildInfoClipboardData(int WndNum,int WndInfoNum){
-	//CHILDINFO構造体をクリップボード用データ（pByteが示すバッファ）に変換する
+	//ChildWindowInfo構造体をクリップボード用データ（pByteが示すバッファ）に変換する
 	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	HGLOBAL hGlobal;
@@ -85,21 +85,21 @@
 
 	for(i3--;i3>=0;i3--){
-		CHILDINFO *pChildInfo = projectInfo.windowInfos[WndInfoNum]->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[i3]];
-
-		MemSize+=lstrlen(pChildInfo->IdName)+1+
+		ActiveBasic::PM::ChildWindowInfo *pChildInfo = projectInfo.windowInfos[WndInfoNum]->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[i3]];
+
+		MemSize+=pChildInfo->GetName().size()+1+
 			sizeof(POINT)+
 			sizeof(SIZE)+
-			lstrlen(pChildInfo->caption)+1+
+			pChildInfo->GetCaption().size()+1+
 			sizeof(DWORD)+
 			sizeof(DWORD)+
 			sizeof(int)+
 			sizeof(int)+
-			lstrlen(pChildInfo->ImageCtrlInfo.path)+1;
+			pChildInfo->image.path.size()+1;
 
 		hGlobal=GlobalReAlloc(hGlobal,MemSize,0);
 		pByte=(BYTE *)GlobalLock(hGlobal);
 
-		lstrcpy((char *)pByte+i2,pChildInfo->IdName);
-		i2+=lstrlen(pChildInfo->IdName)+1;
+		lstrcpy((char *)pByte+i2,pChildInfo->GetName().c_str());
+		i2+=pChildInfo->GetName().size()+1;
 
 		memcpy(pByte+i2,&pChildInfo->pos,sizeof(POINT));
@@ -109,11 +109,11 @@
 		i2+=sizeof(SIZE);
 
-		lstrcpy((char *)pByte+i2,pChildInfo->caption);
-		i2+=lstrlen(pChildInfo->caption)+1;
-
-		memcpy(pByte+i2,&pChildInfo->style,sizeof(DWORD));
+		lstrcpy((char *)pByte+i2,pChildInfo->GetCaption().c_str());
+		i2+=pChildInfo->GetCaption().size()+1;
+
+		*(DWORD *)(pByte+i2) = pChildInfo->GetStyle();
 		i2+=sizeof(DWORD);
 
-		memcpy(pByte+i2,&pChildInfo->ExStyle,sizeof(DWORD));
+		*(DWORD *)(pByte+i2) = pChildInfo->GetExStyle();
 		i2+=sizeof(DWORD);
 
@@ -121,14 +121,15 @@
 		i2+=sizeof(int);
 
-		memcpy(pByte+i2,&pChildInfo->ImageCtrlInfo.type,sizeof(int));
+		memcpy(pByte+i2,&pChildInfo->image.type,sizeof(int));
 		i2+=sizeof(int);
 
-		if(!pChildInfo->ImageCtrlInfo.path){
+		if( pChildInfo->image.path.empty() )
+		{
 			lstrcpy((char *)pByte+i2,"");
 			i2++;
 		}
 		else{
-			lstrcpy((char *)pByte+i2,pChildInfo->ImageCtrlInfo.path);
-			i2+=lstrlen(pChildInfo->ImageCtrlInfo.path)+1;
+			lstrcpy((char *)pByte+i2,pChildInfo->image.path.c_str());
+			i2+=pChildInfo->image.path.size()+1;
 		}
 
@@ -143,6 +144,5 @@
 	BYTE *pByte;
 	int i2,i3,WndInfoNum;
-	CHILDINFO ChildInfo;
-	char temporary[255];
+	ActiveBasic::PM::ChildWindowInfo ChildInfo;
 
 	for(i2=1;i2<MAX_RAD_SELITEM;i2++) MdiInfo[WndNum].MdiRadInfo->SelectingItem[i2]=-1;
@@ -155,7 +155,6 @@
 	for(i3--;i3>=0;i3--){
 		//IdNameメンバは変更される可能性がある
-		ChildInfo.IdName=(char *)temporary;
-		lstrcpy(ChildInfo.IdName,(char *)pByte+i2);
-		i2+=lstrlen(ChildInfo.IdName)+1;
+		ChildInfo.SetName( (char *)pByte+i2 );
+		i2 += ChildInfo.GetName().size()+1;
 
 		memcpy(&ChildInfo.pos,pByte+i2,sizeof(POINT));
@@ -165,11 +164,11 @@
 		i2+=sizeof(SIZE);
 
-		ChildInfo.caption=(char *)pByte+i2;
-		i2+=lstrlen(ChildInfo.caption)+1;
-
-		memcpy(&ChildInfo.style,pByte+i2,sizeof(DWORD));
+		ChildInfo.SetCaption( (char *)pByte+i2 );
+		i2+=ChildInfo.GetCaption().size()+1;
+
+		ChildInfo.SetStyle( *(DWORD *)(pByte+i2) );
 		i2+=sizeof(DWORD);
 
-		memcpy(&ChildInfo.ExStyle,pByte+i2,sizeof(DWORD));
+		ChildInfo.SetExStyle( *(DWORD *)(pByte+i2) );
 		i2+=sizeof(DWORD);
 
@@ -177,13 +176,9 @@
 		i2+=sizeof(int);
 
-		memcpy(&ChildInfo.ImageCtrlInfo.type,pByte+i2,sizeof(int));
+		memcpy(&ChildInfo.image.type,pByte+i2,sizeof(int));
 		i2+=sizeof(int);
 
-		ChildInfo.ImageCtrlInfo.path=(char *)pByte+i2;
-		if(lstrlen(ChildInfo.ImageCtrlInfo.path)==0){
-			ChildInfo.ImageCtrlInfo.path=0;
-			i2++;
-		}
-		else i2+=lstrlen(ChildInfo.ImageCtrlInfo.path)+1;
+		ChildInfo.image.path = (char *)pByte+i2;
+		i2+=ChildInfo.image.path.size()+1;
 
 		ChildInfo.pos.x+=17;
@@ -195,11 +190,11 @@
 			&ChildInfo.pos,
 			&ChildInfo.size,
-			ChildInfo.IdName,
-			ChildInfo.caption,
-			ChildInfo.style,
-			ChildInfo.ExStyle,
+			ChildInfo.GetName().c_str(),
+			ChildInfo.GetCaption().c_str(),
+			ChildInfo.GetStyle(),
+			ChildInfo.GetExStyle(),
 			ChildInfo.Control,
-			ChildInfo.ImageCtrlInfo.type,
-			ChildInfo.ImageCtrlInfo.path,
+			ChildInfo.image.type,
+			ChildInfo.image.path.c_str(),
 			2);
 	}
@@ -210,5 +205,5 @@
 }
 
-char *FormatCaption(char *caption){
+char *FormatCaption(const char *caption){
 	extern HANDLE hHeap;
 	int i2,i3,BufSize;
@@ -234,5 +229,5 @@
 	return buffer;
 }
-char *SetCaptionSequence(char *caption){
+char *SetCaptionSequence(const char *caption){
 	extern HANDLE hHeap;
 	int i2,i3,BufSize;
@@ -351,5 +346,5 @@
 	return 1;
 }
-BOOL GetNotifyCommandByItemMessage(WindowInfo *pWindowInfo,ITEMEVENTINFO *pItemEventInfo,char *Command,char *spaces){
+BOOL GetNotifyCommandByItemMessage(ActiveBasic::PM::WindowInfo *pWindowInfo,ITEMEVENTINFO *pItemEventInfo,char *Command,char *spaces){
 	int i,i2,i3,sw;
 	char temporary[MAX_PATH];
@@ -432,5 +427,5 @@
 	}
 }
-void GetCommandByItemMessage(WindowInfo *pWindowInfo,ITEMEVENTINFO *pItemEventInfo,char *Command,char *spaces){
+void GetCommandByItemMessage(ActiveBasic::PM::WindowInfo *pWindowInfo,ITEMEVENTINFO *pItemEventInfo,char *Command,char *spaces){
 	extern HANDLE hHeap;
 	int i,i2,i3;
@@ -526,5 +521,5 @@
 	char temporary[MAX_PATH],*temp2;
 
-	WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
+	ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
 
 	Command[0]=0;
@@ -548,8 +543,9 @@
 		i+=lstrlen(Command+i);
 
-		if(pWindowInfo->MenuID){
+		if( pWindowInfo->HasMenu() )
+		{
 			//メニュー作成
 			for(i2=0;i2<projectInfo.NumberOfMenu;i2++){
-				if(lstrcmpi(projectInfo.pMenuInfo[i2].IdName,pWindowInfo->MenuID)==0) break;
+				if(lstrcmpi(projectInfo.pMenuInfo[i2].IdName,pWindowInfo->GetMenuIdName().c_str())==0) break;
 			}
 			if(i2!=projectInfo.NumberOfMenu){
@@ -561,34 +557,34 @@
 		//子ウィンドウ作成
 		sw = 0;
-		BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos )
+		BOOST_FOREACH( const ActiveBasic::PM::ChildWindowInfo *pChildInfo, pWindowInfo->childWindowInfos )
 		{
 			if(pChildInfo->Control==CT_UPDOWN){
 				sprintf(Command+i,"%s\tCreateUpDownControl(%d,%d,%d,%d,%d,hWnd,%s,GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,0,0,100,0)\r\n",
 					spaces,
-					pChildInfo->style,
+					pChildInfo->GetStyle(),
 					pChildInfo->pos.x,pChildInfo->pos.y,
 					pChildInfo->size.cx,pChildInfo->size.cy,
-					pChildInfo->IdName);
+					pChildInfo->GetName().c_str());
 				i+=lstrlen(Command+i);
 			}
 			else{
 				GetItemClassName(temporary,pChildInfo->Control);
-				temp2=FormatCaption(pChildInfo->caption);
+				temp2=FormatCaption(pChildInfo->GetCaption().c_str());
 				sprintf(Command+i,"%s\tCreateWindowEx(&H%08x,\"%s\",\"%s\",&H%08x,%d,%d,%d,%d,hWnd,%s As HMENU,GetModuleHandle(0),0)\r\n",
 					spaces,
-					pChildInfo->ExStyle,
+					pChildInfo->GetExStyle(),
 					temporary,
 					temp2,
-					pChildInfo->style,
+					pChildInfo->GetStyle(),
 					pChildInfo->pos.x,
 					pChildInfo->pos.y,
 					pChildInfo->size.cx,
 					pChildInfo->size.cy,
-					pChildInfo->IdName);
+					pChildInfo->GetName().c_str());
 				i+=lstrlen(Command+i);
 				HeapDefaultFree(temp2);
 				sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),WM_SETFONT,hFont_%s As WPARAM,0)\r\n",
 					spaces,
-					pChildInfo->IdName,
+					pChildInfo->GetName().c_str(),
 					pWindowInfo->GetName().c_str());
 				i+=lstrlen(Command+i);
@@ -596,13 +592,13 @@
 				if(pChildInfo->Control==CT_IMAGEBOX){
 					//イメージ ボックスの場合
-					if((pChildInfo->style&0x000F)==SS_ICON){
-						if(pChildInfo->ImageCtrlInfo.type==IMGTYPE_FILE){
-							if(strstr(pChildInfo->ImageCtrlInfo.path,":")||
-								strstr(pChildInfo->ImageCtrlInfo.path,"\\\\")){
+					if((pChildInfo->GetStyle()&0x000F)==SS_ICON){
+						if(pChildInfo->image.IsFile()){
+							if(strstr(pChildInfo->image.path.c_str(),":")||
+								strstr(pChildInfo->image.path.c_str(),"\\\\")){
 								sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,\"%s\",IMAGE_ICON,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n",
 									spaces,
 									pWindowInfo->GetName().c_str(),
-									pChildInfo->IdName,
-									pChildInfo->ImageCtrlInfo.path);
+									pChildInfo->GetName().c_str(),
+									pChildInfo->image.path.c_str());
 							}
 							else{
@@ -628,37 +624,37 @@
 									i+=2;
 								}
-								sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,pChildInfo->ImageCtrlInfo.path);
+								sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,pChildInfo->image.path.c_str());
 								i+=lstrlen(Command+i);
 								sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,ImageFilePath,IMAGE_ICON,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n",
 									spaces,
 									pWindowInfo->GetName().c_str(),
-									pChildInfo->IdName);
+									pChildInfo->GetName().c_str());
 							}
 							i+=lstrlen(Command+i);
 						}
-						else if(pChildInfo->ImageCtrlInfo.type==IMGTYPE_RES){
+						else if(pChildInfo->image.IsResource()){
 							sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,%s As *Byte,IMAGE_ICON,0,0,LR_DEFAULTSIZE)\r\n",
 								spaces,
 								pWindowInfo->GetName().c_str(),
-								pChildInfo->IdName,
-								pChildInfo->ImageCtrlInfo.path);
+								pChildInfo->GetName().c_str(),
+								pChildInfo->image.path.c_str());
 							i+=lstrlen(Command+i);
 						}
 						sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),STM_SETICON,hImage_%s_%s As WPARAM,0)\r\n",
 							spaces,
-							pChildInfo->IdName,
+							pChildInfo->GetName().c_str(),
 							pWindowInfo->GetName().c_str(),
-							pChildInfo->IdName);
+							pChildInfo->GetName().c_str());
 						i+=lstrlen(Command+i);
 					}
-					else if((pChildInfo->style&0x000F)==SS_BITMAP){
-						if(pChildInfo->ImageCtrlInfo.type==IMGTYPE_FILE){
-							if(strstr(pChildInfo->ImageCtrlInfo.path,":")||
-								strstr(pChildInfo->ImageCtrlInfo.path,"\\\\")){
+					else if((pChildInfo->GetStyle()&0x000F)==SS_BITMAP){
+						if(pChildInfo->image.IsFile()){
+							if(strstr(pChildInfo->image.path.c_str(),":")||
+								strstr(pChildInfo->image.path.c_str(),"\\\\")){
 								sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,\"%s\",IMAGE_BITMAP,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n",
 									spaces,
 									pWindowInfo->GetName().c_str(),
-									pChildInfo->IdName,
-									pChildInfo->ImageCtrlInfo.path);
+									pChildInfo->GetName().c_str(),
+									pChildInfo->image.path.c_str());
 							}
 							else{
@@ -684,26 +680,26 @@
 									i+=2;
 								}
-								sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,pChildInfo->ImageCtrlInfo.path);
+								sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,pChildInfo->image.path.c_str());
 								i+=lstrlen(Command+i);
 								sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,ImageFilePath,IMAGE_BITMAP,0,0,LR_LOADFROMFILE)\r\n",
 									spaces,
 									pWindowInfo->GetName().c_str(),
-									pChildInfo->IdName);
+									pChildInfo->GetName().c_str());
 							}
 							i+=lstrlen(Command+i);
 						}
-						else if(pChildInfo->ImageCtrlInfo.type==IMGTYPE_RES){
+						else if(pChildInfo->image.IsResource()){
 							sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,%s As *Byte,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE)\r\n",
 								spaces,
 								pWindowInfo->GetName().c_str(),
-								pChildInfo->IdName,
-								pChildInfo->ImageCtrlInfo.path);
+								pChildInfo->GetName().c_str(),
+								pChildInfo->image.path.c_str());
 							i+=lstrlen(Command+i);
 						}
 						sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),STM_SETIMAGE,IMAGE_BITMAP,hImage_%s_%s As LPARAM)\r\n",
 							spaces,
-							pChildInfo->IdName,
+							pChildInfo->GetName().c_str(),
 							pWindowInfo->GetName().c_str(),
-							pChildInfo->IdName);
+							pChildInfo->GetName().c_str());
 						i+=lstrlen(Command+i);
 					}
@@ -724,8 +720,9 @@
 		}
 
-		if(pWindowInfo->MenuID){
+		if( pWindowInfo->HasMenu() )
+		{
 			//メニューを解放
 			for(i2=0;i2<projectInfo.NumberOfMenu;i2++){
-				if(lstrcmpi(projectInfo.pMenuInfo[i2].IdName,pWindowInfo->MenuID)==0) break;
+				if(lstrcmpi(projectInfo.pMenuInfo[i2].IdName,pWindowInfo->GetMenuIdName().c_str())==0) break;
 			}
 			if(i2!=projectInfo.NumberOfMenu){
@@ -736,11 +733,11 @@
 
 		//イメージ ボックス用の変数を解放
-		BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos )
+		BOOST_FOREACH( const ActiveBasic::PM::ChildWindowInfo *pChildInfo, pWindowInfo->childWindowInfos )
 		{
 			if(pChildInfo->Control==CT_IMAGEBOX){
-				if((pChildInfo->style&0x000F)==SS_ICON)
-					sprintf(Command+i,"%s\tDestroyIcon(hImage_%s_%s)\r\n",spaces,pWindowInfo->GetName().c_str(),pChildInfo->IdName);
-				else if((pChildInfo->style&0x000F)==SS_BITMAP)
-					sprintf(Command+i,"%s\tDeleteObject(hImage_%s_%s)\r\n",spaces,pWindowInfo->GetName().c_str(),pChildInfo->IdName);
+				if((pChildInfo->GetStyle()&0x000F)==SS_ICON)
+					sprintf(Command+i,"%s\tDestroyIcon(hImage_%s_%s)\r\n",spaces,pWindowInfo->GetName().c_str(),pChildInfo->GetName().c_str());
+				else if((pChildInfo->GetStyle()&0x000F)==SS_BITMAP)
+					sprintf(Command+i,"%s\tDeleteObject(hImage_%s_%s)\r\n",spaces,pWindowInfo->GetName().c_str(),pChildInfo->GetName().c_str());
 				i+=lstrlen(Command+i);
 			}
@@ -894,25 +891,27 @@
 }
 
-char **GetMenuItemConstData(MENU_INFO *pMenuInfo,int NumberOfMenu,int *ConstNumber,char **ppNames,int *NamesNum,char *buffer,int *base){
+void GetMenuItemConstData(MENU_INFO *pMenuInfo,int NumberOfMenu,int *ConstNumber,Jenga::Common::Strings &namesForDuplicationCheck,char *buffer,int *base){
 	extern HANDLE hHeap;
-	int i,i2,sw1;
+	int i;
 
 	for(i=0;i<NumberOfMenu;i++){
 		if(pMenuInfo[i].pMenuInfo){
 			//ポップアップ
-			ppNames=GetMenuItemConstData(pMenuInfo[i].pMenuInfo,pMenuInfo[i].NumberOfMenu,ConstNumber,ppNames,NamesNum,buffer,base);
+			GetMenuItemConstData(pMenuInfo[i].pMenuInfo,pMenuInfo[i].NumberOfMenu,ConstNumber,namesForDuplicationCheck,buffer,base);
 		}
 		else if(pMenuInfo[i].type==MFT_STRING){
 			//重複チェック
-			for(i2=0,sw1=0;i2<*NamesNum;i2++){
-				if(lstrcmpi(ppNames[i2],pMenuInfo[i].IdName)==0){
-					sw1=1;
+			bool isMatch = false;
+			BOOST_FOREACH( const std::string &name, namesForDuplicationCheck )
+			{
+				if(lstrcmpi(name.c_str(),pMenuInfo[i].IdName)==0)
+				{
+					isMatch = true;
 					break;
 				}
 			}
-			if(sw1==0){
-				ppNames=(char **)HeapReAlloc(hHeap,0,ppNames,sizeof(char *)*((*NamesNum)+1));
-				ppNames[*NamesNum]=pMenuInfo[i].IdName;
-				(*NamesNum)++;
+			if( !isMatch )
+			{
+				namesForDuplicationCheck.push_back( pMenuInfo[i].IdName );
 
 				sprintf(buffer+(*base),"Const %s=%d\r\n",pMenuInfo[i].IdName,*ConstNumber);
@@ -922,5 +921,4 @@
 		}
 	}
-	return ppNames;
 }
 int GetMakeMenuCommand(MENU_INFO *pMenuInfo,int NumberOfMenu,char *MenuHandle,char *Command,BOOL bMain){
@@ -982,6 +980,6 @@
 void SaveWindowProgram(){
 	extern HANDLE hHeap;
-	int i,i2,i3,i4,i5,i6,sw1,sw2,sw3,sw4,size;
-	char *buffer,**ppNames,temporary[MAX_PATH];
+	int i,i2,i3,i4,i5,sw1,sw2,sw3,sw4,size;
+	char *buffer,temporary[MAX_PATH];
 
 	size=2;
@@ -1006,25 +1004,25 @@
 	//IDを定義
 
-	ppNames=(char **)HeapAlloc(hHeap,0,1);
+	Jenga::Common::Strings namesForDuplicationCheck;
 	i4=1000;
 	i5=0;
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
-		BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos )
+		BOOST_FOREACH( const ActiveBasic::PM::ChildWindowInfo *pChildInfo, pWindowInfo->childWindowInfos )
 		{
 			//重複チェック
-			for(i6=0,sw1=0;i6<i5;i6++){
-				if(lstrcmpi(ppNames[i6],pChildInfo->IdName)==0){
-					sw1=1;
+			bool isMatch = false;
+			BOOST_FOREACH( const std::string &name, namesForDuplicationCheck )
+			{
+				if(lstrcmpi(name.c_str(),pChildInfo->GetName().c_str())==0){
+					isMatch = true;
 					break;
 				}
 			}
-			if(sw1) continue;
-
-			ppNames=(char **)HeapReAlloc(hHeap,0,ppNames,sizeof(char *)*(i5+1));
-			ppNames[i5]=pChildInfo->IdName;
-			i5++;
-
-			sprintf(buffer+i2,"Const %s=%d\r\n",pChildInfo->IdName,i4);
+			if( isMatch ) continue;
+
+			namesForDuplicationCheck.push_back( pChildInfo->GetName() );
+
+			sprintf(buffer+i2,"Const %s=%d\r\n",pChildInfo->GetName().c_str(),i4);
 			i2+=lstrlen(buffer+i2);
 			i4++;
@@ -1038,7 +1036,6 @@
 
 	//メニューのIDを定義
-	ppNames=GetMenuItemConstData(projectInfo.pMenuInfo,projectInfo.NumberOfMenu,&i4,ppNames,&i5,buffer,&i2);
-
-	HeapDefaultFree(ppNames);
+	GetMenuItemConstData(projectInfo.pMenuInfo,projectInfo.NumberOfMenu,&i4,namesForDuplicationCheck,buffer,&i2);
+
 	lstrcpy(buffer+i2,"\r\n");
 	i2+=lstrlen(buffer+i2);
@@ -1046,5 +1043,5 @@
 
 	//ハンドル変数を定義
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		sprintf(buffer+i2,"Dim %s As HWND\r\n",pWindowInfo->GetHandleName().c_str());
@@ -1082,20 +1079,20 @@
 	i2+=lstrlen(buffer+i2);
 	i=0;
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
-		if(pWindowInfo->bgColor<=0&&
-			pWindowInfo->bgColor!=-(int)RGB(255,255,255)&&
-			pWindowInfo->bgColor!=-(int)RGB(0,0,0)){
+		if(pWindowInfo->GetBackgroundColor()<=0&&
+			pWindowInfo->GetBackgroundColor()!=-(int)RGB(255,255,255)&&
+			pWindowInfo->GetBackgroundColor()!=-(int)RGB(0,0,0)){
 				sprintf(buffer+i2,"Dim _RadSys_hBackBrush%d As HBRUSH\r\n",i);
 				i2+=lstrlen(buffer+i2);
-				sprintf(buffer+i2,"_RadSys_hBackBrush%d=CreateSolidBrush(%d)\r\n",i,-pWindowInfo->bgColor);
+				sprintf(buffer+i2,"_RadSys_hBackBrush%d=CreateSolidBrush(%d)\r\n",i,-pWindowInfo->GetBackgroundColor());
 				i2+=lstrlen(buffer+i2);
 		}
-		if(pWindowInfo->bgColor>=0x1000){
+		if(pWindowInfo->GetBackgroundColor()>=0x1000){
 				sprintf(buffer+i2,"Dim _RadSys_hBackBrush%d As HBRUSH\r\n",i);
 				i2+=lstrlen(buffer+i2);
 				sprintf(buffer+i2,"_RadSys_hBackBrush%d=CreatePatternBrush(LoadImage(GetModuleHandle(0),%s,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE or LR_SHARED))\r\n",
 					i,
-					projectInfo.resourceManager.bitmapResources[pWindowInfo->bgColor-0x1000].idName.c_str());
+					projectInfo.resourceManager.bitmapResources[pWindowInfo->GetBackgroundColor()-0x1000].idName.c_str());
 				i2+=lstrlen(buffer+i2);
 		}
@@ -1108,12 +1105,12 @@
 
 	//イメージ ボックス用の変数を定義
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
-		BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos )
+		BOOST_FOREACH( const ActiveBasic::PM::ChildWindowInfo *pChildInfo, pWindowInfo->childWindowInfos )
 		{
 			if(pChildInfo->Control==CT_IMAGEBOX){
-				if((pChildInfo->style&0x000F)==SS_ICON||
-					(pChildInfo->style&0x000F)==SS_BITMAP){
-					sprintf(buffer+i2,"Dim hImage_%s_%s As HANDLE\r\n",pWindowInfo->GetName().c_str(),pChildInfo->IdName);
+				if((pChildInfo->GetStyle()&0x000F)==SS_ICON||
+					(pChildInfo->GetStyle()&0x000F)==SS_BITMAP){
+					sprintf(buffer+i2,"Dim hImage_%s_%s As HANDLE\r\n",pWindowInfo->GetName().c_str(),pChildInfo->GetName().c_str());
 					i2+=lstrlen(buffer+i2);
 
@@ -1163,5 +1160,5 @@
 	}
 
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		//フォントハンドル解放
@@ -1179,9 +1176,9 @@
 	i2+=lstrlen(buffer+i2);
 	i=0;
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
-		if(pWindowInfo->bgColor<=0&&
-			pWindowInfo->bgColor!=-(int)RGB(255,255,255)&&
-			pWindowInfo->bgColor!=-(int)RGB(0,0,0)){
+		if(pWindowInfo->GetBackgroundColor()<=0&&
+			pWindowInfo->GetBackgroundColor()!=-(int)RGB(255,255,255)&&
+			pWindowInfo->GetBackgroundColor()!=-(int)RGB(0,0,0)){
 				sprintf(buffer+i2,"\tDeleteObject(_RadSys_hBackBrush%d)\r\n",i);
 				i2+=lstrlen(buffer+i2);
@@ -1198,5 +1195,5 @@
 
 	i=0;
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		if(i!=0){
@@ -1210,5 +1207,5 @@
 		//処理メッセージを抽出
 		ITEMEVENTINFO *pItemEventInfo;
-		ppNames=GetProcedureNamesOfMessageCall(i,&pItemEventInfo,&i3,&bAvailUserProc[i]);
+		char **ppNames=GetProcedureNamesOfMessageCall(i,&pItemEventInfo,&i3,&bAvailUserProc[i]);
 
 		sprintf(buffer+i2,"Function EventCall_%s(hWnd As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT\r\n",pWindowInfo->GetName().c_str());
@@ -1363,5 +1360,5 @@
 	sw1=0;
 	i=0;
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		if(pWindowInfo->type==WNDTYPE_MODALDLG){
@@ -1375,14 +1372,13 @@
 				i2+=lstrlen(buffer+i2);
 			}
-			sprintf(buffer+i2,"\t\t%s=CreateWindowEx(&H%08x,\"NORMALDLG\",\"%s\",&H%08x,%d,%d,%d,%d,hOwnerWnd,%d As HMENU,GetModuleHandle(0),0)\r\n",
+			sprintf(buffer+i2,"\t\t%s=CreateWindowEx(&H%08x,\"NORMALDLG\",\"%s\",&H%08x,%d,%d,%d,%d,hOwnerWnd,NULL As HMENU,GetModuleHandle(0),0)\r\n",
 				pWindowInfo->GetHandleName().c_str(),
-				pWindowInfo->ExStyle,
-				pWindowInfo->caption,
-				pWindowInfo->style,
+				pWindowInfo->GetExStyle(),
+				pWindowInfo->GetCaption().c_str(),
+				pWindowInfo->GetStyle(),
 				pWindowInfo->pos.x,
 				pWindowInfo->pos.y,
 				pWindowInfo->size.cx,
-				pWindowInfo->size.cy,
-				pWindowInfo->id);
+				pWindowInfo->size.cy);
 			i2+=lstrlen(buffer+i2);
 			sprintf(buffer+i2,"\t\thDlg=%s\r\n",
@@ -1402,6 +1398,7 @@
 			sprintf(buffer+i2,"\t\tSendMessage(%s,WM_INITDIALOG,0,0)\r\n",pWindowInfo->GetHandleName().c_str());
 			i2+=lstrlen(buffer+i2);
-			if(pWindowInfo->IconResName){
-				sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n",pWindowInfo->GetHandleName().c_str(),pWindowInfo->IconResName);
+			if( pWindowInfo->HasIcon() )
+			{
+				sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n",pWindowInfo->GetHandleName().c_str(),pWindowInfo->GetIconResourceName().c_str());
 				i2+=lstrlen(buffer+i2);
 			}
@@ -1462,5 +1459,5 @@
 	i2+=lstrlen(buffer+i2);
 	i=0;
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		if(pWindowInfo->type==WNDTYPE_MODELESSDLG){
@@ -1468,14 +1465,13 @@
 			i2+=lstrlen(buffer+i2);
 
-			sprintf(buffer+i2,"\t\t%s=CreateWindowEx(&H%08x,\"NORMALDLG\",\"%s\",&H%08x,%d,%d,%d,%d,hOwnerWnd,%d As HMENU,GetModuleHandle(0),0)\r\n",
+			sprintf(buffer+i2,"\t\t%s=CreateWindowEx(&H%08x,\"NORMALDLG\",\"%s\",&H%08x,%d,%d,%d,%d,hOwnerWnd,NULL As HMENU,GetModuleHandle(0),0)\r\n",
 				pWindowInfo->GetHandleName().c_str(),
-				pWindowInfo->ExStyle,
-				pWindowInfo->caption,
-				pWindowInfo->style,
+				pWindowInfo->GetExStyle(),
+				pWindowInfo->GetCaption().c_str(),
+				pWindowInfo->GetStyle(),
 				pWindowInfo->pos.x,
 				pWindowInfo->pos.y,
 				pWindowInfo->size.cx,
-				pWindowInfo->size.cy,
-				pWindowInfo->id);
+				pWindowInfo->size.cy);
 			i2+=lstrlen(buffer+i2);
 			sprintf(buffer+i2,"\t\tCreateDialog=%s\r\n",pWindowInfo->GetHandleName().c_str());
@@ -1494,6 +1490,7 @@
 			sprintf(buffer+i2,"\t\tSendMessage(%s,WM_INITDIALOG,0,0)\r\n",pWindowInfo->GetHandleName().c_str());
 			i2+=lstrlen(buffer+i2);
-			if(pWindowInfo->IconResName){
-				sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n",pWindowInfo->GetHandleName().c_str(),pWindowInfo->IconResName);
+			if( pWindowInfo->HasIcon() )
+			{
+				sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n",pWindowInfo->GetHandleName().c_str(),pWindowInfo->GetIconResourceName().c_str());
 				i2+=lstrlen(buffer+i2);
 			}
@@ -1535,5 +1532,5 @@
 
 	i=0;
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		if(pWindowInfo->type==WNDTYPE_DEFAULT){
@@ -1544,5 +1541,12 @@
 			i2+=2;
 
-			if(pWindowInfo->IconResName==0){
+			if( pWindowInfo->HasIcon() )
+			{
+				sprintf(buffer+i2,"_RadSys_wcl.hIcon=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n",pWindowInfo->GetIconResourceName().c_str());
+				i2+=lstrlen(buffer+i2);
+				sprintf(buffer+i2,"_RadSys_wcl.hIconSm=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n",pWindowInfo->GetIconResourceName().c_str());
+				i2+=lstrlen(buffer+i2);
+			}
+			else{
 				lstrcpy(buffer+i2,"_RadSys_wcl.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_APPLICATION))\r\n");
 				i2+=lstrlen(buffer+i2);
@@ -1550,10 +1554,4 @@
 				i2+=lstrlen(buffer+i2);
 			}
-			else{
-				sprintf(buffer+i2,"_RadSys_wcl.hIcon=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n",pWindowInfo->IconResName);
-				i2+=lstrlen(buffer+i2);
-				sprintf(buffer+i2,"_RadSys_wcl.hIconSm=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n",pWindowInfo->IconResName);
-				i2+=lstrlen(buffer+i2);
-			}
 
 			sprintf(buffer+i2,"_RadSys_wcl.lpszClassName=\"NORMAL%d\"\r\n",i);
@@ -1563,12 +1561,12 @@
 			else sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(EventCall_%s)\r\n",pWindowInfo->GetName().c_str());
 			i2+=lstrlen(buffer+i2);
-			if(pWindowInfo->bgColor==COLOR_3DFACE)
+			if(pWindowInfo->GetBackgroundColor()==COLOR_3DFACE)
 				lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=h3DFaceBrush\r\n");
-			else if(pWindowInfo->bgColor==-(int)RGB(255,255,255))
+			else if(pWindowInfo->GetBackgroundColor()==-(int)RGB(255,255,255))
 				lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=GetStockObject(WHITE_BRUSH)\r\n");
-			else if(pWindowInfo->bgColor==-(int)RGB(0,0,0))
+			else if(pWindowInfo->GetBackgroundColor()==-(int)RGB(0,0,0))
 				lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=GetStockObject(BLACK_BRUSH)\r\n");
-			else if(pWindowInfo->bgColor<=0||
-				pWindowInfo->bgColor>=0x1000){
+			else if(pWindowInfo->GetBackgroundColor()<=0||
+				pWindowInfo->GetBackgroundColor()>=0x1000){
 				//色指定またはビットマップ
 				sprintf(buffer+i2,"_RadSys_wcl.hbrBackground=_RadSys_hBackBrush%d\r\n",i);
@@ -1578,8 +1576,8 @@
 			i2+=lstrlen(buffer+i2);
 			sprintf(buffer+i2,"CreateWindowEx(&H%08x,\"%s%d\",\"%s\",&H%08x,%d,%d,%d,%d,0,0,GetModuleHandle(0),0)\r\n",
-				pWindowInfo->ExStyle,
-				pWindowInfo->ClassName,i,
-				pWindowInfo->caption,
-				pWindowInfo->style,
+				pWindowInfo->GetExStyle(),
+				pWindowInfo->GetClassName().c_str(), i,
+				pWindowInfo->GetCaption().c_str(),
+				pWindowInfo->GetStyle(),
 				pWindowInfo->pos.x,
 				pWindowInfo->pos.y,
@@ -1630,5 +1628,5 @@
 	return i2;
 }
-void SaveWindowFile( char *path, const WindowInfos &windowInfos )
+void SaveWindowFile( char *path, const ActiveBasic::PM::WindowInfos &windowInfos )
 {
 	extern HANDLE hHeap;
@@ -1640,5 +1638,5 @@
 	buffer=(char *)HeapAlloc(hHeap,0,GENERAL_SIZE*size);
 	i2=0;
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		sprintf(buffer+i2,"WINDOW:%s\r\n",pWindowInfo->GetName().c_str());
@@ -1650,17 +1648,16 @@
 		sprintf(buffer+i2,"    SIZE      = %d,%d\r\n",pWindowInfo->size.cx,pWindowInfo->size.cy);
 		i2+=lstrlen(buffer+i2);
-		sprintf(buffer+i2,"    CAPTION   = \"%s\"\r\n",pWindowInfo->caption);
-		i2+=lstrlen(buffer+i2);
-		sprintf(buffer+i2,"    STYLE     = &H%08x\r\n",pWindowInfo->style);
-		i2+=lstrlen(buffer+i2);
-		sprintf(buffer+i2,"    EXSTYLE   = &H%08x\r\n",pWindowInfo->ExStyle);
-		i2+=lstrlen(buffer+i2);
-		if(pWindowInfo->MenuID){
-			sprintf(buffer+i2,"    MENUID    = %s\r\n",pWindowInfo->MenuID);
-			i2+=lstrlen(buffer+i2);
-		}
-		sprintf(buffer+i2,"    ID        = %d\r\n",pWindowInfo->id);
-		i2+=lstrlen(buffer+i2);
-		sprintf(buffer+i2,"    BGCOLOR   = %d\r\n",pWindowInfo->bgColor);
+		sprintf(buffer+i2,"    CAPTION   = \"%s\"\r\n",pWindowInfo->GetCaption().c_str());
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    STYLE     = &H%08x\r\n",pWindowInfo->GetStyle());
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    EXSTYLE   = &H%08x\r\n",pWindowInfo->GetExStyle());
+		i2+=lstrlen(buffer+i2);
+		if( pWindowInfo->HasMenu() )
+		{
+			sprintf(buffer+i2,"    MENUID    = %s\r\n",pWindowInfo->GetMenuIdName().c_str());
+			i2+=lstrlen(buffer+i2);
+		}
+		sprintf(buffer+i2,"    BGCOLOR   = %d\r\n",pWindowInfo->GetBackgroundColor());
 		i2+=lstrlen(buffer+i2);
 		sprintf(buffer+i2,"    FONT      = %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\"%s\"\r\n",
@@ -1680,9 +1677,10 @@
 			pWindowInfo->LogFont.lfFaceName);
 		i2+=lstrlen(buffer+i2);
-		if(pWindowInfo->IconResName){
-			sprintf(buffer+i2,"    ICONID    = %s\r\n",pWindowInfo->IconResName);
-			i2+=lstrlen(buffer+i2);
-		}
-		sprintf(buffer+i2,"    CLASS     = \"%s\"\r\n",pWindowInfo->ClassName);
+		if( pWindowInfo->HasIcon() )
+		{
+			sprintf(buffer+i2,"    ICONID    = %s\r\n",pWindowInfo->GetIconResourceName().c_str());
+			i2+=lstrlen(buffer+i2);
+		}
+		sprintf(buffer+i2,"    CLASS     = \"%s\"\r\n",pWindowInfo->GetClassName().c_str());
 		i2+=lstrlen(buffer+i2);
 		sprintf(buffer+i2,"    CALLBACK  = %s\r\n",pWindowInfo->CallBackName);
@@ -1692,14 +1690,14 @@
 		sprintf(buffer+i2,"    FILEPATH  = %s\r\n",pWindowInfo->filepath);
 		i2+=lstrlen(buffer+i2);
-		BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos )
+		BOOST_FOREACH( const ActiveBasic::PM::ChildWindowInfo *pChildInfo, pWindowInfo->childWindowInfos )
 		{
-			temporary=SetCaptionSequence(pChildInfo->caption);
+			temporary=SetCaptionSequence(pChildInfo->GetCaption().c_str());
 			sprintf(buffer+i2,"    ITEM      = %s,%d,%d,%d,%d,\"%s\",&H%08x,&H%08x,%d",
-				pChildInfo->IdName,
+				pChildInfo->GetName().c_str(),
 				pChildInfo->pos.x,pChildInfo->pos.y,
 				pChildInfo->size.cx,pChildInfo->size.cy,
 				temporary,
-				pChildInfo->style,
-				pChildInfo->ExStyle,
+				pChildInfo->GetStyle(),
+				pChildInfo->GetExStyle(),
 				pChildInfo->Control
 			);
@@ -1707,5 +1705,5 @@
 			HeapDefaultFree(temporary);
 			if(pChildInfo->Control==CT_IMAGEBOX){
-				sprintf(buffer+i2,",%d,\"%s\"",pChildInfo->ImageCtrlInfo.type,pChildInfo->ImageCtrlInfo.path);
+				sprintf(buffer+i2,",%d,\"%s\"",pChildInfo->image.type,pChildInfo->image.path.c_str());
 				i2+=lstrlen(buffer+i2);
 			}
@@ -1883,5 +1881,5 @@
 			//ウィンドウ
 			if(lstrcmpi(temporary,"WINDOW")==0&&i3==0){
-				projectInfo.windowInfos.push_back( new WindowInfo() );
+				projectInfo.windowInfos.push_back( new ActiveBasic::PM::WindowInfo() );
 				i3=1;
 
@@ -1906,21 +1904,22 @@
 				if(temp2[0]=='\"'&&temp2[lstrlen(temp2)-1]=='\"'){
 					temp2[lstrlen(temp2)-1]=0;
-					projectInfo.windowInfos.back()->caption=(char *)HeapAlloc(hHeap,0,i2+1);
-					lstrcpy(projectInfo.windowInfos.back()->caption,temp2+1);
+					projectInfo.windowInfos.back()->SetCaption( temp2+1 );
 				}
 			}
-			else if(lstrcmpi(temporary,"STYLE")==0&&i3==1) projectInfo.windowInfos.back()->style=GetValue(temp2);
-			else if(lstrcmpi(temporary,"EXSTYLE")==0&&i3==1) projectInfo.windowInfos.back()->ExStyle=GetValue(temp2);
+			else if(lstrcmpi(temporary,"STYLE")==0&&i3==1) projectInfo.windowInfos.back()->SetStyle( GetValue(temp2) );
+			else if(lstrcmpi(temporary,"EXSTYLE")==0&&i3==1) projectInfo.windowInfos.back()->SetExStyle( GetValue(temp2) );
 			else if(lstrcmpi(temporary,"MENUID")==0&&i3==1){
-				projectInfo.windowInfos.back()->MenuID=(char *)HeapAlloc(hHeap,0,i2+1);
-				lstrcpy(projectInfo.windowInfos.back()->MenuID,temp2);
-			}
-			else if(lstrcmpi(temporary,"ID")==0&&i3==1) projectInfo.windowInfos.back()->id=GetValue(temp2);
+				projectInfo.windowInfos.back()->SetMenuIdName( temp2 );
+			}
+			else if(lstrcmpi(temporary,"ID")==0&&i3==1)
+			{
+				// 無視
+			}
 			else if(lstrcmpi(temporary,"BGCOLOR")==0&&i3==1){
-				projectInfo.windowInfos.back()->bgColor=GetValue(temp2);
+				projectInfo.windowInfos.back()->SetBackgroundColor( GetValue(temp2) );
 				if(projectInfo.dwVersion<=3){
 					//プロジェクトバージョンが3以前のときは新値に変換する
-					if(projectInfo.windowInfos.back()->bgColor==-1)
-						projectInfo.windowInfos.back()->bgColor=-(int)RGB(255,255,255);
+					if(projectInfo.windowInfos.back()->GetBackgroundColor()==-1)
+						projectInfo.windowInfos.back()->SetBackgroundColor( -(int)RGB(255,255,255) );
 				}
 			}
@@ -1970,12 +1969,10 @@
 			}
 			else if(lstrcmpi(temporary,"ICONID")==0&&i3==1){
-				projectInfo.windowInfos.back()->IconResName=(char *)HeapAlloc(hHeap,0,i2+1);
-				lstrcpy(projectInfo.windowInfos.back()->IconResName,temp2);
+				projectInfo.windowInfos.back()->SetIconResourceName( temp2 );
 			}
 			else if(lstrcmpi(temporary,"CLASS")==0&&i3==1){
 				if(temp2[0]=='\"'&&temp2[lstrlen(temp2)-1]=='\"'){
 					temp2[lstrlen(temp2)-1]=0;
-					projectInfo.windowInfos.back()->ClassName=(char *)HeapAlloc(hHeap,0,i2+1);
-					lstrcpy(projectInfo.windowInfos.back()->ClassName,temp2+1);
+					projectInfo.windowInfos.back()->SetClassName( temp2+1 );
 				}
 			}
@@ -1994,10 +1991,9 @@
 			}
 			else if(lstrcmpi(temporary,"ITEM")==0&&i3==1){
-				CHILDINFO *pChildInfo = new CHILDINFO();
+				ActiveBasic::PM::ChildWindowInfo *pChildInfo = new ActiveBasic::PM::ChildWindowInfo();
 
 				//ID
 				i5=GetOneParameter(temp2,0,temp3);
-				pChildInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
-				lstrcpy(pChildInfo->IdName,temp3);
+				pChildInfo->SetName( temp3 );
 
 				//位置
@@ -2015,14 +2011,13 @@
 				RemoveStringQuotes(temp3);
 				RestoreCaptionSequence(temp3);
-				pChildInfo->caption=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
-				lstrcpy(pChildInfo->caption,temp3);
+				pChildInfo->SetCaption( temp3 );
 
 				//スタイル
 				i5=GetOneParameter(temp2,i5,temp3);
-				pChildInfo->style=GetValue(temp3);
+				pChildInfo->SetStyle( GetValue(temp3) );
 
 				//拡張スタイル
 				i5=GetOneParameter(temp2,i5,temp3);
-				pChildInfo->ExStyle=GetValue(temp3);
+				pChildInfo->SetExStyle( GetValue(temp3) );
 
 				//クラス
@@ -2033,9 +2028,8 @@
 					//イメージ ボックスの場合
 					i5=GetOneParameter(temp2,i5,temp3);
-					pChildInfo->ImageCtrlInfo.type=GetValue(temp3);
+					pChildInfo->image.type = (ActiveBasic::PM::ImageReferenceType::EnumType)GetValue(temp3);
 					i5=GetOneParameter(temp2,i5,temp3);
 					RemoveStringQuotes(temp3);
-					pChildInfo->ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
-					lstrcpy(pChildInfo->ImageCtrlInfo.path,temp3);
+					pChildInfo->image.path = temp3;
 				}
 
@@ -2177,5 +2171,5 @@
 		return;
 	}
-	BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )
+	BOOST_FOREACH( ActiveBasic::PM::WindowInfo *pWindowInfo, projectInfo.windowInfos )
 	{
 		if(lstrcmpi(NewWindow.name,pWindowInfo->GetName().c_str())==0){
@@ -2200,5 +2194,5 @@
 
 	//projectInfo.windowInfos構造体コレクションに追加
-	projectInfo.windowInfos.push_back( new WindowInfo() );
+	projectInfo.windowInfos.push_back( new ActiveBasic::PM::WindowInfo() );
 
 
@@ -2219,6 +2213,5 @@
 
 	//ウィンドウテキスト
-	projectInfo.windowInfos.back()->caption=(char *)HeapAlloc(hHeap,0,lstrlen(NewWindow.name)+1);
-	lstrcpy(projectInfo.windowInfos.back()->caption,NewWindow.name);
+	projectInfo.windowInfos.back()->SetCaption( NewWindow.name );
 
 	//スタイル
@@ -2226,24 +2219,21 @@
 		case WNDTYPE_DEFAULT:
 			//通常ウィンドウ
-			projectInfo.windowInfos.back()->style=WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX;
+			projectInfo.windowInfos.back()->SetStyle( WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX );
 			break;
 		case WNDTYPE_MODALDLG:
 		case WNDTYPE_MODELESSDLG:
 			//ダイアログ テンプレート（最大化、最小化ボタンをなくして、細枠にする）
-			projectInfo.windowInfos.back()->style=WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU;
+			projectInfo.windowInfos.back()->SetStyle( WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU );
 			break;
 	}
 
 	//拡張スタイル
-	projectInfo.windowInfos.back()->ExStyle=0;
+	projectInfo.windowInfos.back()->SetExStyle( 0 );
 
 	//メニュー
-	projectInfo.windowInfos.back()->MenuID=0;
-
-	//ID
-	projectInfo.windowInfos.back()->id=0;
+	projectInfo.windowInfos.back()->SetMenuIdName( "" );
 
 	//背景色
-	projectInfo.windowInfos.back()->bgColor=COLOR_3DFACE;
+	projectInfo.windowInfos.back()->SetBackgroundColor( COLOR_3DFACE );
 
 	//フォント
@@ -2251,10 +2241,9 @@
 
 	//アイコン
-	projectInfo.windowInfos.back()->IconResName=0;
+	projectInfo.windowInfos.back()->SetIconResourceName( "" );
 
 	//クラス名
 	lstrcpy(temporary,"NORMAL");
-	projectInfo.windowInfos.back()->ClassName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-	lstrcpy(projectInfo.windowInfos.back()->ClassName,temporary);
+	projectInfo.windowInfos.back()->SetClassName( temporary );
 
 	//コールバック関数名
@@ -2323,5 +2312,5 @@
 	int i;
 
-	WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
+	ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
 
 	//ウィンドウが開かれている場合は閉じる
@@ -2335,13 +2324,10 @@
 	//ウィンドウ情報のメモリを解放
 	HeapDefaultFree(pWindowInfo->filepath);
-	HeapDefaultFree(pWindowInfo->caption);
-	HeapDefaultFree(pWindowInfo->ClassName);
 	HeapDefaultFree(pWindowInfo->CallBackName);
 
 	//子ウィンドウのメモリを解放
-	for(i=0;i<pWindowInfo->childWindowInfos.size();i++){
-		HeapDefaultFree(pWindowInfo->childWindowInfos[i]->IdName);
-		HeapDefaultFree(pWindowInfo->childWindowInfos[i]->caption);
-		delete pWindowInfo->childWindowInfos[i];
+	BOOST_FOREACH( ActiveBasic::PM::ChildWindowInfo *pChildWindowInfo, pWindowInfo->childWindowInfos )
+	{
+		delete pChildWindowInfo;
 	}
 	pWindowInfo->childWindowInfos.clear();
