Index: trunk/ab5.0/abdev/abdev/RadProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/RadProc.cpp	(revision 629)
+++ trunk/ab5.0/abdev/abdev/RadProc.cpp	(revision 772)
@@ -47,5 +47,5 @@
 	mdic.lParam=0;
 	mdic.style |= WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_SYSMENU | WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
-	hChild=(HWND)SendMessage(hClient,WM_MDICREATE,0,(long)&mdic);	//ウィンドウ作成
+	hChild=(HWND)SendMessage(hClient,WM_MDICREATE,0,(LPARAM)&mdic);	//ウィンドウ作成
 
 
@@ -140,5 +140,5 @@
 
 	//タブに追加
-	pobj_MainTab->InsertItem( windowInfo.GetName().c_str(), true );
+	pobj_MainTab->InsertItem( hChild, windowInfo.GetName().c_str(), true );
 
 	//メニュー状態を設定
@@ -784,5 +784,4 @@
 	SIZE size;
 	SCROLLINFO ScrollInfo,si2;
-	PAINTSTRUCT ps;
 	POINTANDSIZE PointAndSize;
 
@@ -793,6 +792,6 @@
 
 				SetFocus(hwnd);
-				mouse.x=LOWORD(lParam);
-				mouse.y=HIWORD(lParam);
+				mouse.x=GET_X_LPARAM(lParam);
+				mouse.y=GET_Y_LPARAM(lParam);
 				CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
 
@@ -872,6 +871,6 @@
 
 				SetFocus(hwnd);
-				mouse.x=(int)(short)LOWORD(lParam);
-				mouse.y=(int)(short)HIWORD(lParam);
+				mouse.x=GET_X_LPARAM(lParam);
+				mouse.y=GET_Y_LPARAM(lParam);
 				CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
 
@@ -1466,6 +1465,6 @@
 		case WM_MOUSEMOVE:
 			{
-				mouse.x=(int)(short)LOWORD(lParam);
-				mouse.y=(int)(short)HIWORD(lParam);
+				mouse.x=GET_X_LPARAM(lParam);
+				mouse.y=GET_Y_LPARAM(lParam);
 				CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
 
@@ -1631,6 +1630,6 @@
 		case WM_LBUTTONDBLCLK:
 			{
-				mouse.x=LOWORD(lParam);
-				mouse.y=HIWORD(lParam);
+				mouse.x=GET_X_LPARAM(lParam);
+				mouse.y=GET_Y_LPARAM(lParam);
 				CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
 
@@ -1816,6 +1815,12 @@
 			return 0;
 		case WM_PAINT:
+			{
+				WTL::CPaintDC dc(hwnd);
+				SendMessage(hwnd, WM_PRINTCLIENT, reinterpret_cast<WPARAM>(dc.m_hDC), 0);
+				return 0;
+			}
+		case WM_PRINTCLIENT:
 			i=GetWndNum(GetParent(hwnd));
-			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+			if(i==-1) break;	//ウィンドウが初期状態の場合
 			i2=GetWndInfoNum(MdiInfo[i]->path);
 
@@ -1827,8 +1832,7 @@
 			GetScrollInfo(hwnd,SB_HORZ,&si2);
 
-			hdc=BeginPaint(hwnd,&ps);
+			hdc=reinterpret_cast<HDC>(wParam);
 			BitBlt(hdc,0,0,ScreenX*2,ScreenY*2,
 				MdiInfo[i]->MdiRadInfo->hMemDC,si2.nPos,ScrollInfo.nPos,SRCCOPY);
-			EndPaint(hwnd,&ps);
 
 			if(MdiInfo[i]->MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE||MdiInfo[i]->MdiRadInfo->ButtonSelect==NON_TOOL)
@@ -1845,6 +1849,6 @@
 
 			if(MdiInfo[i]->MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
-				mouse.x=LOWORD(lParam);
-				mouse.y=HIWORD(lParam);
+				mouse.x=GET_X_LPARAM(lParam);
+				mouse.y=GET_Y_LPARAM(lParam);
 				ScreenToClient(hwnd,&mouse);
 				CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
@@ -1853,6 +1857,6 @@
 				extern HMENU hRadMenuBase;
 				if(MdiInfo[i]->MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
-					TrackPopupMenu(GetSubMenu(hRadMenuBase,0),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
-				else TrackPopupMenu(GetSubMenu(hRadMenuBase,1),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+					TrackPopupMenu(GetSubMenu(hRadMenuBase,0),TPM_LEFTALIGN,GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam),0,hwnd,0);
+				else TrackPopupMenu(GetSubMenu(hRadMenuBase,1),TPM_LEFTALIGN,GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam),0,hwnd,0);
 			}
 			return 0;
@@ -1989,5 +1993,5 @@
 		case WM_CREATE:
 			extern HICON hWindowDocumentIcon;
-			SendMessage(hwnd,WM_SETICON,ICON_SMALL,(long)hWindowDocumentIcon);
+			SendMessage(hwnd,WM_SETICON,ICON_SMALL,(LPARAM)hWindowDocumentIcon);
 			break;
 		case WM_MDIACTIVATE:
@@ -1996,5 +2000,5 @@
 			if(i==-1) return 0;	//ウィンドウが初期状態の場合
 
-			i=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i]->title.c_str());
+			i=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(LPARAM)MdiInfo[i]->title.c_str());
 			SendMessage(hDocCombo,CB_SETCURSEL,i,0);
 			SetStatusText(NULL);
