Index: trunk/ab5.0/abdev/abdev/RadProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/RadProc.cpp	(revision 611)
+++ trunk/ab5.0/abdev/abdev/RadProc.cpp	(revision 612)
@@ -4,5 +4,6 @@
 #include "common.h"
 
-void NewRadWindow(int WndInfoNum){
+void NewRadWindow( const WINDOW_INFO &windowInfo )
+{
 	extern HINSTANCE hInst,hResInst;
 	extern HWND hDocCombo;
@@ -13,5 +14,4 @@
 	RECT rect;
 	MDICREATESTRUCT mdic;
-	WINDOW_INFO *pWindowInfo = &ProjectInfo.windowInfos[WndInfoNum];
 
 	//すでに指定されたファイルが開かれている場合
@@ -20,5 +20,5 @@
 		i=GetWndNum(hChild);
 		if(MdiInfo[i].DocType==WNDTYPE_RAD){
-			if(lstrcmpi(MdiInfo[i].path,pWindowInfo->name)==0) break;
+			if(lstrcmpi(MdiInfo[i].path,windowInfo.name)==0) break;
 		}
 		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
@@ -29,5 +29,5 @@
 	}
 
-	mdic.szTitle=pWindowInfo->name;
+	mdic.szTitle=windowInfo.name;
 	mdic.szClass="MDIClientWindow_Rad";
 	mdic.hOwner=hInst;
@@ -86,8 +86,8 @@
 			MdiInfo[i].hwnd=hChild;
 			MdiInfo[i].DocType=WNDTYPE_RAD;
-			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pWindowInfo->name)+1);
-			lstrcpy(MdiInfo[i].title,pWindowInfo->name);
-			MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pWindowInfo->name)+1);
-			lstrcpy(MdiInfo[i].path,pWindowInfo->name);
+			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(windowInfo.name)+1);
+			lstrcpy(MdiInfo[i].title,windowInfo.name);
+			MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(windowInfo.name)+1);
+			lstrcpy(MdiInfo[i].path,windowInfo.name);
 
 
@@ -127,8 +127,8 @@
 
 
-			DrawRadWindow(i,pWindowInfo);
+			DrawRadWindow(i,&windowInfo);
 
 			//サポートダイアログの内容をセット
-			SetSupportDlgData(i,WndInfoNum);
+			SetSupportDlgData(i,windowInfo);
 
 			break;
@@ -142,9 +142,9 @@
 	ResizeToRadToolWindows(i,rect.right,rect.bottom);
 
-	i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)pWindowInfo->name);	//Docコンボボックスに追加
+	i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)windowInfo.name);	//Docコンボボックスに追加
 	SendMessage(hDocCombo,CB_SETCURSEL,i,0);
 
 	//タブに追加
-	pobj_MainTab->InsertItem( pWindowInfo->name, true );
+	pobj_MainTab->InsertItem( windowInfo.name, true );
 
 	//メニュー状態を設定
@@ -678,5 +678,5 @@
 
 	//サポートダイアログの内容をセット
-	SetSupportDlgData(WndNum,WndInfoNum);
+	SetSupportDlgData( WndNum, ProjectInfo.windowInfos[WndInfoNum] );
 }
 void SetItemNumOnFrame(int WndNum,int WndInfoNum,RECT *pRect){
@@ -843,5 +843,5 @@
 
 								//サポートダイアログの内容をセット
-								SetSupportDlgData(i,i2);
+								SetSupportDlgData( i, *pWindowInfo );
 								break;
 							}
@@ -958,5 +958,5 @@
 
 						//サポートダイアログの内容をセット
-						SetSupportDlgData(i,i2);
+						SetSupportDlgData( i, *pWindowInfo );
 					}
 				}
@@ -1280,165 +1280,168 @@
 			}
 		case WM_MOUSEMOVE:
-			mouse.x=(int)(short)LOWORD(lParam);
-			mouse.y=(int)(short)HIWORD(lParam);
-			CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
-
-			hParent=GetParent(hwnd);
-			i=GetWndNum(hParent);
-			i2 = GetWndInfoNum(MdiInfo[i].path);
-
-			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
-				if(wParam&MK_LBUTTON&&RadInfo.NowDragging){
-					////////////////////////////////////////////////
-					// ドラッグ中の場合（コントロールのサイズ変更）
-
-					if(RadInfo.NowDragging==FRAME_UPPER_LEFT){
-						if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
-							RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
-						else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
-							RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
-						else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
-
-						if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK))
-							RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
-						else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
-							RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
-						else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
-						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-					}
-					else if(RadInfo.NowDragging==FRAME_UPPER_RIGHT){
-						if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
-							RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
-						else if(mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)
-							RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
-						else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
-
-						if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK)) RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
-						else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
-							RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
-						else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
-						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-					}
-					else if(RadInfo.NowDragging==FRAME_LOWER_LEFT){
-						if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
-							RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
-						else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
-							RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
-						else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
-
-						if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
-							RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
-						else if(mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)
-							RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
-						else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
-						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-					}
-					else if(RadInfo.NowDragging==FRAME_LOWER_RIGHT){
-						if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
-							RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
-						else if((mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
-							RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
-						else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
-
-						if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
-							RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
-						else if((mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
-							RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
-						else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
-						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-					}
-					else if(RadInfo.NowDragging==FRAME_LEFT){
-						if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
-							RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
-						else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
-							RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
-						else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
-						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-					}
-					else if(RadInfo.NowDragging==FRAME_RIGHT){
-						if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
-							RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
-						else if((mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
-							RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
-						else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
-						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-					}
-					else if(RadInfo.NowDragging==FRAME_UPPER){
-						if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK))
-							RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
-						else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
-							RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
-						else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
-						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-					}
-					else if(RadInfo.NowDragging==FRAME_LOWER){
-						if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top) 
-							RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
-						else if((mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
-							RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
-						else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
-						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-					}
-					else if(RadInfo.NowDragging==FRAME_INSIDE){
-						i3=0;
-						while(MdiInfo[i].MdiRadInfo->SelectingItem[i3]!=-1){
-							i4=RadInfo.DragStartRect[i3].left+mouse.x-RadInfo.DragStartPos.x;
-
-							if(i4>MdiInfo[i].MdiRadInfo->ClientPos.x){
-								i4=RadInfo.DragStartRect[i3].right+mouse.x-RadInfo.DragStartPos.x;
-								if(i4<MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx) i4=0;
-								else i4-=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+			{
+				mouse.x=(int)(short)LOWORD(lParam);
+				mouse.y=(int)(short)HIWORD(lParam);
+				CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
+
+				hParent=GetParent(hwnd);
+				i=GetWndNum(hParent);
+				i2 = GetWndInfoNum(MdiInfo[i].path);
+				WINDOW_INFO *pWindowInfo = GetWndInfo(MdiInfo[i].path);
+
+				if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
+					if(wParam&MK_LBUTTON&&RadInfo.NowDragging){
+						////////////////////////////////////////////////
+						// ドラッグ中の場合（コントロールのサイズ変更）
+
+						if(RadInfo.NowDragging==FRAME_UPPER_LEFT){
+							if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
+								RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
+							else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
+								RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
+							else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
+
+							if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK))
+								RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
+							else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
+								RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
+							else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						else if(RadInfo.NowDragging==FRAME_UPPER_RIGHT){
+							if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
+								RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
+							else if(mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)
+								RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+							else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
+
+							if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK)) RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
+							else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
+								RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
+							else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						else if(RadInfo.NowDragging==FRAME_LOWER_LEFT){
+							if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
+								RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
+							else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
+								RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
+							else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
+
+							if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
+								RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
+							else if(mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)
+								RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
+							else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						else if(RadInfo.NowDragging==FRAME_LOWER_RIGHT){
+							if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
+								RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
+							else if((mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
+								RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+							else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
+
+							if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
+								RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
+							else if((mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
+								RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
+							else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						else if(RadInfo.NowDragging==FRAME_LEFT){
+							if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
+								RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
+							else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
+								RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
+							else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						else if(RadInfo.NowDragging==FRAME_RIGHT){
+							if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
+								RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
+							else if((mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
+								RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+							else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						else if(RadInfo.NowDragging==FRAME_UPPER){
+							if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK))
+								RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
+							else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
+								RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
+							else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						else if(RadInfo.NowDragging==FRAME_LOWER){
+							if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top) 
+								RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
+							else if((mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
+								RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
+							else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						else if(RadInfo.NowDragging==FRAME_INSIDE){
+							i3=0;
+							while(MdiInfo[i].MdiRadInfo->SelectingItem[i3]!=-1){
+								i4=RadInfo.DragStartRect[i3].left+mouse.x-RadInfo.DragStartPos.x;
+
+								if(i4>MdiInfo[i].MdiRadInfo->ClientPos.x){
+									i4=RadInfo.DragStartRect[i3].right+mouse.x-RadInfo.DragStartPos.x;
+									if(i4<MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx) i4=0;
+									else i4-=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+								}
+								else i4-=MdiInfo[i].MdiRadInfo->ClientPos.x;
+								//i4は枠外に出たときのポインタと壁にあたったコントロールとの差
+								RadInfo.DraggingRect[i3].left=RadInfo.DragStartRect[i3].left+mouse.x-RadInfo.DragStartPos.x-i4;
+								RadInfo.DraggingRect[i3].right=RadInfo.DragStartRect[i3].right+mouse.x-RadInfo.DragStartPos.x-i4;
+
+								i4=RadInfo.DragStartRect[i3].top+mouse.y-RadInfo.DragStartPos.y;
+								if(i4>MdiInfo[i].MdiRadInfo->ClientPos.y){
+									i4=RadInfo.DragStartRect[i3].bottom+mouse.y-RadInfo.DragStartPos.y;
+									if(i4<MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy) i4=0;
+									else i4-=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
+								}
+								else i4-=MdiInfo[i].MdiRadInfo->ClientPos.y;
+								RadInfo.DraggingRect[i3].top=RadInfo.DragStartRect[i3].top+mouse.y-RadInfo.DragStartPos.y-i4;
+								RadInfo.DraggingRect[i3].bottom=RadInfo.DragStartRect[i3].bottom+mouse.y-RadInfo.DragStartPos.y-i4;
+
+								if(MdiInfo[i].MdiRadInfo->SelectingItem[1]==-1) i4=1;
+								else i4=0;
+								DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[i3],&RadInfo.OldDraggingRect[i3],i4);
+								i3++;
 							}
-							else i4-=MdiInfo[i].MdiRadInfo->ClientPos.x;
-							//i4は枠外に出たときのポインタと壁にあたったコントロールとの差
-							RadInfo.DraggingRect[i3].left=RadInfo.DragStartRect[i3].left+mouse.x-RadInfo.DragStartPos.x-i4;
-							RadInfo.DraggingRect[i3].right=RadInfo.DragStartRect[i3].right+mouse.x-RadInfo.DragStartPos.x-i4;
-
-							i4=RadInfo.DragStartRect[i3].top+mouse.y-RadInfo.DragStartPos.y;
-							if(i4>MdiInfo[i].MdiRadInfo->ClientPos.y){
-								i4=RadInfo.DragStartRect[i3].bottom+mouse.y-RadInfo.DragStartPos.y;
-								if(i4<MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy) i4=0;
-								else i4-=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
-							}
-							else i4-=MdiInfo[i].MdiRadInfo->ClientPos.y;
-							RadInfo.DraggingRect[i3].top=RadInfo.DragStartRect[i3].top+mouse.y-RadInfo.DragStartPos.y-i4;
-							RadInfo.DraggingRect[i3].bottom=RadInfo.DragStartRect[i3].bottom+mouse.y-RadInfo.DragStartPos.y-i4;
-
-							if(MdiInfo[i].MdiRadInfo->SelectingItem[1]==-1) i4=1;
-							else i4=0;
-							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[i3],&RadInfo.OldDraggingRect[i3],i4);
-							i3++;
-						}
-					}
-					else if(RadInfo.NowDragging==SELECTING_FRAME){
-						RadInfo.DraggingRect[0].left=RadInfo.DragStartPos.x;
-						RadInfo.DraggingRect[0].top=RadInfo.DragStartPos.y;
+						}
+						else if(RadInfo.NowDragging==SELECTING_FRAME){
+							RadInfo.DraggingRect[0].left=RadInfo.DragStartPos.x;
+							RadInfo.DraggingRect[0].top=RadInfo.DragStartPos.y;
+							RadInfo.DraggingRect[0].right=mouse.x;
+							RadInfo.DraggingRect[0].bottom=mouse.y;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+						}
+						SetCursorByState(RadInfo.NowDragging);
+
+						SetStatusText(NULL);
+
+						//サポートダイアログの内容をセット
+						SetSupportDlgData( i, *pWindowInfo );
+					}
+					else{
+						//ドラッグ中でないとき
+						SetCursorByState(GetStateOfDraggingFrame(i,i2,mouse.x,mouse.y));
+					}
+				}
+				else{
+					//アイテム（子ウィンドウ作成中）
+					if(wParam&MK_LBUTTON&&RadInfo.NowDragging==ITEM_MAKING){
+						//ドラッグ中の場合
+
 						RadInfo.DraggingRect[0].right=mouse.x;
 						RadInfo.DraggingRect[0].bottom=mouse.y;
 						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
 					}
-					SetCursorByState(RadInfo.NowDragging);
-
-					SetStatusText(NULL);
-
-					//サポートダイアログの内容をセット
-					SetSupportDlgData(i,i2);
 				}
-				else{
-					//ドラッグ中でないとき
-					SetCursorByState(GetStateOfDraggingFrame(i,i2,mouse.x,mouse.y));
-				}
+				return 0;
 			}
-			else{
-				//アイテム（子ウィンドウ作成中）
-				if(wParam&MK_LBUTTON&&RadInfo.NowDragging==ITEM_MAKING){
-					//ドラッグ中の場合
-
-					RadInfo.DraggingRect[0].right=mouse.x;
-					RadInfo.DraggingRect[0].bottom=mouse.y;
-					DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
-				}
-			}
-			return 0;
 		case WM_LBUTTONDBLCLK:
 			{
@@ -1477,5 +1480,4 @@
 				hParent=GetParent(hwnd);
 				i=GetWndNum(hParent);
-				i2=GetWndInfoNum(MdiInfo[i].path);
 				WINDOW_INFO *pWindowInfo = GetWndInfo(MdiInfo[i].path);
 				if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
@@ -1502,5 +1504,5 @@
 
 								//サポートダイアログの内容をセット
-								SetSupportDlgData(i,i2);
+								SetSupportDlgData( i, *pWindowInfo );
 							}
 						}
@@ -1528,5 +1530,5 @@
 
 							//サポートダイアログの内容をセット
-							SetSupportDlgData(i,i2);
+							SetSupportDlgData( i, *pWindowInfo );
 						}
 						else if(wParam==VK_LEFT){
@@ -1549,5 +1551,5 @@
 
 							//サポートダイアログの内容をセット
-							SetSupportDlgData(i,i2);
+							SetSupportDlgData( i, *pWindowInfo );
 						}
 						else if(wParam==VK_UP){
@@ -1570,5 +1572,5 @@
 
 							//サポートダイアログの内容をセット
-							SetSupportDlgData(i,i2);
+							SetSupportDlgData( i, *pWindowInfo );
 						}
 						else if(wParam==VK_DOWN){
@@ -1591,5 +1593,5 @@
 
 							//サポートダイアログの内容をセット
-							SetSupportDlgData(i,i2);
+							SetSupportDlgData( i, *pWindowInfo );
 						}
 						else if(wParam==VK_DELETE)
