Index: trunk/Include/Classes/ActiveBasic/Windows/CriticalSection.ab
===================================================================
--- trunk/Include/Classes/ActiveBasic/Windows/CriticalSection.ab	(revision 302)
+++ trunk/Include/Classes/ActiveBasic/Windows/CriticalSection.ab	(revision 303)
@@ -7,5 +7,5 @@
 
 Namespace Detail
-	Const InterlockedExchangeAnyPointer(p, x) = InterlockedExchangePointer(VarPtr(p) As VoidPtr, x)
+	Const InterlockedExchangeAnyPointer(p, x) = InterlockedExchangePointer(ByVal VarPtr(p) As *VoidPtr, x)
 End Namespace
 
@@ -53,7 +53,8 @@
 
 	/*Override*/ Sub Dispose()
-		Dim pcs = Detail.InterlockedExchangeAnyPointer(pcs, 0)
-		If pcs <> 0 Then
-			LeaveCriticalSection(ByVal pcs)
+'		Dim p = ActiveBasic.Windows.Detail.InterlockedExchangeAnyPointer(pcs, 0)
+		Dim p = InterlockedExchangePointer(pcs As VoidPtr, 0) As *CRITICAL_SECTION
+		If p <> 0 Then
+			LeaveCriticalSection(ByVal p)
 		End If
 	End Sub
Index: trunk/Include/Classes/ActiveBasic/Windows/WindowHandle.sbp
===================================================================
--- trunk/Include/Classes/ActiveBasic/Windows/WindowHandle.sbp	(revision 302)
+++ trunk/Include/Classes/ActiveBasic/Windows/WindowHandle.sbp	(revision 303)
@@ -1,6 +1,3 @@
-' Windows/WindowHandle.sbp
-
-#ifndef __WINDOWS_WINDOWHANDLE_SBP__
-#define __WINDOWS_WINDOWHANDLE_SBP__
+'Classes/ActiveBasic/Windows/WindowHandle.sbp
 
 #ifdef _WIN64
@@ -16,7 +13,7 @@
 #endif
 Declare Function _System_GetParent Lib "user32" Alias "GetParent" (hWnd As HWND) As HWND
-Declare Function _System_SetParent Lib "user32" Alias "SetParent" (hWnd As HWND) As HWND
+Declare Function _System_SetParent Lib "user32" Alias "SetParent" (hWnd As HWND, hwndParent As HWND) As HWND
 Declare Function _System_GetMenu Lib "user32" Alias "GetMenu" (hWnd As HWND) As HMENU
-Declare Function _System_SetMenu Lib "user32" Alias "SetMenu" (hWnd As HWND) As HMENU
+Declare Function _System_SetMenu Lib "user32" Alias "SetMenu" (hWnd As HWND, hmenu As HMENU) As HMENU
 Declare Function _System_InvalidateRect Lib "user32" Alias "InvalidateRect" (hWnd As HWND, ByRef Rect As RECT, bErase As BOOL) As BOOL
 Declare Function _System_InvalidateRgn Lib "user32" Alias "InvalidateRgn" (hWnd As HWND, hRgn As HRGN, bErase As BOOL) As BOOL
@@ -33,5 +30,5 @@
 Declare Function _System_GetWindowRect Lib "user32" Alias "DrawMenuBar" (hWnd As HWND, ByRef Rect As RECT) As BOOL
 Declare Function _System_IsWindow Lib "user32" Alias "IsWindow" (hWnd As HWND) As BOOL
-Declare Function _System_Isiconic Lib "user32" Alias "Isiconic" (hWnd As HWND) As BOOL
+Declare Function _System_IsIconic Lib "user32" Alias "IsIconic" (hWnd As HWND) As BOOL
 Declare Function _System_GetClientRect Lib "user32" Alias "GetClientRect" (hWnd As HWND, ByRef Rect As RECT) As BOOL
 Declare Function _System_GetProp Lib "user32" Alias _FuncName_GetProp (hWnd As HWND, pString As PCTSTR) As HANDLE
@@ -41,6 +38,15 @@
 Declare Function _System_SetScrollInfo Lib "user32" Alias "SetScrollInfo" (hWnd As HWND, fnBar As Long, ByRef lpsi As SCROLLINFO, bRedraw As Long) As BOOL
 Declare Function _System_GetSystemMenu Lib "user32" Alias "GetSystemMenu" (hWnd As HWND, bRevert As BOOL) As HMENU
-Declare Function _System_GetDC Lib "gdi32" Alias "GetDC" (hwnd As HWND) As HDC
-Declare Function _System_ReleaseDC Lib "gdi32" Alias "ReleaseDC" (hwnd As HWND, hdc As HDC) As BOOL
+Declare Function _System_GetDC Lib "user32" Alias "GetDC" (hwnd As HWND) As HDC
+Declare Function _System_GetDCEx Lib "user32" Alias "GetDCEx" (hwnd As HWND, hrgnClip As HRGN, flags As DWord) As HDC
+Declare Function _System_GetWindowDC Lib "user32" Alias "GetWindowDC" (hwnd As HWND) As HDC
+Declare Function _System_ReleaseDC Lib "user32" Alias "ReleaseDC" (hwnd As HWND, hdc As HDC) As BOOL
+Declare Function _System_SendMessage Lib "user32" Alias _FuncName_SendMessage (hwnd As HWND, msg As DWord, wp As WPARAM, lp As LPARAM) As LRESULT
+Declare Function _System_PostMessage Lib "user32" Alias _FuncName_PostMessage (hwnd As HWND, msg As DWord, wp As WPARAM, lp As LPARAM) As LRESULT
+Declare Function _System_SendDlgItemMessage Lib "user32" Alias _FuncName_SendDlgItemMessage (hwnd As HWND, id As DWord, msg As DWord, wp As WPARAM, lp As LPARAM) As LRESULT
+Declare Function _System_GetWindowThreadProcessId Lib "user32" Alias "GetWindowThreadProcessId" (hwnd As HWND, pdwProcessId As *DWord) As DWord
+
+Namespace ActiveBasic
+Namespace Windows
 
 Class WindowHandle
@@ -55,12 +61,4 @@
 	End Sub
 
-	Sub WindowHandle(wnd As WindowHandle)
-		hwnd = wnd.hwnd
-	End Sub
-
-	Sub Operator =(hwndNew As HWND)
-		hwnd = hwndNew
-	End Sub
-
 	Const Function HWnd() As HWND
 		Return hwnd
@@ -78,5 +76,5 @@
 		Return _System_BeginPaint(hwnd, ps)
 	End Function
-
+/*
 	Const Function ChildFromPoint(x As Long, y As Long) As WindowHandle
 		Return New WindowHandle(ChildWindowFromPoint(hwnd, x, y))
@@ -86,5 +84,5 @@
 		Return New WindowHandle(ChildWindowFromPointEx(hwnd, x, y, flags))
 	End Function
-
+*/
 	Const Function ClientToScreen(ByRef pt As POINTAPI) As Boolean
 		Return _System_ClientToScreen(hwnd, pt) As Boolean
@@ -101,5 +99,5 @@
 
 	Function CreateCaret(hbmp As HBITMAP, width As Long, height As Long) As Boolean
-		Return _System_CreateCaret(hwnd, hbmp, width, hegiht) As Boolean
+		Return _System_CreateCaret(hwnd, hbmp, width, height) As Boolean
 	End Function
 
@@ -111,9 +109,9 @@
 		Return _System_DrawMenuBar(hwnd) As Boolean
 	End Function
-
+/*
 	Function EnableScrollBar(SBFlags As DWord, arrows As DWord) As Boolean
 		Return EnableScrollBar(hwnd, SBFlags, arrows) As Boolean
 	End Function
-
+*/
 	Function Enable(enable As Boolean) As Boolean
 		Return EnableWindow(hwnd, enable) As Boolean
@@ -137,5 +135,5 @@
 
 	Const Function GetClassName(className As PTSTR, maxCount As Long) As Long
-		Return _System_GetClassName(className, maxCount)
+		Return _System_GetClassName(hwnd, className, maxCount)
 	End Function
 
@@ -143,9 +141,9 @@
 		Return _System_GetClientRect(hwnd, rc) As Boolean
 	End Function
-
+/*
 	Const Function GetContextHelpId() As DWord
 		Return GetWindowContextHelpId(hwnd)
 	End Function
-
+*/
 	Function GetDC() As HDC
 		Return _System_GetDC(hwnd)
@@ -153,7 +151,7 @@
 
 	Function GetDCEx(hrgnClip As HRGN, flags As DWord) As HDC
-		Return GetDCEx(hwnd, hrgnClip, flags)
-	End Function
-
+		Return _System_GetDCEx(hwnd, hrgnClip, flags)
+	End Function
+/*
 	Const Function GetDlgCtrlID() As Long
 		Return GetDlgCtrlID(hwnd)
@@ -167,13 +165,13 @@
 		Return GetDlgItemText(hwnd, idDlgItem, ps, maxCount)
 	End Function
-
+*/
 	Const Function GetMenu() As HMENU
 		Return _System_GetMenu(hwnd)
 	End Function
-
+/*
 	Const Function GetParent() As WindowHandle
 		Return New WindowHandle(_System_GetParent(hwnd))
 	End Function
-
+*/
 	Const Function GetProp(str As String) As HANDLE
 		Return _System_GetProp(hwnd, ToTCStr(str))
@@ -191,5 +189,5 @@
 		Return _System_GetScrollInfo(hwnd, fnBar, si) As Boolean
 	End Function
-
+/*
 	Const Function GetSystemMenu(revert As Boolean) As HMENU
 		Return GetSystemMenu(hwnd, revert)
@@ -207,7 +205,7 @@
 		Return GetWindow(hwnd, cmd)
 	End Function
-
+*/
 	Function GetWindowDC() As HDC
-		Return GetWindowDC(hwnd)
+		Return _System_GetWindowDC(hwnd)
 	End Function
 
@@ -215,15 +213,15 @@
 		Return _System_GetWindowLongPtr(hwnd, index)
 	End Function
-
+/*
 	Const Function GetWindowPlasement(ByRef wndpl As WINDOWPLACEMENT) As Boolean
 		Return GetWindowPlasement(hwnd, wndpl) As Boolean
 	End Function
-
+*/
 	Const Function GetWindowRect(ByRef rc As RECT) As Boolean
-		Return _System_GetWindowRect(rc) As Boolean
+		Return _System_GetWindowRect(hwnd, rc) As Boolean
 	End Function
 
 	Const Function GetText(ps As PTSTR, maxCount As Long) As Boolean
-		Return GetWindowText(ps, maxCount) As Boolean
+		Return GetWindowText(hwnd, ps, maxCount) As Boolean
 	End Function
 
@@ -233,9 +231,9 @@
 
 	Const Function GetWindowThreadId() As DWord
-		Return GetWindowProcessThreadId(hwnd, 0)
-	End Function
-
-	Const Function GetWindowProcessThreadId(ByRef processId As DWord) As DWord
-		Return GetWindowProcessThreadId(hwnd, VarPtr(processId))
+		Return _System_GetWindowThreadProcessId(hwnd, 0)
+	End Function
+
+	Const Function GetWindowThreadProcessId(ByRef processId As DWord) As DWord
+		Return _System_GetWindowThreadProcessId(hwnd, VarPtr(processId))
 	End Function
 
@@ -267,5 +265,5 @@
 		Return _System_InvalidateRect(hwnd, ByVal 0, TRUE) As Boolean
 	End Function
-
+/*
 	Const Function IsChild(hwnd As HWND) As Boolean
 		Return IsChild(This.hwnd, hwnd) As Boolean
@@ -275,5 +273,5 @@
 		Return IsDialogMessage(hwnd, msg) As Boolean
 	End Function
-
+*/
 	Const Function IsIconic() As Boolean
 		Return _System_IsIconic(hwnd) As Boolean
@@ -295,5 +293,5 @@
 		Return IsWindowVisible(hwnd) As Boolean
 	End Function
-
+/*
 	Const Function IsZoomed() As Boolean
 		Return IsZoomed(hwnd) As Boolean
@@ -303,9 +301,9 @@
 		Return KillTimer(idEvent) As Boolean
 	End Function
-
+*/
 	Function LockUpdate() As Boolean
 		Return LockWindowUpdate(hwnd) As Boolean
 	End Function
-
+/*
 	Function MapPoints(hwndTo As HWND, pPoints As *POINTAPI, cPoints As DWord) As Long
 		Return MapWindowPoints(hwnd, hwndTo, pPoints, cPoints)
@@ -327,5 +325,5 @@
 		Return MessageBox(hwnd, text, 0, MB_OK)
 	End Function
-
+*/
 	Function Move(x As Long, y As Long, width As Long, height As Long, repaint As Boolean) As Boolean
 		Return MoveWindow(hwnd, x, y, width, height, repaint) As Boolean
@@ -336,5 +334,5 @@
 	End Function
 
-	Function Move(ByRef rc As RECT, repeaint As Boolean) As Boolean
+	Function Move(ByRef rc As RECT, repaint As Boolean) As Boolean
 		With rc
 			Return MoveWindow(hwnd, .left, .top, .right - .left, .bottom - .top, repaint) As Boolean
@@ -347,5 +345,5 @@
 		End With
 	End Function
-
+/*
 	Function OpenClipboard() As Boolean
 		Return OpenClipboard(hwnd) As Boolean
@@ -355,21 +353,21 @@
 		Return OpenIcon(hwnd) As Boolean
 	End Function
-
+*/
 	Function PostMessage(msg As DWord, wp As WPARAM, lp As LPARAM) As Boolean
-		Return PostMessage(hwnd, msg, wp, lp) As Boolean
+		Return _System_PostMessage(hwnd, msg, wp, lp) As Boolean
 	End Function
 
 	Function PostMessage(msg As DWord) As Boolean
-		Return PostMessage(hwnd, msg, 0, 0) As Boolean
-	End Function
-
+		Return _System_PostMessage(hwnd, msg, 0, 0) As Boolean
+	End Function
+/*
 	Function RedrawWindow(ByRef rcUpdate As RECT, hrgnUpdate As HRGN, flags As DWord) As Boolean
 		Return RedrawWindow(hwnd, rcUpdatre, hrgnUpdate, flags) As Boolean
 	End Function
-
+*/
 	Function ReleaseDC(hdc As HDC) As Boolean
 		Return _System_ReleaseDC(hwnd, hdc) As Boolean
 	End Function
-
+/*
 	Function RemoveProp(str As String) As HANDLE
 		Return RemoveProp(hwnd, ToTCStr(str))
@@ -383,5 +381,5 @@
 		Return RemoveProp(hwnd, atom As ULONG_PTR As PCTSTR)
 	End Function
-
+*/
 	Const Function ScreenToClient(ByRef pt As POINTAPI) As Boolean
 		Return _System_ScreenToClient(hwnd, pt) As Boolean
@@ -398,19 +396,19 @@
 
 	Function SendDlgItemMessage(idDlgItem As Long, msg As DWord, wp As WPARAM, lp As LPARAM) As LRESULT
-		Return SendDlgItemMessage(hwnd, idDlgItem, wp, lp)
+		Return _System_SendDlgItemMessage(hwnd, idDlgItem, msg, wp, lp)
 	End Function
 
 	Function SendDlgItemMessage(idDlgItem As Long, msg As DWord) As LRESULT
-		Return SendDlgItemMessage(hwnd, idDlgItem, 0, 0)
+		Return _System_SendDlgItemMessage(hwnd, idDlgItem, msg, 0, 0)
 	End Function
 
 	Function SendMessage(msg As DWord, wp As WPARAM, lp As LPARAM) As LRESULT
-		Return SendMessage(hwnd, msg, wp, lp)
+		Return _System_SendMessage(hwnd, msg, wp, lp)
 	End Function
 
 	Function SendMessage(msg As DWord) As LRESULT
-		Return SendMessage(hwnd, msg, 0, 0)
-	End Function
-
+		Return _System_SendMessage(hwnd, msg, 0, 0)
+	End Function
+/*
 	Function SetActiveWindow() As WindowHandle
 		Return New WindowHandle(SetActiveWindow(hwnd))
@@ -424,13 +422,13 @@
 		Return New WindowHandle(SetCapture(hwnd))
 	End Function
-
+*/
 	Function SetClassLongPtr(index As Long, newLong As LONG_PTR) As LONG_PTR
 		Return _System_SetClassLongPtr(hwnd, index, newLong)
 	End Function
-
+/*
 	Function SetFocus() As WindowHandle
 		Return New WindowHandle(SetFocus(hwnd))
 	End Function
-
+*/
 	Function SetForeground() As Boolean
 		Return SetForegroundWindow(hwnd) As Boolean
@@ -454,5 +452,5 @@
 
 	Function SetProp(atom As ATOM, hData As HANDLE) As Boolean
-		Return SetProp((atom As ULONG_PTR) As PCTSTR, hData) As Boolean
+		Return This.SetProp((atom As ULONG_PTR) As PCTSTR, hData) As Boolean
 	End Function
 
@@ -464,5 +462,5 @@
 		Return _System_SetScrollInfo(hwnd, fnBar, si, TRUE) As Boolean
 	End Function
-
+/*
 	Function SetTimer(idEvent As ULONG_PTR, elapse As DWord, timerFunc As TIMERPROC) As ULONG_PTR
 		Return SetTmer(hwnd, idEvent, elapse, timerFunc)
@@ -470,5 +468,5 @@
 
 	Function SetTimer(idEvent As ULONG_PTR, elapse As DWord) As ULONG_PTR
-		Return SetTmer(hwnd, idEvent, elapse, 0)
+		Return This.SetTmer(hwnd, idEvent, elapse, 0)
 	End Function
 
@@ -476,13 +474,13 @@
 		Return SetContextHelpId(hwnd, contextHelpId) As Boolean
 	End Function
-
+*/
 	Function SetWindowLongPtr(index As Long, newLong As LONG_PTR) As LONG_PTR
 		Return _System_SetWindowLongPtr(hwnd, index, newLong)
 	End Function
-
+/*
 	Function SetWindowPlacement(ByRef wndpl As WINDOWPLACEMENT) As Boolean
 		Return SetWindowPlacement(hwnd, wndpl) As Boolean
 	End Function
-
+*/
 	Function SetPos(hwndInsertAfter As HWND, x As Long, y As Long, cx As Long, cy As Long, flags As DWord) As Boolean
 		Return SetWindowPos(hwnd, hwndInsertAfter, x, y, cx, cy, flags) As Boolean
@@ -514,5 +512,5 @@
 		Return _System_ShowCaret(hwnd) As Boolean
 	End Function
-
+/*
 	Function ShowScrollBar(bar As DWord, show As Boolean) As Boolean
 		Return ShowScrollBar(hwnd, bar, show) As Boolean
@@ -522,5 +520,5 @@
 		Return ShowScrollBar(hwnd, bar, TRUE) As Boolean
 	End Function
-
+*/
 	Function Show(cmdShow As DWord) As Boolean
 		Return ShowWindow(hwnd, cmdShow) As Boolean
@@ -556,9 +554,9 @@
 		Return _System_GetWindowLongPtr(hwnd, GWL_STYLE) As DWord
 	End Function
-
+#ifdef _UNDEF
 	Const Function GetWndProc() As WNDPROC
-		Return _System_GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As WNDPROC
-	End Function
-
+		Return _System_GetWindowLongPtr(hwnd, GWLP_WNDPROC) As WNDPROC
+	End Function
+#endif
 	Const Function GetInstance() As HINSTANCE
 		Return _System_GetWindowLongPtr(hwnd, GWLP_HINSTANCE) As HINSTANCE
@@ -576,11 +574,11 @@
 		Return _System_SetWindowLongPtr(hwnd, GWL_STYLE, style) As DWord
 	End Function
-
+#ifdef _UNDEF
 	Function SetWndProc(wndProc As WNDPROC) As WNDPROC
-		Return _System_SetWindowLongPtR(hwnd, GWLP_WNDPROC, wndProc As WNDPROC) As WNDPROC
-	End Function
-
+		Return _System_SetWindowLongPtr(hwnd, GWLP_WNDPROC, wndProc As WNDPROC) As WNDPROC
+	End Function
+#endif
 	Function SetUserData(value As LONG_PTR) As LONG_PTR
-		Return _System_SetWindowLongPtr(value As LONG_PTR)
+		Return _System_SetWindowLongPtr(hwnd, GWLP_USERDATA, value As LONG_PTR)
 	End Function
 
@@ -592,8 +590,8 @@
 		Return rc
 	End Function
-
+#ifdef _UNDEF
 	Sub ClientRect(ByRef rc As RECT)
 		Dim hasMenu As BOOL
-		If IsChild() = False And IsMenu() <> False Then
+		If IsChild() = False And GetMenu() <> 0 Then
 			hasMenu = TRUE
 		Else
@@ -601,7 +599,7 @@
 		End If
 		AdjustWindowRectEx(rc, GetStyle(), hasMenu, GetExStyle())
-		MoveWindow(rc) ' WindowRect = rc
-	End Sub
-
+		This.Move(rc) ' WindowRect = rc
+	End Sub
+#endif
 	Const Function WindowRect() As RECT
 		Dim rc As RECT
@@ -611,7 +609,7 @@
 
 	Sub WindowRect(ByRef rc As RECT)
-		MoveWindow(rc)
-	End Sub
-
+		This.Move(rc)
+	End Sub
+#ifdef _UNDEF
 	Const Function ContextHelpID() As DWord
 		Return GetContextHelpId(hwnd)
@@ -634,5 +632,5 @@
 		Return w
 	End Function
-
+#endif
 	Const Function ExStyle() As DWord
 		Return _System_GetWindowLongPtr(hwnd, GWL_EXSTYLE) As DWord
@@ -640,5 +638,5 @@
 
 	Sub ExStyle(newExStyle As DWord)
-		_System_SetWindowLongPtr(hwnd, GWLP_EXSTYLE, newExStyle)
+		_System_SetWindowLongPtr(hwnd, GWL_EXSTYLE, newExStyle)
 	End Sub
 
@@ -648,5 +646,5 @@
 
 	Sub Style(newStyle As DWord)
-		_System_SetWindowLongPtr(hwnd, GWLP_STYLE, newStyle)
+		_System_SetWindowLongPtr(hwnd, GWL_STYLE, newStyle)
 	End Sub
 
@@ -660,9 +658,9 @@
 
 	Const Function Font() As HFONT
-		Return SendMessage(hwnd, WM_GETFONT, 0, 0) As HFONT
+		Return _System_SendMessage(hwnd, WM_GETFONT, 0, 0) As HFONT
 	End Function
 
 	Sub Font(hfntNew As HFONT)
-		SendMessage(hwnd, WM_SETFONT, hfntNew As WPARAM, TRUE)
+		_System_SendMessage(hwnd, WM_SETFONT, hfntNew As WPARAM, TRUE)
 	End Sub
 
@@ -680,5 +678,5 @@
 
 	Const Function Minimized() As Boolean
-		Return IsIconic(hwnd) As Boolean
+		Return _System_IsIconic(hwnd) As Boolean
 	End Function
 
@@ -705,10 +703,10 @@
 	End Sub
 
-	Const Function ProcessID() As DWord
-		GetWindowProcessThreadId(ProcessID)
-	End Function
-
-	Const Function ThreadID() As DWord
-		Return GetWindowProcessThreadId(ByVal 0)
+	Const Function ProcessId() As DWord
+		GetWindowThreadProcessId(ProcessId)
+	End Function
+
+	Const Function ThreadId() As DWord
+		Return GetWindowThreadProcessId(ByVal 0)
 	End Function
 
@@ -759,5 +757,5 @@
 		Return GetWindowTextLength(hwnd)
 	End Function
-
+#ifdef _UNDEF
 	Const Function UserData() As LONG_PTR
 		Return _System_GetWindowLongPtr(hwnd, GWLP_USERDATA)
@@ -767,7 +765,7 @@
 		_System_SetWindowLongPtr(hwnd, GWLP_USERDATA, newValue)
 	End Sub
-
+#endif
 	Const Function Visible() As Boolean
-		Return IsVisible(hwnd) As Boolean
+		Return IsWindowVisible(hwnd) As Boolean
 	End Function
 
@@ -779,5 +777,5 @@
 		EndIf
 	End Sub
-
+#ifdef _UNDEF
 	Const Function WindowPlacement() As WINDOWPLACEMENT
 		WindowPlacement.length = Len(WindowPlacement)
@@ -796,5 +794,5 @@
 		_System_SetWindowLongPtr(hwnd, GWLP_WNDPROC, newWndProc As LONG_PTR)
 	End Sub
-
+#endif
 Protected
 	Sub SetHWnd(hwndNew As HWND)
@@ -803,3 +801,4 @@
 End Class
 
-#endif '__WINDOWS_WINDOWHANDLE_SBP__
+End Namespace 'Widnows
+End Namespace 'ActiveBasic
Index: trunk/Include/Classes/ActiveBasic/Windows/Windows.ab
===================================================================
--- trunk/Include/Classes/ActiveBasic/Windows/Windows.ab	(revision 302)
+++ trunk/Include/Classes/ActiveBasic/Windows/Windows.ab	(revision 303)
@@ -27,4 +27,23 @@
 	Return GetFolderPath(0, folder)
 End Function
+/*
+Function MessageBox(hw As HWND, s As PCSTR, t As PCSTR, b As DWord) As DWord
+	Return MessageBoxA(hw, s, t, b)
+End Function
+
+Function MessageBox(hw As HWND, s As PCWSTR, t As PCWSTR, b As DWord) As DWord
+	Return MessageBoxW(hw, s, t, b)
+End Function
+*/
+
+Namespace Detail
+Function _System_MessageBox(hw As HWND, s As PCSTR, t As PCSTR, b As DWord) As DWord
+	Return MessageBoxA(hw, s, t, b)
+End Function
+
+Function _System_MessageBox(hw As HWND, s As PCWSTR, t As PCWSTR, b As DWord) As DWord
+	Return MessageBoxW(hw, s, t, b)
+End Function
+End Namespace
 
 End Namespace 'Widnows
Index: trunk/Include/Classes/System/Drawing/Color.ab
===================================================================
--- trunk/Include/Classes/System/Drawing/Color.ab	(revision 302)
+++ trunk/Include/Classes/System/Drawing/Color.ab	(revision 303)
@@ -69,5 +69,5 @@
 			Exit Sub ' パレットインデックス指定は無効
 		Else
-			argb = Color_MakeARGB(255, GetRValue(rgb), GetGValue(rgb), GetBValue(rgb))
+			argb = MakeARGB(255, GetRValue(rgb) As Byte, GetGValue(rgb) As Byte, GetBValue(rgb) As Byte)
 		End If
 	End Sub
@@ -82,21 +82,17 @@
 
 	Static Function FromArgb(argb As ARGB) As Color
-		Dim c As Color(argb)
-		Rteurn c
+		Return New Color(argb)
 	End Function
 
 	Static Function FromArgb(a As Byte, base As Color) As Color
-		Dim c As Color(a, base.R, base.G, base.B)
-		Return c
+		Return New Color(a, base.R, base.G, base.B)
 	End Function
 
 	Static Function FromArgb(r As Byte, g As Byte, b As Byte) As Color
-		Dim c As Color(r, g, b)
-		Return c
+		Return New Color(r, g, b)
 	End Function
 
 	Static Function FromArgb(a As Byte, r As Byte, g As Byte, b As Byte) As Color
-		Dim c As Color(a, r, g, b)
-		Return c
+		Return New Color(a, r, g, b)
 	End Function
 
@@ -119,30 +115,28 @@
 		d = max - min
 		If g = max Then
-			Return (b - r) As Double / d * 60 + 120
+			Return ((b - r) As Double / d * 60.0 + 120.0) As Single
 		ElseIf b = max Then
-			Return (r - g) As Double / d * 60 + 240
+			Return ((r - g) As Double / d * 60 + 240) As Single
 		ElseIf g < b Then
-			Return (g - b) As Double / d * 60 + 360
+			Return ((g - b) As Double / d * 60 + 360) As Single
 		Else
-			Return (g - b) As Double / d * 60
+			Return ((g - b) As Double / d * 60) As Single
 		EndIf
 	End Function
 
 	Function GetSaturation() As Single
-		Dim max As Long, min As Long
 		Dim r = R
 		Dim g = G
 		Dim b = B
-		max = System.Math.Max(System.Math.Max(r, g), b)
-		min = System.Math.Min(System.Math.Min(r, g), b)
+		Dim max = System.Math.Max(System.Math.Max(r, g), b) As Long
+		Dim min = System.Math.Min(System.Math.Min(r, g), b) As Long
 		Return (max - min) / max
 	End Function
 
 	Function GetBrightness() As Single
-		Dim max As Long
 		Dim r = R
 		Dim g = G
 		Dim b = B
-		max = System.Math.Max(System.Math.Max(r, g), b)
+		Dim max = System.Math.Max(System.Math.Max(r, g), b)
 		Return max * (1 / 255)
 	End Function
Index: trunk/Include/Classes/System/Drawing/Point.ab
===================================================================
--- trunk/Include/Classes/System/Drawing/Point.ab	(revision 302)
+++ trunk/Include/Classes/System/Drawing/Point.ab	(revision 303)
@@ -75,16 +75,13 @@
 
 	Static Function Add(pt1 As Point, pt2 As Point) As Point
-		Dim ret As Point(pt1.x + pt2.x, pt1.y + pt2.y)
-		Return ret
+		Return New Point(pt1.x + pt2.x, pt1.y + pt2.y)
 	End Function
 
 	Static Function Add(pt As Point, sz As Size) As Point
-		Dim ret As Point(pt.x + sz.Width, pt.y + sz.Height)
-		Return ret
+		Return New Point(pt.x + sz.Width, pt.y + sz.Height)
 	End Function
 
 	Function Offset(pt As Point) As Point
-		Dim ret As Point(x + pt.x, y + pt.y)
-		Return ret
+		Return New Point(x + pt.x, y + pt.y)
 	End Function
 
@@ -95,11 +92,9 @@
 
 	Static Function Substract(pt1 As Point, pt2 As Point) As Point
-		Dim ret As Point(pt1.x - pt2.x, pt1.y - pt2.y)
-		Return ret
+		Return New Point(pt1.x - pt2.x, pt1.y - pt2.y)
 	End Function
 
 	Static Function Substract(pt As Point, sz As Size) As Point
-		Dim ret As Point(pt.x - sz.Width, pt.y - sz.Height)
-		Return ret
+		Return New Point(pt.x - sz.Width, pt.y - sz.Height)
 	End Function
 
@@ -113,20 +108,17 @@
 
 	Static Function Ceiling(ptf As PointF) As Point
-		Dim pt As Size(Math.Ceiling(ptf.width), Math.Ceiling(ptf.height))
-		Return pt
+		Return New Point(System.Math.Ceiling(ptf.X) As Long, System.Math.Ceiling(ptf.Y) As Long)
 	End Function
 
 	Static Function Round(ptf As PointF) As Point
-		Dim pt As Point(Math.Round(ptf.width), Math.Round(ptf.height))
-		Return pt
+		Return New Point(System.Math.Round(ptf.X) As Long, System.Math.Round(ptf.Y) As Long)
 	End Function
 
 	Static Function Truncate(ptf As PointF) As Point
-		Dim pt As Point(Math.Truncate(ptf.width), Math.Truncate(ptf.height))
-		Return pt
+		Return New Point(System.Math.Truncate(ptf.X) As Long, System.Math.Truncate(ptf.Y) As Long)
 	End Function
 
 	Function Operator () As PointF
-		Return Return PointF(X, Y)
+		Return New PointF(X, Y)
 	End Function
 
Index: trunk/Include/Classes/System/Drawing/PointF.ab
===================================================================
--- trunk/Include/Classes/System/Drawing/PointF.ab	(revision 302)
+++ trunk/Include/Classes/System/Drawing/PointF.ab	(revision 303)
@@ -48,10 +48,5 @@
 		Return x = 0 And y = 0
 	End Function
-/*
-	Sub Operator = (ByRef pt As PointF)
-		x = pt.x
-		y = pt.y
-	End Sub
-*/
+
 	Function Operator + (pt As PointF) As PointF
 		Return Add(This, pt)
Index: trunk/Include/Classes/System/Drawing/Rectangle.ab
===================================================================
--- trunk/Include/Classes/System/Drawing/Rectangle.ab	(revision 302)
+++ trunk/Include/Classes/System/Drawing/Rectangle.ab	(revision 303)
@@ -110,10 +110,10 @@
 	End Function
 
-	Function Operator == (rc As Rectangle)
+	Function Operator == (rc As Rectangle) As Boolean
 		Return Equals(rc)
 	End Function
 
-	Function Operator <> (rc As Rectangle)
-		Return Not Equals(rc)
+	Function Operator <> (rc As Rectangle) As Boolean
+		Return (Not Equals(rc))
 	End Function
 
@@ -147,8 +147,8 @@
 
 	Sub Inflate(dx As Long, dy As Long)
-		X -= dx
-		Y -= dy
-		Width += dx + dx
-		Height += dy + dy
+		x -= dx
+		y -= dy
+		width += dx + dx
+		height += dy + dy
 	End Sub
 
@@ -158,18 +158,22 @@
 
 	Static Function Inflate(rc As Rectangle, x As Long, y As Long) As Rectangle
-		Inflate = New Rectangle(rc)
+		Inflate = New Rectangle(rc.X, rc.Y, rc.Width, rc.Height)
 		Inflate.Inflate(x, y)
 	End Function
 
 	Sub Intersect(rect As Rectangle)
-		This = Rectangle.Intersect(This, rect)
+		Dim r = Rectangle.Intersect(This, rect)
+		x = r.x
+		y = r.y
+		width = r.width
+		height = r.height
 	End Sub
 
 	Static Function Intersect(a As Rectangle, ByRef b As Rectangle) As Rectangle
 		Dim right As Long, bottom As Long, left As Long, top As Long
-		right = Math.Min(a.Right, b.Right)
-		bottom = Math.Min(a.Bottom, b.Bottom)
-		left = Math.Min(a.Left, b.Left)
-		top = Math.Min(a.Top, b.Top)
+		right = System.Math.Min(a.Right, b.Right)
+		bottom = System.Math.Min(a.Bottom, b.Bottom)
+		left = System.Math.Min(a.Left, b.Left)
+		top = System.Math.Min(a.Top, b.Top)
 		Return Rectangle.FromLTRB(left, top, right, bottom)
 	End Function
@@ -184,8 +188,8 @@
 	Static Function Union(a As Rectangle, b As Rectangle) As Rectangle
 		Dim right As Long, bottom As Long, left As Long, top As Long
-		right = Math.Max(a.Right(), b.Right())
-		bottom = Math.Max(a.Bottom(), b.Bottom())
-		left = Math.Max(a.Left(), b.Left())
-		top = Math.Max(a.Top(), b.Top())
+		right = System.Math.Max(a.Right(), b.Right())
+		bottom = System.Math.Max(a.Bottom(), b.Bottom())
+		left = System.Math.Max(a.Left(), b.Left())
+		top = System.Math.Max(a.Top(), b.Top())
 		Return FromLTRB(left, top, right, bottom)
 	End Function
@@ -196,14 +200,14 @@
 
 	Sub Offset(dx As Long, dy As Long)
-		X += dx
-		Y += dy
+		x += dx
+		y += dy
 	End Sub
 
 	Static Function Ceiling(rcf As RectangleF) As Rectangle
 		Dim r As Rectangle(
-			Math.Ceiling(rcf.X),
-			Math.Ceiling(rcf.Y),
-			Math.Ceiling(rcf.Width),
-			Math.Ceiling(rcf.Height))
+			System.Math.Ceiling(rcf.X) As Long,
+			System.Math.Ceiling(rcf.Y) As Long,
+			System.Math.Ceiling(rcf.Width) As Long,
+			System.Math.Ceiling(rcf.Height) As Long)
 		Return r
 	End Function
@@ -211,8 +215,8 @@
 	Static Function Round(rcf As RectangleF) As Rectangle
 		Dim r As Rectangle(
-			Math.Round(rcf.X),
-			Math.Round(rcf.Y),
-			Math.Round(rcf.Width),
-			Math.Round(rcf.Height))
+			System.Math.Round(rcf.X) As Long,
+			System.Math.Round(rcf.Y) As Long,
+			System.Math.Round(rcf.Width) As Long,
+			System.Math.Round(rcf.Height) As Long)
 		Return r
 	End Function
@@ -220,8 +224,8 @@
 	Static Function Truncate(rcf As RectangleF) As Rectangle
 		Dim r As Rectangle(
-			Math.Truncate(rcf.X),
-			Math.Truncate(rcf.Y),
-			Math.Truncate(rcf.Width),
-			Math.Truncate(rcf.Height))
+			System.Math.Truncate(rcf.X) As Long,
+			System.Math.Truncate(rcf.Y) As Long,
+			System.Math.Truncate(rcf.Width) As Long,
+			System.Math.Truncate(rcf.Height) As Long)
 		Return r
 	End Function
Index: trunk/Include/Classes/System/Drawing/RectangleF.ab
===================================================================
--- trunk/Include/Classes/System/Drawing/RectangleF.ab	(revision 302)
+++ trunk/Include/Classes/System/Drawing/RectangleF.ab	(revision 303)
@@ -106,34 +106,17 @@
 
 	Function IsEmpty() As Boolean
-		If Width <= 0 Or Height <= 0 Then
-			IsEmpty = _System_TRUE
-		Else
-			IsEmpty = _System_FALSE
-		End If
-	End Function
-/*
-	Function Operator =(ByRef rc As RectangleF)
-		With rc
-			x = .x
-			y = .y
-			width = .width
-			height = .height
-		End With
-	End Function
-*/
-	Function Operator ==(rc As RectangleF)
+		Return Width <= 0 Or Height <= 0
+	End Function
+
+	Function Operator ==(rc As RectangleF) As Boolean
 		Return Equals(rc)
 	End Function
 
-	Function Operator <>(rc As RectangleF)
+	Function Operator <>(rc As RectangleF) As Boolean
 		Return Not Equals(rc)
 	End Function
 
 	Function Equals(rc As RectangleF) As Boolean
-		If X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height Then
-			Return True
-		Else
-			Return False
-		End If
+		Equals = (X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height)
 	End Function
 
@@ -147,9 +130,5 @@
 
 	Function Contains(x As Single, y As Single) As Boolean
-		If x >= X And x < X + Width And y >= Y And y < Y + Height Then
-			Contains = _System_TRUE
-		Else
-			Contains = _System_FALSE
-		End If
+		Contains = (x >= X And x < X + Width And y >= Y And y < Y + Height)
 	End Function
 
@@ -159,16 +138,12 @@
 
 	Function Contains(rc As RectangleF) As Boolean
-		If X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom Then
-			Return True
-		Else
-			Return False
-		End If
+		Contains = (X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom)
 	End Function
 
 	Sub Inflate(dx As Single, dy As Single)
-		X -= dx
-		Y -= dy
-		Width += dx + dx
-		Height += dy + dy
+		x -= dx
+		y -= dy
+		width += dx + dx
+		height += dy + dy
 	End Sub
 
@@ -178,18 +153,22 @@
 
 	Static Function Inflate(rc As RectangleF, x As Single, y As Single) As RectangleF
-		Inflate = New Rectangle(rc)
+		Inflate = New RectangleF(rc.X, rc.Y, rc.Width, rc.Height)
 		Inflate.Inflate(x, y)
 	End Function
 
 	Sub Intersect(rect As RectangleF)
-		This = RectangleF.Intersect(This, rect)
+		Dim r = RectangleF.Intersect(This, rect)
+		x = r.x
+		y = r.y
+		width = r.width
+		height = r.height
 	End Sub
 	
 	Static Function Intersect(a As RectangleF, b As RectangleF) As RectangleF
 		Dim right As Single, bottom As Single, left As Single, top As Single
-		right = Math.Min(a.Right, b.Right)
-		bottom = Math.Min(a.Bottom, b.Bottom)
-		left = Math.Min(a.Left, b.Left)
-		top = Math.Min(a.Top, b.Top)
+		right = System.Math.Min(a.Right, b.Right)
+		bottom = System.Math.Min(a.Bottom, b.Bottom)
+		left = System.Math.Min(a.Left, b.Left)
+		top = System.Math.Min(a.Top, b.Top)
 		Return FromLTRB(left, top, right, bottom)
 	End Function
@@ -200,7 +179,7 @@
 			Right > rc.Left And _
 			Bottom > rc.Top Then
-			IntersectsWith = _System_TRUE
+			IntersectsWith = True
 		Else
-			IntersectsWith = _System_FALSE
+			IntersectsWith = False
 		End If
 	End Function
@@ -208,8 +187,8 @@
 	Static Function Union(a As RectangleF, b As RectangleF) As RectangleF
 		Dim right As Single, bottom As Single, left As Single, top As Single
-		right = Math.Max(a.Right(), b.Right())
-		bottom = Math.Max(a.Bottom(), b.Bottom())
-		left = Math.Max(a.Left(), b.Left())
-		top = Math.Max(a.Top(), b.Top())
+		right = System.Math.Max(a.Right(), b.Right())
+		bottom = System.Math.Max(a.Bottom(), b.Bottom())
+		left = System.Math.Max(a.Left(), b.Left())
+		top = System.Math.Max(a.Top(), b.Top())
 		Return FromLTRB(left, top, right, bottom)
 	End Function
@@ -220,6 +199,6 @@
 
 	Sub Offset(dx As Single, dy As Single)
-		X += dx
-		Y += dy
+		x += dx
+		y += dy
 	End Sub
 
Index: trunk/Include/Classes/System/Drawing/Size.ab
===================================================================
--- trunk/Include/Classes/System/Drawing/Size.ab	(revision 302)
+++ trunk/Include/Classes/System/Drawing/Size.ab	(revision 303)
@@ -70,7 +70,7 @@
 	Function Equals(sz As Size) As Boolean
 		If width = sz.width And height = sz.height Then
-			Equals = _System_TRUE
+			Equals = True
 		Else
-			Equals = _System_FALSE
+			Equals = False
 		End If
 	End Function
@@ -93,15 +93,15 @@
 
 	Static Function Ceiling(szf As SizeF) As Size
-		Dim sz As Size(Math.Ceiling(szf.width), Math.Ceiling(szf.height))
+		Dim sz As Size(System.Math.Ceiling(szf.Width) As Long, System.Math.Ceiling(szf.Height) As Long)
 		Return sz
 	End Function
 
 	Static Function Round(szf As SizeF) As Size
-		Dim sz As Size(Math.Round(szf.width), Math.Round(szf.height))
+		Dim sz As Size(System.Math.Round(szf.Width) As Long, System.Math.Round(szf.Height) As Long)
 		Return sz
 	End Function
 
 	Static Function Truncate(szf As SizeF) As Size
-		Dim sz As Size(Math.Truncate(szf.width), Math.Truncate(szf.height))
+		Dim sz As Size(System.Math.Truncate(szf.Width) As Long, System.Math.Truncate(szf.Height) As Long)
 		Return sz
 	End Function
Index: trunk/Include/Classes/System/Drawing/SizeF.ab
===================================================================
--- trunk/Include/Classes/System/Drawing/SizeF.ab	(revision 302)
+++ trunk/Include/Classes/System/Drawing/SizeF.ab	(revision 303)
@@ -68,5 +68,5 @@
 
 	Override Function GetHashCode() As Long
-		Return VarPtr(GetDWord(width)) Xor _System_BSwap(VarPtr(GetDWord(height)))
+		Return GetDWord(VarPtr(width)) Xor _System_BSwap(GetDWord(VarPtr(height)))
 	End Function
 
@@ -75,5 +75,5 @@
 	End Function
 
-	Function Add(sz As Size) As Size
+	Function Add(sz As SizeF) As SizeF
 		Return This + sz
 	End Function
Index: trunk/Include/Classes/System/Media/SystemSound.ab
===================================================================
--- trunk/Include/Classes/System/Media/SystemSound.ab	(revision 302)
+++ trunk/Include/Classes/System/Media/SystemSound.ab	(revision 303)
@@ -15,5 +15,5 @@
 Public
 	Sub Play()
-		PlaySound(SoundID,GetModuleHandle(NULL),SND_ALIAS_ID)
+		PlaySound(SoundID As LPCTSTR, GetModuleHandle(NULL), SND_ALIAS_ID)
 	End Sub
 
Index: trunk/Include/Classes/System/Threading/Thread.ab
===================================================================
--- trunk/Include/Classes/System/Threading/Thread.ab	(revision 302)
+++ trunk/Include/Classes/System/Threading/Thread.ab	(revision 303)
@@ -281,5 +281,5 @@
 		For i=0 To ELM(ThreadNum)
 
-			If currentThread.Equals( ByVal ppobj_Thread[i] ) Then
+			If currentThread.Equals( ppobj_Thread[i] As Object ) Then
 				Continue
 			End If
@@ -298,5 +298,5 @@
 		For i=0 To ELM(ThreadNum)
 
-			If currentThread.Equals( ByVal ppobj_Thread[i] ) Then
+			If currentThread.Equals( ppobj_Thread[i] As Object ) Then
 				Continue
 			End If
Index: trunk/Include/Classes/System/Windows/Forms/Control.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/Control.ab	(revision 302)
+++ trunk/Include/Classes/System/Windows/Forms/Control.ab	(revision 303)
@@ -4,5 +4,4 @@
 #define __SYSTEM_WINDOWS_FORMS_CONTROL_AB__
 
-#require <windows/WindowHandle.sbp>
 #require <Classes/System/Windows/Forms/misc.ab>
 #require <Classes/System/Windows/Forms/CreateParams.ab>
@@ -17,4 +16,5 @@
 #require <Classes/System/Drawing/Rectangle.ab>
 #require <Classes/System/Runtime/InteropServices/GCHandle.ab>
+#require <Classes/ActiveBasic/Windows/WindowHandle.sbp>
 #require <Classes/ActiveBasic/Strings/Strings.ab>
 
@@ -44,5 +44,5 @@
 
 	Override Function CompletedSynchronously() As Boolean
-		Return FALSE
+		Return False
 	End Function
 
@@ -74,4 +74,5 @@
 
 Class Control
+
 '	Inherits IWin32Window
 Public
@@ -80,4 +81,19 @@
 	Function AllowDrop() As Boolean
 	End Function
+
+	'Anchor
+	'AutoScrollOffset 
+	'AutoSize
+	'BackColor下
+	'BackgroundImage
+	'BackgroundImageLayout
+	'-BindingContext
+	'Bottom 下
+	'Bounds 下
+	'CanFocus
+	'CanSelect
+	'Capture
+	'-CausesValidation
+	'CheckForIllegalCrossThreadCalls
 
 	/*Override*/ Function Handle() As HWND
@@ -201,19 +217,19 @@
 		Return b.Top + b.Height
 	End Function
-
+/*
 	Const Function PointToScreen(p As Point) As Point
 		PointToScreen = New Point
-		ret.X = p.X
-		ret.Y = p.Y
-		wnd.ClientToScreen(ByVal VarPtr(PointToScreen) As *POINTAPI)
+		PointToScreen.X = p.X
+		PointToScreen.Y = p.Y
+		wnd.ClientToScreen(ByVal ObjPtr(PointToScreen) As *POINTAPI)
 	End Function
 
 	Const Function PointToClient(p As Point) As Point
 		PointToScreen = New Point
-		ret.X = p.X
-		ret.Y = p.Y
-		wnd.ScreenToClient(ByVal VarPtr(PointToScreen) As *POINTAPI)
-	End Function
-
+		PointToClient.X = p.X
+		PointToClient.Y = p.Y
+		wnd.ScreenToClient(ByVal ObjPtr(PointToClient) As *POINTAPI)
+	End Function
+*/
 	Const Function RectangleToScreen(r As Rectangle) As Rectangle
 		Dim rc = r.ToRECT
@@ -223,6 +239,5 @@
 
 	Const Function RectangleToClient(r As Rectangle) As Rectangle
-		Dim rc As RECT
-		rc = r.ToRECT()
+		Dim rc = r.ToRECT()
 		wnd.ScreenToClient(rc)
 		Return New Rectangle(rc)
@@ -230,5 +245,5 @@
 
 	Const Function InvokeRequired() As Boolean
-		Return wnd.ThreadID <> GetCurrentThreadId()
+		Return wnd.ThreadId <> GetCurrentThreadId()
 	End Function
 
@@ -239,6 +254,5 @@
 	Virtual Sub BackColor(c As Color)
 		c = bkColor
-		Dim e As EventArgs
-		OnBackColorChanged(e)
+		OnBackColorChanged(New EventArgs)
 	End Sub
 
@@ -248,5 +262,5 @@
 
 	Const Function IsHandleCreated() As Boolean
-		Return wnd.HWnd <> 0
+		Return wnd.HWnd <> 0 Or IsWindow(wnd.HWnd) <> FALSE
 	End Function
 
@@ -259,4 +273,5 @@
 
 	Sub Control()
+		Debug
 		Dim sz = DefaultSize()
 		Control("", 100, 100, sz.Width, sz.Height)
@@ -279,5 +294,5 @@
 
 	Sub Control(parent As Control, text As String, left As Long, top As Long, width As Long, height As Long)
-		This.parent = VarPtr(parent)
+		This.parent = parent
 		Control(text, left, top, width, height)
 	End Sub
@@ -296,5 +311,5 @@
 	'---------------------------------------------------------------------------
 	' Public Methods
-
+/*
 	' 同期関数呼出、Controlが作成されたスレッドで関数を実行する。
 	' 関数は同期的に呼び出されるので、関数が終わるまでInvokeは制御を戻さない。
@@ -317,5 +332,5 @@
 		Dim gch = System.Runtime.InteropServices.GCHandle.Alloc(asyncInvokeData)
 		wnd.PostMessage(WM_CONTROL_BEGININVOKE, 0, System.Runtime.InteropServices.GCHandle.ToIntPtr(gch))
-		Return pAsyncResult
+		Return asyncResult
 	End Function
 
@@ -327,5 +342,5 @@
 		Return arInvoke.Result
 	End Function
-
+*/
 	' 与えられたウィンドウハンドルがControl（若しくはその派生クラス）の
 	' インスタンスに対応するものであった場合、
@@ -360,4 +375,5 @@
 
 	Sub Show()
+		Debug
 		wnd.Show(SW_SHOW)
 	End Sub
@@ -396,6 +412,6 @@
 	Virtual Sub CreateHandle()
 		Dim createParams = CreateParams()
-		Dim gch = GCHandle.Alloc(This)
-		TlsSetValue(tlsIndex, GCHandle.ToIntPtr(gch) As VoidPtr)
+		Dim gch = System.Runtime.InteropServices.GCHandle.Alloc(This)
+		TlsSetValue(tlsIndex, System.Runtime.InteropServices.GCHandle.ToIntPtr(gch) As VoidPtr)
 		With createParams
 			Dim hwndParent = 0 As HWND
@@ -516,5 +532,5 @@
 Private
 	' Member variables
-	wnd As WindowHandle
+	wnd As ActiveBasic.Windows.WindowHandle
 	text As String
 	parent As Control
@@ -590,5 +606,5 @@
 				ExitThread(-1)
 			End If
-			rThis.wnd = New WindowHandle(hwnd)
+			rThis.wnd = New ActiveBasic.Windows.WindowHandle(hwnd)
 			SetWindowLongPtr(hwnd, GWLP_THIS, gchValue)
 		End If
Index: trunk/Include/Classes/System/Windows/Forms/Message.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/Message.ab	(revision 302)
+++ trunk/Include/Classes/System/Windows/Forms/Message.ab	(revision 303)
@@ -55,7 +55,7 @@
 		Return hwnd = x.hwnd And _
 			msg = x.msg And _
-			wp = .wp And _
-			lp = .lp And _
-			lr = .lr
+			wp = x.wp And _
+			lp = x.lp And _
+			lr = x.lr
 	End Function
 
Index: trunk/Include/Classes/System/Windows/Forms/MessageBox.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/MessageBox.ab	(revision 303)
+++ trunk/Include/Classes/System/Windows/Forms/MessageBox.ab	(revision 303)
@@ -0,0 +1,108 @@
+'Classes/System/Windows/Forms/MessageBox.ab
+
+#require <Classes/System/Windows/Forms/misc.ab>
+#require <Classes/ActiveBasic/Windows/Windows.ab>
+
+Namespace System
+Namespace Windows
+Namespace Forms
+
+Enum MessageBoxButtons
+	OK = MB_OK
+	OKCancel = MB_OKCANCEL
+	AbortRetryIgnore = MB_ABORTRETRYIGNORE
+	YesNoCancel = MB_ABORTRETRYIGNORE
+	YesNo = MB_YESNO
+	RetryCancel = MB_RETRYCANCEL
+End Enum
+
+Enum MessageBoxIcon
+	None = 0
+	Hand = MB_ICONHAND
+	Question = MB_ICONQUESTION
+	Exclamation = MB_ICONEXCLAMATION
+	Asterisk = MB_ICONASTERISK
+	Warning = MB_ICONWARNING
+	Error = MB_ICONERROR
+	Information = MB_ICONINFORMATION
+	Stop = MB_ICONSTOP
+End Enum
+
+Enum MessageBoxDefaultButton
+	Button1 = MB_DEFBUTTON1
+	Button2 = MB_DEFBUTTON2
+	Button3 = MB_DEFBUTTON3
+End Enum
+
+Enum MessageBoxOptions
+	None = 0
+	DefaultDesktopOnl = MB_DEFAULT_DESKTOP_ONLY
+	RightAlign = MB_RIGHT
+	RtlReading = MB_RTLREADING
+	ServiceNotification = MB_SERVICE_NOTIFICATION
+End Enum
+
+Class MessageBox
+Public
+	Static Function Show(text As String) As DialogResult
+		Show = Show(Nothing, text, "", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(owner As IWin32Window, text As String) As DialogResult
+		Show = Show(owner, text, "", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(text As String, caption As String) As DialogResult
+		Show = Show(Nothing, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(owner As IWin32Window, text As String, caption As String) As DialogResult
+		Show = Show(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons) As DialogResult
+		Show = Show(Nothing, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(owner As IWin32Window, text As String, caption As String, buttons As MessageBoxButtons) As DialogResult
+		Show = Show(owner, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon) As DialogResult
+		Show = Show(Nothing, text, caption, buttons, icon, MessageBoxDefaultButton.Button1, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(owner As IWin32Window, text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon) As DialogResult
+		Show = Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton) As DialogResult
+		Show = Show(Nothing, text, caption, buttons, icon, defaultButtion, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(owner As IWin32Window, text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton) As DialogResult
+		Show = Show(owner, text, caption, buttons, icon, defaultButtion, MessageBoxOptions.None)
+	End Function
+
+	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions) As DialogResult
+		Show = Show(Nothing, text, caption, buttons, icon, defaultButtion, options)
+	End Function
+
+	Static Function Show(owner As IWin32Window, text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions) As DialogResult
+		Show = ActiveBasic.Windows.Detail._System_MessageBox(owner.Handle, StrPtr(text), StrPtr(caption), buttons As DWord Or icon As DWord Or defaultButtion As DWord Or options As DWord) As DialogResult
+	End Function
+
+'	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, displayHelpButton As Boolean) As DialogResult
+'	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, helpFilePath As String) As DialogResult
+'	Static Function Show(owner As IWin32Window, text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, helpFilePath As String) As DialogResult
+'	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, helpFilePath As String, navigator As HelpNavigator) As DialogResult
+'	Static Function Show(owner As IWin32Window, text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, helpFilePath As String, navigator As HelpNavigator) As DialogResult
+'	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, helpFilePath As String, keyword As String) As DialogResult
+'	Static Function Show(owner As IWin32Window, text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, helpFilePath As String, keyword As String) As DialogResult
+'	Static Function Show(text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, helpFilePath As String, navigator As HelpNavigator, param As Object) As DialogResult
+'	Static Function Show(owner As IWin32Window, text As String, caption As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButtion As MessageBoxDefaultButton, options As MessageBoxOptions, helpFilePath As String, navigator As HelpNavigator, param As Object) As DialogResult
+End Class
+
+End Namespace 'Forms
+End Namespace 'Widnows
+End Namespace 'System
Index: trunk/Include/Classes/System/Windows/Forms/index.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/index.ab	(revision 302)
+++ trunk/Include/Classes/System/Windows/Forms/index.ab	(revision 303)
@@ -9,4 +9,5 @@
 #require <Classes/System/Windows/Forms/CreateParams.ab>
 #require <Classes/System/Windows/Forms/PaintEventArgs.ab>
+#require <Classes/System/Windows/Forms/MessageBox.ab>
 
 #endif '__SYSTEM_WINDOWS_FORMS_INDEX_AB__
Index: trunk/Include/Classes/System/Windows/Forms/misc.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/misc.ab	(revision 302)
+++ trunk/Include/Classes/System/Windows/Forms/misc.ab	(revision 303)
@@ -1,3 +1,3 @@
-' Classes/System/Windows/Forms/misc.ab
+'Classes/System/Windows/Forms/misc.ab
 
 #ifndef __SYSTEM_WINDOWS_FORMS_MISC_AB__
@@ -197,4 +197,15 @@
 End Enum
 
+Enum DialogResult
+	None = 0
+	OK = IDOK
+	Abort = IDABORT
+	Cancel = IDCANCEL
+	Retry = IDRETRY
+	Ignore = IDIGNORE
+	Yes = IDYES
+	No = IDNO
+End Enum
+
 End Namespace 'Forms
 End Namespace 'Widnows
Index: trunk/Include/OAIdl.ab
===================================================================
--- trunk/Include/OAIdl.ab	(revision 302)
+++ trunk/Include/OAIdl.ab	(revision 303)
@@ -7,14 +7,12 @@
 
 '#ifndef COM_NO_WINDOWS_H
-#include <windows.sbp>
-#include <ole2.ab>
+#require <windows.sbp>
+#require <ole2.ab>
 '#endif /*COM_NO_WINDOWS_H*/
 
-#include <objidl.sbp>
+#require <objidl.sbp>
 
 #ifndef __IOleAutomationTypes_INTERFACE_DEFINED__
 #define __IOleAutomationTypes_INTERFACE_DEFINED__
-
-TypeDef SCODE = Long
 
 /* interface IOleAutomationTypes */
@@ -694,7 +692,7 @@
 Const Enum VARKIND
 	VAR_PERINSTANCE = 0
-	VAR_STATIC = VAR_PERINSTANCE + 1
-	VAR_CONST = VAR_STATIC + 1
-	VAR_DISPATCH = VAR_CONST + 1
+	VAR_STATIC = 1
+	VAR_CONST = 2
+	VAR_DISPATCH = 3
 End Enum
 
@@ -893,27 +891,20 @@
 	Function DeleteFuncDesc(
 		/* [in] */ index As DWord) As HRESULT
-
 	Function DeleteFuncDescByMemId(
 		/* [in] */ memid As *MEMBERID,
 		/* [in] */ invKind As *INVOKEKIND) As HRESULT
-
 	Function DeleteVarDesc(
 		/* [in] */ index As DWord) As HRESULT
-
 	Function DeleteVarDescByMemId(
 		/* [in] */ memid As *MEMBERID) As HRESULT
-
 	Function DeleteImplType(
 		/* [in] */ index As DWord) As HRESULT
-
 	Function SetCustData(
 		/* [in] */ ByRef guid As GUID,
 		/* [in] */ ByRef VarVal As VARIANT) As HRESULT
-
 	Function SetFuncCustData(
 		/* [in] */ index As DWord,
 		/* [in] */ ByRef guid As GUID,
 		/* [in] */ ByRef VarVal As VARIANT) As HRESULT
-
 	Function SetParamCustData(
 		/* [in] */ indexFunc As DWord,
@@ -921,28 +912,21 @@
 		/* [in] */ ByRef guid As GUID,
 		/* [in] */ ByRef VarVal As VARIANT) As HRESULT
-
 	Function SetVarCustData(
 		/* [in] */ index As DWord,
 		/* [in] */ ByRef guid As GUID,
 		/* [in] */ ByRef VarVal As VARIANT) As HRESULT
-
 	Function SetImplTypeCustData(
 		/* [in] */ index As DWord,
 		/* [in] */ ByRef guid As GUID,
 		/* [in] */ ByRef VarVal As VARIANT) As HRESULT
-
 	Function SetHelpStringContext(
 		/* [in] */ dwHelpStringContext As DWord) As HRESULT
-
 	Function SetFuncHelpStringContext(
 		/* [in] */ index As DWord,
 		/* [in] */ dwHelpStringContext As DWord) As HRESULT
-
 	Function SetVarHelpStringContext(
 		/* [in] */ index As DWord,
 		/* [in] */ dwHelpStringContext As DWord) As HRESULT
-
 	Function Invalidate() As HRESULT
-
 	Function SetName(
 		/* [in] */ szName As LPOLESTR) As HRESULT
@@ -959,5 +943,4 @@
 
 TypeDef LPCREATETYPELIB = /* [unique] */ *ICreateTypeLib
-
 
 Dim IID_ICreateTypeLib = [&h00020406, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -968,34 +951,24 @@
 		/* [in] */ szName As LPOLESTR,
 		/* [in] */ tkind As *TYPEKIND,
-		/* [out] */ ByRef pCTInfo As *ICreateTypeInfo) As HRESULT
-
+		/* [out] */ ByRef CTInfo As ICreateTypeInfo) As HRESULT
 	Function SetName(
 		/* [in] */ szName As LPOLESTR) As HRESULT
-
 	Function SetVersion(
 		/* [in] */ wMajorVerNum As Word,
 		/* [in] */ wMinorVerNum As Word) As HRESULT
-
 	Function SetGuid(
 		/* [in] */ ByRef guid As GUID) As HRESULT
-
 	Function SetDocString(
 		/* [in] */ szDoc As LPOLESTR) As HRESULT
-
 	Function SetHelpFileName(
 		/* [in] */ szHelpFileName As LPOLESTR) As HRESULT
-
 	Function SetHelpContext(
 		/* [in] */ dwHelpContext As DWord) As HRESULT
-
 	Function SetLcid(
 		/* [in] */ lcid As LCID) As HRESULT
-
 	Function SetLibFlags(
 		/* [in] */ uLibFlags As DWord) As HRESULT
-
 	Function SaveAllChanges() As HRESULT
 End Interface
-
 
 #endif 	/* __ICreateTypeLib_INTERFACE_DEFINED__ */
@@ -1017,15 +990,11 @@
 	Function DeleteTypeInfo(
 		/* [in] */ szName As LPOLESTR) As HRESULT
-
 	Function SetCustData(
 		/* [in] */ ByRef guid As GUID,
 		/* [in] */ ByRef VarVal As VARIANT) As HRESULT
-
 	Function SetHelpStringContext(
 		/* [in] */ dwHelpStringContext As DWord) As HRESULT
-
 	Function SetHelpStringDll(
 		/* [in] */ szFileName As LPOLESTR) As HRESULT
-
 End Interface
 
@@ -1182,16 +1151,12 @@
 	Function /* [local] */ GetTypeAttr(
 		/* [out] */ ByRef pTypeAttr As *TYPEATTR) As HRESULT
-
 	Function GetTypeComp(
-		/* [out] */ ByRef pTComp As *ITypeComp) As HRESULT
-
+		/* [out] */ ByRef TComp As ITypeComp) As HRESULT
 	Function /* [local] */ GetFuncDesc(
 		/* [in] */ index As DWord,
 		/* [out] */ ByRef pFuncDesc As *FUNCDESC) As HRESULT
-
 	Function /* [local] */ GetVarDesc(
 		/* [in] */ index As DWord,
 		/* [out] */ ByRef pVarDesc As *VARDESC) As HRESULT
-
 	Function /* [local] */ GetNames(
 		/* [in] */ memid As MEMBERID,
@@ -1199,18 +1164,14 @@
 		/* [in] */ cMaxNames As DWord,
 		/* [out] */ ByRef cNames As DWord) As HRESULT
-
 	Function GetRefTypeOfImplType(
 		/* [in] */ index As DWord,
 		/* [out] */ ByRef RefType As HREFTYPE) As HRESULT
-
 	Function GetImplTypeFlags(
 		/* [in] */ index As DWord,
 		/* [out] */ ByRef ImplTypeFlags As Long) As HRESULT
-
 	Function /* [local] */ GetIDsOfNames(
 		/* [size_is][in] */ rgszNames As *LPOLESTR,
 		/* [in] */ cNames As DWord,
 		/* [size_is][out] */ pMemId As *MEMBERID) As HRESULT
-
 	Function /* [local] */ Invoke(
 		/* [in] */ pvInstance As VoidPtr,
@@ -1221,5 +1182,4 @@
 		/* [out] */ ByRef ExcepInfo As EXCEPINFO,
 		/* [out] */ ByRef uArgErr As DWord) As HRESULT
-
 	Function /* [local] */ GetDocumentation(
 		/* [in] */ memid As MEMBERID,
@@ -1228,5 +1188,4 @@
 		/* [out] */ ByRef dwHelpContext As DWord,
 		/* [out] */ ByRef BstrHelpFile As BSTR) As HRESULT
-
 	Function /* [local] */ GetDllEntry(
 		/* [in] */ memid As MEMBERID,
@@ -1235,33 +1194,25 @@
 		/* [out] */ ByRef BstrName As BSTR,
 		/* [out] */ ByRef wOrdinal As Word) As HRESULT
-
 	Function GetRefTypeInfo(
 		/* [in] */ hRefType As HREFTYPE,
-		/* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT
-
+		/* [out] */ ByRef TInfo As ITypeInfo) As HRESULT
 	Function /* [local] */ AddressOfMember(
 		/* [in] */ memid As MEMBERID,
 		/* [in] */ invKind As INVOKEKIND,
 		/* [out] */ ByRef pv As VoidPtr) As HRESULT
-
 	Function /* [local] */ CreateInstance(
-		/* [in] */ pUnkOuter As *IUnknown,
+		/* [in] */ pUnkOuter As IUnknown,
 		/* [in] */ ByRef riid As IID,
 		/* [iid_is][out] */ ByRef pvObj As Any) As HRESULT
-
 	Function GetMops(
 		/* [in] */ memid As MEMBERID,
 		/* [out] */ ByRef BstrMops As BSTR) As HRESULT
-
 	Function /* [local] */ GetContainingTypeLib(
-		/* [out] */ ByRef pTLib As *ITypeLib,
+		/* [out] */ ByRef TLib As ITypeLib,
 		/* [out] */ ByRef Index As DWord) As HRESULT
-
 	Sub /* [local] */ ReleaseTypeAttr(
 		/* [in] */ pTypeAttr As *TYPEATTR)
-
 	Sub /* [local] */ ReleaseFuncDesc(
 		/* [in] */ pFuncDesc As *FUNCDESC)
-
 	Sub /* [local] */ ReleaseVarDesc(
 		/* [in] */ pVarDesc As *VARDESC)
@@ -1645,5 +1596,5 @@
 		/* [out] */ ByRef cbSize As DWord) As HRESULT
 	Function GetTypeInfo(
-		/* [out] */ ByRef pTypeInfo As *ITypeInfo) As HRESULT
+		/* [out] */ ByRef TypeInfo As ITypeInfo) As HRESULT
 	Function GetField(
 		/* [in] */ pvData As VoidPtr,
@@ -1656,10 +1607,10 @@
 		/* [out] */ ByRef pvDataCArray As VoidPtr) As HRESULT
 	Function PutField(
-  		/* [in] */ wFlags As DWord,
+		/* [in] */ wFlags As DWord,
 		/* [out][in] */ pvData As VoidPtr,
 		/* [in] */ szFieldName As LPCOLESTR,
 		/* [in] */ ByRef varField As VARIANT) As HRESULT
 	Function PutFieldNoCopy(
-  		/* [in] */ wFlags As DWord,
+		/* [in] */ wFlags As DWord,
 		/* [out][in] */ pvData As VoidPtr,
 		/* [in] */ szFieldName As LPCOLESTR,
@@ -1718,5 +1669,5 @@
 		/* [in] */ pszPropName As LPCOLESTR,
 		/* [out][in] */ ByRef Var As VARIANT,
-		/* [in] */ pErrorLog As *IErrorLog) As HRESULT
+		/* [in] */ ErrorLog As IErrorLog) As HRESULT
 
 	Function Write(
Index: trunk/Include/OleAuto.ab
===================================================================
--- trunk/Include/OleAuto.ab	(revision 302)
+++ trunk/Include/OleAuto.ab	(revision 303)
@@ -22,5 +22,5 @@
 */
 
-#include <oaidl.ab>
+#require <oaidl.ab>
 'Dummy
 
Index: trunk/Include/api_window.sbp
===================================================================
--- trunk/Include/api_window.sbp	(revision 302)
+++ trunk/Include/api_window.sbp	(revision 303)
@@ -1071,4 +1071,5 @@
 Const MB_RIGHT =                  &H00080000
 Const MB_RTLREADING =             &H00100000
+Const MB_SERVICE_NOTIFICATION =   &H00200000
 #ifdef UNICODE
 Declare Function MessageBox Lib "user32" Alias "MessageBoxW" (hwnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long
Index: trunk/Include/basic.sbp
===================================================================
--- trunk/Include/basic.sbp	(revision 302)
+++ trunk/Include/basic.sbp	(revision 303)
@@ -1,5 +1,3 @@
 'basic.sbp
-
-#_core
 
 ' Unicodeが不安定な間の暫定対応
@@ -9,5 +7,4 @@
 #ifndef _INC_BASIC
 #define _INC_BASIC
-
 
 Sub _System_InitDllGlobalVariables()	'dummy
@@ -54,6 +51,4 @@
 TypeDef Int16 = Integer
 TypeDef Int8 = SByte
-
-TypeDef BOOL = Long
 
 ' Boolena型の定数
@@ -122,9 +117,8 @@
 ' Specify elements number
 '--------------------------
-Const ELM(n) = (n - 1)
+Const ELM(n) = ((n) - 1)
 
-#include <windows.sbp>
-#include <crt.sbp>
-#include <objbase.sbp>
+#require <windows.sbp>
+#require <crt.sbp>
 
 
@@ -138,4 +132,5 @@
 Sub _System_StartupProgram()
 	'Unsafe
+
 		'この関数はアプリケーションの起動時にシステムからコールバックされます
 
@@ -150,5 +145,5 @@
 		ActiveBasic.Core._System_TypeBase.Initialize()
 
-		' Initialize static variables
+		'Initialize static variables
 		_System_InitStaticLocalVariables()
 
@@ -168,5 +163,5 @@
 		' GC管理オブジェクトを破棄
 		_System_pGC->Finish()
-		_System_free( _System_pGC )
+'		_System_free( _System_pGC )
 
 		DeleteCriticalSection(_System_CriticalSection)
@@ -178,17 +173,16 @@
 
 
-#include <system\interface.ab>
-#include <system\built_in.ab>
-#include <system\string.sbp>
-#include <system\debug.sbp>
-#include <system\gc.sbp>
-#include <system\enum.sbp>
-#include <system\exception.ab>
 
-#include <Classes\index.ab>
+#require <system\string.sbp>
+#require <system\debug.sbp>
+#require <system\gc.sbp>
+#require <system\enum.sbp>
+#require <system\exception.ab>
+
+#require <Classes\index.ab>
 
 
-#include <basic\function.sbp>
-#include <basic\command.sbp>
+#require <basic\function.sbp>
+#require <basic\command.sbp>
 
 
Index: trunk/Include/basic/command.sbp
===================================================================
--- trunk/Include/basic/command.sbp	(revision 302)
+++ trunk/Include/basic/command.sbp	(revision 303)
@@ -7,4 +7,5 @@
 #require <windows.sbp>
 #require <Classes/System/Environment.ab>
+#require <Classes/ActiveBasic/Windows/Windows.ab>
 
 Const _System_Type_SByte = 1
@@ -65,17 +66,8 @@
 '----------------
 
-Function _System_MessageBox(hw As HWND, s As PCSTR, t As PCSTR, b As DWord) As DWord
-	Return MessageBoxA(hw, s, t, b)
-End Function
-
-Function _System_MessageBox(hw As HWND, s As PCWSTR, t As PCWSTR, b As DWord) As DWord
-	Return MessageBoxW(hw, s, t, b)
-End Function
-
 Macro MSGBOX(hwnd As HWND, str As String)(title As String, boxType As DWord, ByRef retAns As DWord)
+	Dim ret = ActiveBasic.Windows.Detail._System_MessageBox(hwnd, ToSCStr(str), ToSCStr(title), boxType)
 	If VarPtr(retAns) Then
-		retAns = _System_MessageBox(hwnd, ToSCStr(str), ToSCStr(title), boxType)
-	Else
-		_System_MessageBox(hwnd, ToSCStr(str), ToSCStr(title), boxType)
+		retAns = ret
 	End If
 End Macro
@@ -424,8 +416,7 @@
 Macro FIELD(FileNumber As Long, FieldSize As Long)
 	FileNumber--
-
 	_System_FieldSize(FileNumber)=FieldSize
 End Macro
-Macro GET(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String)
+Macro GET(FileNumber As Long, RecodeNumber As Long, ByRef buffer As String)
 	Dim dwAccessByte As DWord
 
@@ -434,11 +425,13 @@
 
 	SetFilePointer(_System_hFile(FileNumber), SizeOf (StrChar) * RecodeNumber * _System_FieldSize(FileNumber), 0, FILE_BEGIN)
-	lpBuffer = ZeroString(_System_FieldSize(FileNumber))
-	ReadFile(_System_hFile(FileNumber), StrPtr(lpBuffer), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte),ByVal 0)
-	If Not dwAccessByte=_System_FieldSize(FileNumber) Then
-		lpBuffer = Left$(lpBuffer, dwAccessByte)
+	Dim t = ZeroString(_System_FieldSize(FileNumber))
+	ReadFile(_System_hFile(FileNumber), StrPtr(t), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
+	If dwAccessByte = _System_FieldSize(FileNumber) Then
+		buffer = t.ToString
+	Else
+		buffer = Left$(t.ToString, dwAccessByte)
 	End If
 End Macro
-Macro PUT(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String)
+Macro PUT(FileNumber As Long, RecodeNumber As Long, buffer As String)
 	Dim dwAccessByte As DWord
 
@@ -447,5 +440,5 @@
 
 	SetFilePointer(_System_hFile(FileNumber), SizeOf (StrChar) * RecodeNumber*_System_FieldSize(FileNumber), 0, FILE_BEGIN)
-	WriteFile(_System_hFile(FileNumber), StrPtr(lpBuffer),SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
+	WriteFile(_System_hFile(FileNumber), StrPtr(buffer), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
 End Macro
 
Index: trunk/Include/basic/function.sbp
===================================================================
--- trunk/Include/basic/function.sbp	(revision 302)
+++ trunk/Include/basic/function.sbp	(revision 303)
@@ -1019,4 +1019,8 @@
 End Function
 
+Function _System_PtrObj(p As VoidPtr) As Object
+	SetPointer(VarPtr(_System_PtrObj), p)
+End Function
+
 '--------
 ' 文字列関数その2
Index: trunk/Include/directx9/d3d9.sbp
===================================================================
--- trunk/Include/directx9/d3d9.sbp	(revision 302)
+++ trunk/Include/directx9/d3d9.sbp	(revision 303)
@@ -9,6 +9,6 @@
 Const D3D_SDK_VERSION = 32
 
-#include <directx9\d3d9types.sbp>
-#include <directx9\d3d9caps.sbp>
+#require <directx9\d3d9types.sbp>
+#require <directx9\d3d9caps.sbp>
 
 
@@ -24,344 +24,344 @@
 '--------------------
 
-Class IDirect3D9
+Interface IDirect3D9
 	Inherits IUnknown
 Public
 	'IDirect3D9 methods
-	Abstract Function ShoRegisterSoftwareDevice(pInitializeFunction As VoidPtr) As DWord
-	Abstract Function GetAdapterCount() As DWord
-	Abstract Function GetAdapterIdentifier(Adapter As DWord, Flags As DWord, pIdentifier As *D3DADAPTER_IDENTIFIER9) As DWord
-	Abstract Function GetAdapterModeCount(Adapter As DWord, Format As D3DFORMAT) As DWord
-	Abstract Function EnumAdapterModes(Adapter As DWord, Format As D3DFORMAT, Mode As DWord, pMode As *D3DDISPLAYMODE) As DWord
-	Abstract Function GetAdapterDisplayMode(Adapter As DWord, pMode As *D3DDISPLAYMODE) As DWord
-	Abstract Function CheckDeviceType(Adapter As DWord, DevType As D3DDEVTYPE, AdapterFormat As D3DFORMAT, BackBufferFormat As D3DFORMAT, bWindowed As Long) As DWord
-	Abstract Function CheckDeviceFormat(Adapter As DWord, DeviceType As D3DDEVTYPE, AdapterFormat As D3DFORMAT, Usage As DWord, RType As D3DRESOURCETYPE, CheckFormat As D3DFORMAT) As DWord
-	Abstract Function CheckDeviceMultiSampleType(Adapter As DWord, DeviceType As D3DDEVTYPE, SurfaceFormat As D3DFORMAT, Windowed As Long, MultiSampleType As D3DMULTISAMPLE_TYPE, pQualityLevels As DWordPtr) As DWord
-	Abstract Function CheckDepthStencilMatch(Adapter As DWord, DeviceType As D3DDEVTYPE, AdapterFormat As D3DFORMAT, RenderTargetFormat As D3DFORMAT, DepthStencilFormat As D3DFORMAT) As DWord
-	Abstract Function CheckDeviceFormatConversion(Adapter As DWord, DeviceType As D3DDEVTYPE, SourceFormat As D3DFORMAT, TargetFormat As D3DFORMAT) As DWord
-	Abstract Function GetDeviceCaps(Adapter As DWord, DeviceType As D3DDEVTYPE, pCaps As *D3DCAPS9) As DWord
-	Abstract Function GetAdapterMonitor(Adapter As DWord) As DWord
-	Abstract Function CreateDevice(Adapter As DWord, DeviceType As D3DDEVTYPE, hFocusWindow As HWND, BehaviorFlags As DWord, pPresentationParameters As *D3DPRESENT_PARAMETERS, ppReturnedDeviceInterface As *LPDIRECT3DDEVICE9) As DWord
-End Class
+	Function ShoRegisterSoftwareDevice(pInitializeFunction As VoidPtr) As DWord
+	Function GetAdapterCount() As DWord
+	Function GetAdapterIdentifier(Adapter As DWord, Flags As DWord, pIdentifier As *D3DADAPTER_IDENTIFIER9) As DWord
+	Function GetAdapterModeCount(Adapter As DWord, Format As D3DFORMAT) As DWord
+	Function EnumAdapterModes(Adapter As DWord, Format As D3DFORMAT, Mode As DWord, pMode As *D3DDISPLAYMODE) As DWord
+	Function GetAdapterDisplayMode(Adapter As DWord, pMode As *D3DDISPLAYMODE) As DWord
+	Function CheckDeviceType(Adapter As DWord, DevType As D3DDEVTYPE, AdapterFormat As D3DFORMAT, BackBufferFormat As D3DFORMAT, bWindowed As Long) As DWord
+	Function CheckDeviceFormat(Adapter As DWord, DeviceType As D3DDEVTYPE, AdapterFormat As D3DFORMAT, Usage As DWord, RType As D3DRESOURCETYPE, CheckFormat As D3DFORMAT) As DWord
+	Function CheckDeviceMultiSampleType(Adapter As DWord, DeviceType As D3DDEVTYPE, SurfaceFormat As D3DFORMAT, Windowed As Long, MultiSampleType As D3DMULTISAMPLE_TYPE, pQualityLevels As DWordPtr) As DWord
+	Function CheckDepthStencilMatch(Adapter As DWord, DeviceType As D3DDEVTYPE, AdapterFormat As D3DFORMAT, RenderTargetFormat As D3DFORMAT, DepthStencilFormat As D3DFORMAT) As DWord
+	Function CheckDeviceFormatConversion(Adapter As DWord, DeviceType As D3DDEVTYPE, SourceFormat As D3DFORMAT, TargetFormat As D3DFORMAT) As DWord
+	Function GetDeviceCaps(Adapter As DWord, DeviceType As D3DDEVTYPE, pCaps As *D3DCAPS9) As DWord
+	Function GetAdapterMonitor(Adapter As DWord) As DWord
+	Function CreateDevice(Adapter As DWord, DeviceType As D3DDEVTYPE, hFocusWindow As HWND, BehaviorFlags As DWord, pPresentationParameters As *D3DPRESENT_PARAMETERS, ppReturnedDeviceInterface As *LPDIRECT3DDEVICE9) As DWord
+End Interface
 TypeDef LPDIRECT3D9 = *IDirect3D9
 
-Class IDirect3DDevice9
+Interface IDirect3DDevice9
 	Inherits IUnknown
 Public
 	'IDirect3DDevice9 methods
-	Abstract Function TestCooperativeLevel() As DWord
-	Abstract Function GetAvailableTextureMem() As DWord
-	Abstract Function EvictManagedResources() As DWord
-	Abstract Function GetDirect3D(ppD3D9 As *LPDIRECT3D9) As DWord
-	Abstract Function GetDeviceCaps(pCaps As *D3DCAPS9) As DWord
-	Abstract Function GetDisplayMode(iSwapChain As DWord, pMode As DWordPtr) As DWord
-	Abstract Function GetCreationParameters(pParameters As *D3DDEVICE_CREATION_PARAMETERS) As DWord
-	Abstract Function SetCursorProperties(XHotSpot As DWord, YHotSpot As DWord,pCursorBitmap As *IDirect3DSurface9) As DWord
-	Abstract Sub SetCursorPosition(X As Long, Y As Long, Flags As DWord)
-	Abstract Function ShowCursor(bShow As Long) As Long
-	Abstract Function CreateAdditionalSwapChain(pPresentationParameters As *D3DPRESENT_PARAMETERS, ppSwapChain As **IDirect3DSwapChain9) As DWord
-	Abstract Function GetSwapChain(iSwapChain As DWord, ppSwapChain As **IDirect3DSwapChain9) As DWord
-	Abstract Function GetNumberOfSwapChains() As DWord
-	Abstract Function Reset(pPresentationParameters As *D3DPRESENT_PARAMETERS) As DWord
-	Abstract Function Present(pSourceRect As *RECT, pDestRect As *RECT, hDestWindowOverride As DWord, pDirtyRegion As *RGNDATA) As DWord
-	Abstract Function GetBackBuffer(iSwapChain As DWord, iBackBuffer As DWord, bufType As D3DBACKBUFFER_TYPE, ppBackBuffer As **IDirect3DSurface9) As DWord
-	Abstract Function GetRasterStatus(iSwapChain As DWord, pRasterStatus As *D3DRASTER_STATUS) As DWord
-	Abstract Function SetDialogBoxMode(bEnableDialogs As Long) As DWord
-	Abstract Sub SetGammaRamp(iSwapChain As DWord, Flags As DWord, pRamp As *D3DGAMMARAMP)
-	Abstract Sub GetGammaRamp(iSwapChain As DWord, pRamp As *D3DGAMMARAMP)
-	Abstract Function CreateTexture(Width As DWord, Height As DWord, Levels As DWord, Usage As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppTexture As **IDirect3DTexture9, pSharedHandle As DWordPtr) As DWord
-	Abstract Function CreateVolumeTexture(Width As DWord, Height As DWord, Depth As DWord, Levels As DWord, Usage As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppVolumeTexture As **IDirect3DVolumeTexture9, pSharedHandle As DWordPtr) As DWord
-	Abstract Function CreateCubeTexture(EdgeLength As DWord, Levels As DWord, Usage As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppCubeTexture As **IDirect3DCubeTexture9, pSharedHandle As DWordPtr) As DWord
-	Abstract Function CreateVertexBuffer(Length As DWord, Usage As DWord, FVF As DWord, Pool As D3DPOOL, ppVertexBuffer As **IDirect3DVertexBuffer9, pSharedHandle As DWordPtr) As DWord
-	Abstract Function CreateIndexBuffer(Length As DWord, Usage As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppIndexBuffer As **IDirect3DIndexBuffer9, pSharedHandle As DWordPtr) As DWord
-	Abstract Function CreateRenderTarget(Width As DWord, Height As DWord, Format As D3DFORMAT, MultiSample As D3DMULTISAMPLE_TYPE, MultisampleQuality As DWord, Lockable As Long, ppSurface As **IDirect3DSurface9, pSharedHandle As DWordPtr) As DWord
-	Abstract Function CreateDepthStencilSurface(Width As DWord, Height As DWord, Format As D3DFORMAT, MultiSample As D3DMULTISAMPLE_TYPE, MultisampleQuality As DWord, Discard As Long, ppSurface As **IDirect3DSurface9, pSharedHandle As DWordPtr) As DWord
-	Abstract Function UpdateSurface(pSourceSurface As *IDirect3DSurface9, pSourceRect As *RECT, pDestinationSurface As *IDirect3DSurface9, pDestPoint As *POINTAPI) As DWord
-	Abstract Function UpdateTexture(pSourceTexture As *IDirect3DBaseTexture9, pDestinationTexture As *IDirect3DBaseTexture9) As DWord
-	Abstract Function GetRenderTargetData(pRenderTarget As *IDirect3DSurface9, pDestSurface As *IDirect3DSurface9) As DWord
-	Abstract Function GetFrontBufferData(iSwapChain As DWord, pDestSurface As *IDirect3DSurface9) As DWord
-	Abstract Function StretchRect(pSourceSurface As *IDirect3DSurface9, pSourceRect As *RECT, pDestSurface As *IDirect3DSurface9, pDestRect As *RECT, Filter As D3DTEXTUREFILTERTYPE) As DWord
-	Abstract Function ColorFill(pSurface As *IDirect3DSurface9, pRect As *RECT,dwColor As DWord) As DWord
-	Abstract Function CreateOffscreenPlainSurface(Width As DWord, Height As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppSurface As **IDirect3DSurface9, pSharedHandle As DWordPtr) As DWord
-	Abstract Function SetRenderTarget(RenderTargetIndex As DWord, pRenderTarget As *IDirect3DSurface9) As DWord
-	Abstract Function GetRenderTarget(RenderTargetIndex As DWord, ppRenderTarget As **IDirect3DSurface9) As DWord
-	Abstract Function SetDepthStencilSurface(pNewZStencil As *IDirect3DSurface9) As DWord
-	Abstract Function GetDepthStencilSurface(ppZStencilSurface As **IDirect3DSurface9) As DWord
-	Abstract Function BeginScene() As DWord
-	Abstract Function EndScene() As DWord
-	Abstract Function Clear(Count As DWord, pRects As *D3DRECT, Flags As DWord, dwColor As DWord, Z As Single, Stencil As DWord) As DWord
-	Abstract Function SetTransform(State As D3DTRANSFORMSTATETYPE, pMatrix As *D3DMATRIX) As DWord
-	Abstract Function GetTransform(State As D3DTRANSFORMSTATETYPE, pMatrix As *D3DMATRIX) As DWord
-	Abstract Function MultiplyTransform(State As D3DTRANSFORMSTATETYPE, pMatrix As *D3DMATRIX) As DWord
-	Abstract Function SetViewport(pViewport As *D3DVIEWPORT9) As DWord
-	Abstract Function GetViewport(pViewport As *D3DVIEWPORT9) As DWord
-	Abstract Function SetMaterial(pMaterial As *D3DMATERIAL9) As DWord
-	Abstract Function GetMaterial(pMaterial As *D3DMATERIAL9) As DWord
-	Abstract Function SetLight(Index As DWord, pLight As *D3DLIGHT9) As DWord
-	Abstract Function GetLight(Index As DWord, pLight As *D3DLIGHT9) As DWord
-	Abstract Function LightEnable(Index As DWord, Enable As Long) As DWord
-	Abstract Function GetLightEnable(Index As DWord, pEnable As DWordPtr) As DWord
-	Abstract Function SetClipPlane(Index As DWord, pPlane As SinglePtr) As DWord
-	Abstract Function GetClipPlane(Index As DWord, pPlane As SinglePtr) As DWord
-	Abstract Function SetRenderState(State As D3DRENDERSTATETYPE, Value As DWord) As DWord
-	Abstract Function GetRenderState(State As D3DRENDERSTATETYPE, pValue As DWordPtr) As DWord
-	Abstract Function CreateStateBlock(BlockType As D3DSTATEBLOCKTYPE, ppSB As **IDirect3DStateBlock9) As DWord
-	Abstract Function BeginStateBlock() As DWord
-	Abstract Function EndStateBlock(ppSB As **IDirect3DStateBlock9) As DWord
-	Abstract Function SetClipStatus(pClipStatus As *D3DCLIPSTATUS9) As DWord
-	Abstract Function GetClipStatus(pClipStatus As *D3DCLIPSTATUS9) As DWord
-	Abstract Function GetTexture(Stage As DWord, ppTexture As **IDirect3DBaseTexture9) As DWord
-	Abstract Function SetTexture(Stage As DWord, pTexture As *IDirect3DBaseTexture9) As DWord
-	Abstract Function GetTextureStageState(Stage As DWord, StateType As D3DTEXTURESTAGESTATETYPE, pValue As DWordPtr) As DWord
-	Abstract Function SetTextureStageState(Stage As DWord, StateType As D3DTEXTURESTAGESTATETYPE, Value As DWord) As DWord
-	Abstract Function GetSamplerState(Sampler As DWord, SamplerStateType As D3DSAMPLERSTATETYPE, pValue As DWordPtr) As DWord
-	Abstract Function SetSamplerState(Sampler As DWord, SamplerStateType As D3DSAMPLERSTATETYPE, Value As DWord) As DWord
-	Abstract Function ValidateDevice(pNumPasses As DWordPtr) As DWord
-	Abstract Function SetPaletteEntries(PaletteNumber As DWord, pEntries As *PALETTEENTRY) As DWord
-	Abstract Function GetPaletteEntries(PaletteNumber As DWord, pEntries As *PALETTEENTRY) As DWord
-	Abstract Function SetCurrentTexturePalette(PaletteNumber As DWord) As DWord
-	Abstract Function GetCurrentTexturePalette(pPaletteNumber As DWordPtr) As DWord
-	Abstract Function SetScissorRect(pRect As *RECT) As DWord
-	Abstract Function GetScissorRect(pRect As *RECT) As DWord
-	Abstract Function SetSoftwareVertexProcessing(bSoftware As Long) As DWord
-	Abstract Function GetSoftwareVertexProcessing() As Long
-	Abstract Function SetNPatchMode(nSegments As Single) As DWord
-	Abstract Function GetNPatchMode() As Single
-	Abstract Function DrawPrimitive(PrimitiveType As D3DPRIMITIVETYPE, StartVertex As DWord, PrimitiveCount As DWord) As DWord
-	Abstract Function DrawIndexedPrimitive(PrimitiveType As D3DPRIMITIVETYPE, BaseVertexIndex As Long, MinVertexIndex As DWord, NumVertices As DWord, startIndex As DWord, primCount As DWord) As DWord
-	Abstract Function DrawPrimitiveUP(PrimitiveType As D3DPRIMITIVETYPE, PrimitiveCount As DWord, pVertexStreamZeroData As VoidPtr, VertexStreamZeroStride As DWord) As DWord
-	Abstract Function DrawIndexedPrimitiveUP(PrimitiveType As D3DPRIMITIVETYPE, MinVertexIndex As DWord, NumVertices As DWord, PrimitiveCount As DWord, pIndexData As VoidPtr, IndexDataFormat As D3DFORMAT, pVertexStreamZeroData As VoidPtr, VertexStreamZeroStride As DWord) As DWord
-	Abstract Function ProcessVertices(SrcStartIndex As DWord, DestIndex As DWord, VertexCount As DWord, pDestBuffer As *IDirect3DVertexBuffer9, pVertexDecl As *IDirect3DVertexDeclaration9, Flags As DWord) As DWord
-	Abstract Function CreateVertexDeclaration(pVertexElements As *D3DVERTEXELEMENT9, ppDecl As **IDirect3DVertexDeclaration9) As DWord
-	Abstract Function SetVertexDeclaration(pDecl As *IDirect3DVertexDeclaration9) As DWord
-	Abstract Function GetVertexDeclaration(ppDecl As **IDirect3DVertexDeclaration9) As DWord
-	Abstract Function SetFVF(FVF As DWord) As DWord
-	Abstract Function GetFVF(pFVF As DWordPtr) As DWord
-	Abstract Function CreateVertexShader(pFunction As DWordPtr, ppShader As **IDirect3DVertexShader9) As DWord
-	Abstract Function SetVertexShader(pShader As *IDirect3DVertexShader9) As DWord
-	Abstract Function GetVertexShader(ppShader As **IDirect3DVertexShader9) As DWord
-	Abstract Function SetVertexShaderConstantF(StartRegister As DWord, pConstantData As SinglePtr, Vector4fCount As DWord) As DWord
-	Abstract Function GetVertexShaderConstantF(StartRegister As DWord, pConstantData As SinglePtr, Vector4fCount As DWord) As DWord
-	Abstract Function SetVertexShaderConstantI(StartRegister As DWord, pConstantData As WordPtr, Vector4iCount As DWord) As DWord
-	Abstract Function GetVertexShaderConstantI(StartRegister As DWord, pConstantData As WordPtr, Vector4iCount As DWord) As DWord
-	Abstract Function SetVertexShaderConstantB(StartRegister As DWord, pConstantData As DWordPtr, BoolCount As DWord) As DWord
-	Abstract Function GetVertexShaderConstantB(StartRegister As DWord, pConstantData As DWordPtr, BoolCount As DWord) As DWord
-	Abstract Function SetStreamSource(StreamNumber As DWord, pStreamData As *IDirect3DVertexBuffer9, OffsetInBytes As DWord, Stride As DWord) As DWord
-	Abstract Function GetStreamSource(StreamNumber As DWord, ppStreamData As **IDirect3DVertexBuffer9, pOffsetInBytes As DWordPtr, pStride As DWordPtr) As DWord
-	Abstract Function SetStreamSourceFreq(StreamNumber As DWord, Setting As DWord) As DWord
-	Abstract Function GetStreamSourceFreq(StreamNumber As DWord, pSetting As DWordPtr) As DWord
-	Abstract Function SetIndices(pIndexData As *IDirect3DIndexBuffer9) As DWord
-	Abstract Function GetIndices(ppIndexData As **IDirect3DIndexBuffer9) As DWord
-	Abstract Function CreatePixelShader(pFunction As DWordPtr, ppShader As **IDirect3DPixelShader9) As DWord
-	Abstract Function SetPixelShader(pShader As *IDirect3DPixelShader9) As DWord
-	Abstract Function GetPixelShader(ppShader As **IDirect3DPixelShader9) As DWord
-	Abstract Function SetPixelShaderConstantF(StartRegister As DWord, pConstantData As SinglePtr, Vector4fCount As DWord) As DWord
-	Abstract Function GetPixelShaderConstantF(StartRegister As DWord, pConstantData As SinglePtr, Vector4fCount As DWord) As DWord
-	Abstract Function SetPixelShaderConstantI(StartRegister As DWord, pConstantData As WordPtr, Vector4iCount As DWord) As DWord
-	Abstract Function GetPixelShaderConstantI(StartRegister As DWord, pConstantData As WordPtr, Vector4iCount As DWord) As DWord
-	Abstract Function SetPixelShaderConstantB(StartRegister As DWord, pConstantData As DWordPtr, BoolCount As DWord) As DWord
-	Abstract Function GetPixelShaderConstantB(StartRegister As DWord, pConstantData As DWordPtr, BoolCount As DWord) As DWord
-	Abstract Function DrawRectPatch(Handle As DWord, pNumSegs As SinglePtr, pRectPatchInfo As *D3DRECTPATCH_INFO) As DWord
-	Abstract Function DrawTriPatch(Handle As DWord, pNumSegs As SinglePtr, pTriPatchInfo As *D3DTRIPATCH_INFO) As DWord
-	Abstract Function DeletePatch(Handle As DWord) As DWord
-	Abstract Function CreateQuery(QueryType As D3DQUERYTYPE, ppQuery As **IDirect3DQuery9) As DWord
-End Class
+	Function TestCooperativeLevel() As DWord
+	Function GetAvailableTextureMem() As DWord
+	Function EvictManagedResources() As DWord
+	Function GetDirect3D(ppD3D9 As *LPDIRECT3D9) As DWord
+	Function GetDeviceCaps(pCaps As *D3DCAPS9) As DWord
+	Function GetDisplayMode(iSwapChain As DWord, pMode As DWordPtr) As DWord
+	Function GetCreationParameters(pParameters As *D3DDEVICE_CREATION_PARAMETERS) As DWord
+	Function SetCursorProperties(XHotSpot As DWord, YHotSpot As DWord,pCursorBitmap As *IDirect3DSurface9) As DWord
+	Sub SetCursorPosition(X As Long, Y As Long, Flags As DWord)
+	Function ShowCursor(bShow As Long) As Long
+	Function CreateAdditionalSwapChain(pPresentationParameters As *D3DPRESENT_PARAMETERS, ppSwapChain As **IDirect3DSwapChain9) As DWord
+	Function GetSwapChain(iSwapChain As DWord, ppSwapChain As **IDirect3DSwapChain9) As DWord
+	Function GetNumberOfSwapChains() As DWord
+	Function Reset(pPresentationParameters As *D3DPRESENT_PARAMETERS) As DWord
+	Function Present(pSourceRect As *RECT, pDestRect As *RECT, hDestWindowOverride As DWord, pDirtyRegion As *RGNDATA) As DWord
+	Function GetBackBuffer(iSwapChain As DWord, iBackBuffer As DWord, bufType As D3DBACKBUFFER_TYPE, ppBackBuffer As **IDirect3DSurface9) As DWord
+	Function GetRasterStatus(iSwapChain As DWord, pRasterStatus As *D3DRASTER_STATUS) As DWord
+	Function SetDialogBoxMode(bEnableDialogs As Long) As DWord
+	Sub SetGammaRamp(iSwapChain As DWord, Flags As DWord, pRamp As *D3DGAMMARAMP)
+	Sub GetGammaRamp(iSwapChain As DWord, pRamp As *D3DGAMMARAMP)
+	Function CreateTexture(Width As DWord, Height As DWord, Levels As DWord, Usage As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppTexture As **IDirect3DTexture9, pSharedHandle As DWordPtr) As DWord
+	Function CreateVolumeTexture(Width As DWord, Height As DWord, Depth As DWord, Levels As DWord, Usage As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppVolumeTexture As **IDirect3DVolumeTexture9, pSharedHandle As DWordPtr) As DWord
+	Function CreateCubeTexture(EdgeLength As DWord, Levels As DWord, Usage As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppCubeTexture As **IDirect3DCubeTexture9, pSharedHandle As DWordPtr) As DWord
+	Function CreateVertexBuffer(Length As DWord, Usage As DWord, FVF As DWord, Pool As D3DPOOL, ppVertexBuffer As **IDirect3DVertexBuffer9, pSharedHandle As DWordPtr) As DWord
+	Function CreateIndexBuffer(Length As DWord, Usage As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppIndexBuffer As **IDirect3DIndexBuffer9, pSharedHandle As DWordPtr) As DWord
+	Function CreateRenderTarget(Width As DWord, Height As DWord, Format As D3DFORMAT, MultiSample As D3DMULTISAMPLE_TYPE, MultisampleQuality As DWord, Lockable As Long, ppSurface As **IDirect3DSurface9, pSharedHandle As DWordPtr) As DWord
+	Function CreateDepthStencilSurface(Width As DWord, Height As DWord, Format As D3DFORMAT, MultiSample As D3DMULTISAMPLE_TYPE, MultisampleQuality As DWord, Discard As Long, ppSurface As **IDirect3DSurface9, pSharedHandle As DWordPtr) As DWord
+	Function UpdateSurface(pSourceSurface As *IDirect3DSurface9, pSourceRect As *RECT, pDestinationSurface As *IDirect3DSurface9, pDestPoint As *POINTAPI) As DWord
+	Function UpdateTexture(pSourceTexture As *IDirect3DBaseTexture9, pDestinationTexture As *IDirect3DBaseTexture9) As DWord
+	Function GetRenderTargetData(pRenderTarget As *IDirect3DSurface9, pDestSurface As *IDirect3DSurface9) As DWord
+	Function GetFrontBufferData(iSwapChain As DWord, pDestSurface As *IDirect3DSurface9) As DWord
+	Function StretchRect(pSourceSurface As *IDirect3DSurface9, pSourceRect As *RECT, pDestSurface As *IDirect3DSurface9, pDestRect As *RECT, Filter As D3DTEXTUREFILTERTYPE) As DWord
+	Function ColorFill(pSurface As *IDirect3DSurface9, pRect As *RECT,dwColor As DWord) As DWord
+	Function CreateOffscreenPlainSurface(Width As DWord, Height As DWord, Format As D3DFORMAT, Pool As D3DPOOL, ppSurface As **IDirect3DSurface9, pSharedHandle As DWordPtr) As DWord
+	Function SetRenderTarget(RenderTargetIndex As DWord, pRenderTarget As *IDirect3DSurface9) As DWord
+	Function GetRenderTarget(RenderTargetIndex As DWord, ppRenderTarget As **IDirect3DSurface9) As DWord
+	Function SetDepthStencilSurface(pNewZStencil As *IDirect3DSurface9) As DWord
+	Function GetDepthStencilSurface(ppZStencilSurface As **IDirect3DSurface9) As DWord
+	Function BeginScene() As DWord
+	Function EndScene() As DWord
+	Function Clear(Count As DWord, pRects As *D3DRECT, Flags As DWord, dwColor As DWord, Z As Single, Stencil As DWord) As DWord
+	Function SetTransform(State As D3DTRANSFORMSTATETYPE, pMatrix As *D3DMATRIX) As DWord
+	Function GetTransform(State As D3DTRANSFORMSTATETYPE, pMatrix As *D3DMATRIX) As DWord
+	Function MultiplyTransform(State As D3DTRANSFORMSTATETYPE, pMatrix As *D3DMATRIX) As DWord
+	Function SetViewport(pViewport As *D3DVIEWPORT9) As DWord
+	Function GetViewport(pViewport As *D3DVIEWPORT9) As DWord
+	Function SetMaterial(pMaterial As *D3DMATERIAL9) As DWord
+	Function GetMaterial(pMaterial As *D3DMATERIAL9) As DWord
+	Function SetLight(Index As DWord, pLight As *D3DLIGHT9) As DWord
+	Function GetLight(Index As DWord, pLight As *D3DLIGHT9) As DWord
+	Function LightEnable(Index As DWord, Enable As Long) As DWord
+	Function GetLightEnable(Index As DWord, pEnable As DWordPtr) As DWord
+	Function SetClipPlane(Index As DWord, pPlane As SinglePtr) As DWord
+	Function GetClipPlane(Index As DWord, pPlane As SinglePtr) As DWord
+	Function SetRenderState(State As D3DRENDERSTATETYPE, Value As DWord) As DWord
+	Function GetRenderState(State As D3DRENDERSTATETYPE, pValue As DWordPtr) As DWord
+	Function CreateStateBlock(BlockType As D3DSTATEBLOCKTYPE, ppSB As **IDirect3DStateBlock9) As DWord
+	Function BeginStateBlock() As DWord
+	Function EndStateBlock(ppSB As **IDirect3DStateBlock9) As DWord
+	Function SetClipStatus(pClipStatus As *D3DCLIPSTATUS9) As DWord
+	Function GetClipStatus(pClipStatus As *D3DCLIPSTATUS9) As DWord
+	Function GetTexture(Stage As DWord, ppTexture As **IDirect3DBaseTexture9) As DWord
+	Function SetTexture(Stage As DWord, pTexture As *IDirect3DBaseTexture9) As DWord
+	Function GetTextureStageState(Stage As DWord, StateType As D3DTEXTURESTAGESTATETYPE, pValue As DWordPtr) As DWord
+	Function SetTextureStageState(Stage As DWord, StateType As D3DTEXTURESTAGESTATETYPE, Value As DWord) As DWord
+	Function GetSamplerState(Sampler As DWord, SamplerStateType As D3DSAMPLERSTATETYPE, pValue As DWordPtr) As DWord
+	Function SetSamplerState(Sampler As DWord, SamplerStateType As D3DSAMPLERSTATETYPE, Value As DWord) As DWord
+	Function ValidateDevice(pNumPasses As DWordPtr) As DWord
+	Function SetPaletteEntries(PaletteNumber As DWord, pEntries As *PALETTEENTRY) As DWord
+	Function GetPaletteEntries(PaletteNumber As DWord, pEntries As *PALETTEENTRY) As DWord
+	Function SetCurrentTexturePalette(PaletteNumber As DWord) As DWord
+	Function GetCurrentTexturePalette(pPaletteNumber As DWordPtr) As DWord
+	Function SetScissorRect(pRect As *RECT) As DWord
+	Function GetScissorRect(pRect As *RECT) As DWord
+	Function SetSoftwareVertexProcessing(bSoftware As Long) As DWord
+	Function GetSoftwareVertexProcessing() As Long
+	Function SetNPatchMode(nSegments As Single) As DWord
+	Function GetNPatchMode() As Single
+	Function DrawPrimitive(PrimitiveType As D3DPRIMITIVETYPE, StartVertex As DWord, PrimitiveCount As DWord) As DWord
+	Function DrawIndexedPrimitive(PrimitiveType As D3DPRIMITIVETYPE, BaseVertexIndex As Long, MinVertexIndex As DWord, NumVertices As DWord, startIndex As DWord, primCount As DWord) As DWord
+	Function DrawPrimitiveUP(PrimitiveType As D3DPRIMITIVETYPE, PrimitiveCount As DWord, pVertexStreamZeroData As VoidPtr, VertexStreamZeroStride As DWord) As DWord
+	Function DrawIndexedPrimitiveUP(PrimitiveType As D3DPRIMITIVETYPE, MinVertexIndex As DWord, NumVertices As DWord, PrimitiveCount As DWord, pIndexData As VoidPtr, IndexDataFormat As D3DFORMAT, pVertexStreamZeroData As VoidPtr, VertexStreamZeroStride As DWord) As DWord
+	Function ProcessVertices(SrcStartIndex As DWord, DestIndex As DWord, VertexCount As DWord, pDestBuffer As *IDirect3DVertexBuffer9, pVertexDecl As *IDirect3DVertexDeclaration9, Flags As DWord) As DWord
+	Function CreateVertexDeclaration(pVertexElements As *D3DVERTEXELEMENT9, ppDecl As **IDirect3DVertexDeclaration9) As DWord
+	Function SetVertexDeclaration(pDecl As *IDirect3DVertexDeclaration9) As DWord
+	Function GetVertexDeclaration(ppDecl As **IDirect3DVertexDeclaration9) As DWord
+	Function SetFVF(FVF As DWord) As DWord
+	Function GetFVF(pFVF As DWordPtr) As DWord
+	Function CreateVertexShader(pFunction As DWordPtr, ppShader As **IDirect3DVertexShader9) As DWord
+	Function SetVertexShader(pShader As *IDirect3DVertexShader9) As DWord
+	Function GetVertexShader(ppShader As **IDirect3DVertexShader9) As DWord
+	Function SetVertexShaderConstantF(StartRegister As DWord, pConstantData As SinglePtr, Vector4fCount As DWord) As DWord
+	Function GetVertexShaderConstantF(StartRegister As DWord, pConstantData As SinglePtr, Vector4fCount As DWord) As DWord
+	Function SetVertexShaderConstantI(StartRegister As DWord, pConstantData As WordPtr, Vector4iCount As DWord) As DWord
+	Function GetVertexShaderConstantI(StartRegister As DWord, pConstantData As WordPtr, Vector4iCount As DWord) As DWord
+	Function SetVertexShaderConstantB(StartRegister As DWord, pConstantData As DWordPtr, BoolCount As DWord) As DWord
+	Function GetVertexShaderConstantB(StartRegister As DWord, pConstantData As DWordPtr, BoolCount As DWord) As DWord
+	Function SetStreamSource(StreamNumber As DWord, pStreamData As *IDirect3DVertexBuffer9, OffsetInBytes As DWord, Stride As DWord) As DWord
+	Function GetStreamSource(StreamNumber As DWord, ppStreamData As **IDirect3DVertexBuffer9, pOffsetInBytes As DWordPtr, pStride As DWordPtr) As DWord
+	Function SetStreamSourceFreq(StreamNumber As DWord, Setting As DWord) As DWord
+	Function GetStreamSourceFreq(StreamNumber As DWord, pSetting As DWordPtr) As DWord
+	Function SetIndices(pIndexData As *IDirect3DIndexBuffer9) As DWord
+	Function GetIndices(ppIndexData As **IDirect3DIndexBuffer9) As DWord
+	Function CreatePixelShader(pFunction As DWordPtr, ppShader As **IDirect3DPixelShader9) As DWord
+	Function SetPixelShader(pShader As *IDirect3DPixelShader9) As DWord
+	Function GetPixelShader(ppShader As **IDirect3DPixelShader9) As DWord
+	Function SetPixelShaderConstantF(StartRegister As DWord, pConstantData As SinglePtr, Vector4fCount As DWord) As DWord
+	Function GetPixelShaderConstantF(StartRegister As DWord, pConstantData As SinglePtr, Vector4fCount As DWord) As DWord
+	Function SetPixelShaderConstantI(StartRegister As DWord, pConstantData As WordPtr, Vector4iCount As DWord) As DWord
+	Function GetPixelShaderConstantI(StartRegister As DWord, pConstantData As WordPtr, Vector4iCount As DWord) As DWord
+	Function SetPixelShaderConstantB(StartRegister As DWord, pConstantData As DWordPtr, BoolCount As DWord) As DWord
+	Function GetPixelShaderConstantB(StartRegister As DWord, pConstantData As DWordPtr, BoolCount As DWord) As DWord
+	Function DrawRectPatch(Handle As DWord, pNumSegs As SinglePtr, pRectPatchInfo As *D3DRECTPATCH_INFO) As DWord
+	Function DrawTriPatch(Handle As DWord, pNumSegs As SinglePtr, pTriPatchInfo As *D3DTRIPATCH_INFO) As DWord
+	Function DeletePatch(Handle As DWord) As DWord
+	Function CreateQuery(QueryType As D3DQUERYTYPE, ppQuery As **IDirect3DQuery9) As DWord
+End Interface
 TypeDef LPDIRECT3DDEVICE9 = *IDirect3DDevice9
 
-Class IDirect3DStateBlock9
+Interface IDirect3DStateBlock9
 	Inherits IUnknown
 Public
 	'IDirect3DStateBlock9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function Capture() As DWord
-	Abstract Function Apply() As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function Capture() As DWord
+	Function Apply() As DWord
+End Interface
 TypeDef LPDIRECT3DSTATEBLOCK9 = *IDirect3DStateBlock9
 
-Class IDirect3DSwapChain9
+Interface IDirect3DSwapChain9
 	Inherits IUnknown
 Public
 	'IDirect3DSwapChain9 methods
-	Abstract Function Present(pSourceRect As *RECT, pDestRect As *RECT, hDestWindowOverride As DWord, pDirtyRegion As *RGNDATA, dwFlags As DWord) As DWord
-	Abstract Function GetFrontBufferData(pDestSurface As *IDirect3DSurface9) As DWord
-	Abstract Function GetBackBuffer(iBackBuffer As DWord, bbtype As D3DBACKBUFFER_TYPE, ppBackBuffer As **IDirect3DSurface9) As DWord
-	Abstract Function GetRasterStatus(pRasterStatus As *D3DRASTER_STATUS) As DWord
-	Abstract Function GetDisplayMode(pMode As *D3DDISPLAYMODE) As DWord
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function GetPresentParameters(pPresentationParameters As *D3DPRESENT_PARAMETERS) As DWord
-End Class
+	Function Present(pSourceRect As *RECT, pDestRect As *RECT, hDestWindowOverride As DWord, pDirtyRegion As *RGNDATA, dwFlags As DWord) As DWord
+	Function GetFrontBufferData(pDestSurface As *IDirect3DSurface9) As DWord
+	Function GetBackBuffer(iBackBuffer As DWord, bbtype As D3DBACKBUFFER_TYPE, ppBackBuffer As **IDirect3DSurface9) As DWord
+	Function GetRasterStatus(pRasterStatus As *D3DRASTER_STATUS) As DWord
+	Function GetDisplayMode(pMode As *D3DDISPLAYMODE) As DWord
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function GetPresentParameters(pPresentationParameters As *D3DPRESENT_PARAMETERS) As DWord
+End Interface
 TypeDef LPDIRECT3DSWAPCHAIN9 = *IDirect3DSwapChain9
 
-Class IDirect3DResource9
+Interface IDirect3DResource9
 	Inherits IUnknown
 Public
 	'IDirect3DResource9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
-	Abstract Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
-	Abstract Function FreePrivateData(ByRef refguid As GUID) As DWord
-	Abstract Function SetPriority(PriorityNew As DWord) As DWord
-	Abstract Function GetPriority() As DWord
-	Abstract Sub PreLoad()
-	Abstract Function GetType() As D3DRESOURCETYPE
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
+	Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
+	Function FreePrivateData(ByRef refguid As GUID) As DWord
+	Function SetPriority(PriorityNew As DWord) As DWord
+	Function GetPriority() As DWord
+	Sub PreLoad()
+	Function GetType() As D3DRESOURCETYPE
+End Interface
 TypeDef LPDIRECT3DRESOURCE9 = *IDirect3DResource9
 
-Class IDirect3DVertexDeclaration9
+Interface IDirect3DVertexDeclaration9
 	Inherits IUnknown
 Public
 	'IDirect3DVertexDeclaration9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function GetDeclaration(pElement As *D3DVERTEXELEMENT9, pNumElements As DWordPtr) As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function GetDeclaration(pElement As *D3DVERTEXELEMENT9, pNumElements As DWordPtr) As DWord
+End Interface
 TypeDef LPDIRECT3DVERTEXDECLARATION9 = *IDirect3DVertexDeclaration9
 
-Class IDirect3DVertexShader9
+Interface IDirect3DVertexShader9
 	Inherits IUnknown
 Public
 	'IDirect3DVertexShader9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function GetFunction(pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function GetFunction(pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
+End Interface
 TypeDef LPDIRECT3DVERTEXSHADER9 = *IDirect3DVertexShader9
 
-Class IDirect3DPixelShader9
+Interface IDirect3DPixelShader9
 	Inherits IUnknown
 Public
 	'IDirect3DPixelShader9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function GetFunction(pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function GetFunction(pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
+End Interface
 TypeDef LPDIRECT3DPIXELSHADER9 = *IDirect3DPixelShader9
 
-Class IDirect3DBaseTexture9
+Interface IDirect3DBaseTexture9
 	Inherits IUnknown
 Public
 	'IDirect3DResource9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
-	Abstract Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
-	Abstract Function FreePrivateData(ByRef refguid As GUID) As DWord
-	Abstract Function SetPriority(PriorityNew As DWord) As DWord
-	Abstract Function GetPriority() As DWord
-	Abstract Sub PreLoad()
-	Abstract Function GetType() As D3DRESOURCETYPE
-	Abstract Function SetLOD(LODNew As DWord) As DWord
-	Abstract Function GetLOD() As DWord
-	Abstract Function GetLevelCount() As DWord
-	Abstract Function SetAutoGenFilterType(FilterType As D3DTEXTUREFILTERTYPE) As DWord
-	Abstract Function GetAutoGenFilterType() As D3DTEXTUREFILTERTYPE
-	Abstract Sub GenerateMipSubLevels()
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
+	Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
+	Function FreePrivateData(ByRef refguid As GUID) As DWord
+	Function SetPriority(PriorityNew As DWord) As DWord
+	Function GetPriority() As DWord
+	Sub PreLoad()
+	Function GetType() As D3DRESOURCETYPE
+	Function SetLOD(LODNew As DWord) As DWord
+	Function GetLOD() As DWord
+	Function GetLevelCount() As DWord
+	Function SetAutoGenFilterType(FilterType As D3DTEXTUREFILTERTYPE) As DWord
+	Function GetAutoGenFilterType() As D3DTEXTUREFILTERTYPE
+	Sub GenerateMipSubLevels()
+End Interface
 TypeDef LPDIRECT3DBASETEXTURE9 = *IDirect3DBaseTexture9
 
-Class IDirect3DTexture9
+Interface IDirect3DTexture9
 	Inherits IDirect3DBaseTexture9
 Public
-	Abstract Function GetLevelDesc(Level As DWord, pDesc As *D3DSURFACE_DESC) As DWord
-	Abstract Function GetSurfaceLevel(Level As DWord, ppSurfaceLevel As **IDirect3DSurface9) As DWord
-	Abstract Function LockRect(Level As DWord, pLockedRect As *D3DLOCKED_RECT, pRect As *RECT, Flags As DWord) As DWord
-	Abstract Function UnlockRect(Level As DWord) As DWord
-	Abstract Function AddDirtyRect(pDirtyRect As *RECT) As DWord
-End Class
+	Function GetLevelDesc(Level As DWord, pDesc As *D3DSURFACE_DESC) As DWord
+	Function GetSurfaceLevel(Level As DWord, ppSurfaceLevel As **IDirect3DSurface9) As DWord
+	Function LockRect(Level As DWord, pLockedRect As *D3DLOCKED_RECT, pRect As *RECT, Flags As DWord) As DWord
+	Function UnlockRect(Level As DWord) As DWord
+	Function AddDirtyRect(pDirtyRect As *RECT) As DWord
+End Interface
 TypeDef LPDIRECT3DTEXTURE9 = *IDirect3DTexture9
 
-Class IDirect3DVolumeTexture9
+Interface IDirect3DVolumeTexture9
 	Inherits IDirect3DBaseTexture9
 Public
-	Abstract Function GetLevelDesc(Level As DWord, pDesc As *D3DSURFACE_DESC) As DWord
-	Abstract Function GetVolumeLevel(Level As DWord, ppVolumeLevel As **IDirect3DVolume9) As DWord
-	Abstract Function LockBox(Level As DWord, pLockedVolume As *D3DLOCKED_BOX, pBox As *D3DBOX, Flags As DWord) As DWord
-	Abstract Function UnlockBox(Level As DWord) As DWord
-	Abstract Function AddDirtyBox(pDirtyBox As *D3DBOX) As DWord
-End Class
+	Function GetLevelDesc(Level As DWord, pDesc As *D3DSURFACE_DESC) As DWord
+	Function GetVolumeLevel(Level As DWord, ppVolumeLevel As **IDirect3DVolume9) As DWord
+	Function LockBox(Level As DWord, pLockedVolume As *D3DLOCKED_BOX, pBox As *D3DBOX, Flags As DWord) As DWord
+	Function UnlockBox(Level As DWord) As DWord
+	Function AddDirtyBox(pDirtyBox As *D3DBOX) As DWord
+End Interface
 TypeDef LPDIRECT3DVOLUMETEXTURE9 = *IDirect3DVolumeTexture9
 
-Class IDirect3DCubeTexture9
+Interface IDirect3DCubeTexture9
 	Inherits IDirect3DBaseTexture9
-End Class
+End Interface
 TypeDef LPDIRECT3DCUBETEXTURE9 = *IDirect3DCubeTexture9
 
-Class IDirect3DVertexBuffer9
+Interface IDirect3DVertexBuffer9
 	Inherits IUnknown
 Public
 	'IDirect3DResource9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
-	Abstract Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
-	Abstract Function FreePrivateData(ByRef refguid As GUID) As DWord
-	Abstract Function SetPriority(PriorityNew As DWord) As DWord
-	Abstract Function GetPriority() As DWord
-	Abstract Sub PreLoad()
-	Abstract Function GetType() As D3DRESOURCETYPE
-	Abstract Function Lock(OffsetToLock As DWord, SizeToLock As DWord, ppbData As VoidPtr, Flags As DWord) As DWord
-	Abstract Function Unlock() As DWord
-	Abstract Function GetDesc(pDesc As *D3DVERTEXBUFFER_DESC) As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
+	Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
+	Function FreePrivateData(ByRef refguid As GUID) As DWord
+	Function SetPriority(PriorityNew As DWord) As DWord
+	Function GetPriority() As DWord
+	Sub PreLoad()
+	Function GetType() As D3DRESOURCETYPE
+	Function Lock(OffsetToLock As DWord, SizeToLock As DWord, ppbData As VoidPtr, Flags As DWord) As DWord
+	Function Unlock() As DWord
+	Function GetDesc(pDesc As *D3DVERTEXBUFFER_DESC) As DWord
+End Interface
 TypeDef LPDIRECT3DVERTEXBUFFER9 = *IDirect3DVertexBuffer9
 
-Class IDirect3DIndexBuffer9
+Interface IDirect3DIndexBuffer9
 	Inherits IUnknown
 Public
 	'IDirect3DResource9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
-	Abstract Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
-	Abstract Function FreePrivateData(ByRef refguid As GUID) As DWord
-	Abstract Function SetPriority(PriorityNew As DWord) As DWord
-	Abstract Function GetPriority() As DWord
-	Abstract Sub PreLoad()
-	Abstract Function GetType() As D3DRESOURCETYPE
-	Abstract Function Lock(OffsetToLock As DWord, SizeToLock As DWord, ppbData As VoidPtr, Flags As DWord) As DWord
-	Abstract Function Unlock() As DWord
-	Abstract Function GetDesc(pDesc As *D3DINDEXBUFFER_DESC) As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
+	Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
+	Function FreePrivateData(ByRef refguid As GUID) As DWord
+	Function SetPriority(PriorityNew As DWord) As DWord
+	Function GetPriority() As DWord
+	Sub PreLoad()
+	Function GetType() As D3DRESOURCETYPE
+	Function Lock(OffsetToLock As DWord, SizeToLock As DWord, ppbData As VoidPtr, Flags As DWord) As DWord
+	Function Unlock() As DWord
+	Function GetDesc(pDesc As *D3DINDEXBUFFER_DESC) As DWord
+End Interface
 TypeDef LPDIRECT3DINDEXBUFFER9 = *IDirect3DIndexBuffer9
 
-Class IDirect3DSurface9
+Interface IDirect3DSurface9
 	Inherits IUnknown
 Public
 	'IDirect3DResource9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
-	Abstract Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
-	Abstract Function FreePrivateData(ByRef refguid As GUID) As DWord
-	Abstract Function SetPriority(PriorityNew As DWord) As DWord
-	Abstract Function GetPriority() As DWord
-	Abstract Sub PreLoad()
-	Abstract Function GetType() As D3DRESOURCETYPE
-	Abstract Function GetContainer(ByRef riid As GUID, ppContainer As VoidPtr) As DWord
-	Abstract Function GetDesc(pDesc As *D3DSURFACE_DESC) As DWord
-	Abstract Function LockRect(pLockedRect As *D3DLOCKED_RECT, pRect As *RECT, Flags As DWord) As DWord
-	Abstract Function UnlockRect() As DWord
-	Abstract Function GetDC(phdc As DWordPtr) As DWord
-	Abstract Function ReleaseDC(hdc As DWord) As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
+	Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
+	Function FreePrivateData(ByRef refguid As GUID) As DWord
+	Function SetPriority(PriorityNew As DWord) As DWord
+	Function GetPriority() As DWord
+	Sub PreLoad()
+	Function GetType() As D3DRESOURCETYPE
+	Function GetContainer(ByRef riid As GUID, ppContainer As VoidPtr) As DWord
+	Function GetDesc(pDesc As *D3DSURFACE_DESC) As DWord
+	Function LockRect(pLockedRect As *D3DLOCKED_RECT, pRect As *RECT, Flags As DWord) As DWord
+	Function UnlockRect() As DWord
+	Function GetDC(phdc As DWordPtr) As DWord
+	Function ReleaseDC(hdc As DWord) As DWord
+End Interface
 TypeDef LPDIRECT3DSURFACE9 = *IDirect3DSurface9
 
-Class IDirect3DVolume9
+Interface IDirect3DVolume9
 	Inherits IUnknown
 Public
 	'IDirect3DVolume9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
-	Abstract Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
-	Abstract Function FreePrivateData(ByRef refguid As GUID) As DWord
-	Abstract Function GetContainer(ByRef riid As GUID, ppContainer As DWordPtr) As DWord
-	Abstract Function GetDesc(pDesc As *D3DVOLUME_DESC) As DWord
-	Abstract Function LockBox(pLockedVolume As *D3DLOCKED_BOX, pBox As *D3DBOX, Flags As DWord) As DWord
-	Abstract Function UnlockBox() As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function SetPrivateData(ByRef refguid As GUID, pData As VoidPtr, SizeOfData As DWord, Flags As DWord) As DWord
+	Function GetPrivateData(ByRef refguid As GUID, pData As VoidPtr, pSizeOfData As DWordPtr) As DWord
+	Function FreePrivateData(ByRef refguid As GUID) As DWord
+	Function GetContainer(ByRef riid As GUID, ppContainer As DWordPtr) As DWord
+	Function GetDesc(pDesc As *D3DVOLUME_DESC) As DWord
+	Function LockBox(pLockedVolume As *D3DLOCKED_BOX, pBox As *D3DBOX, Flags As DWord) As DWord
+	Function UnlockBox() As DWord
+End Interface
 TypeDef LPDIRECT3DVOLUME9 = *IDirect3DVolume9
 
-Class IDirect3DQuery9
+Interface IDirect3DQuery9
 	Inherits IUnknown
 Public
 	'IDirect3DQuery9 methods
-	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
-	Abstract Function GetType() As D3DQUERYTYPE
-	Abstract Function GetDataSize() As DWord
-	Abstract Function Issue(dwIssueFlags As DWord) As DWord
-	Abstract Function GetData(pData As VoidPtr, dwSize As DWord, dwGetDataFlags As DWord) As DWord
-End Class
+	Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
+	Function GetType() As D3DQUERYTYPE
+	Function GetDataSize() As DWord
+	Function Issue(dwIssueFlags As DWord) As DWord
+	Function GetData(pData As VoidPtr, dwSize As DWord, dwGetDataFlags As DWord) As DWord
+End Interface
 TypeDef LPDIRECT3DQUERY9 = *IDirect3DQuery9
 
Index: trunk/Include/exdisp.ab
===================================================================
--- trunk/Include/exdisp.ab	(revision 303)
+++ trunk/Include/exdisp.ab	(revision 303)
@@ -0,0 +1,254 @@
+'exdisp.ab
+
+'#require <ocidl.ab>
+'#require <docobj.ab>
+
+
+Const Enum OLECMDID 'docobj.ab
+End Enum
+
+Const Enum OLECMDEXECOPT 'docobj.ab
+End Enum
+
+Const Enum OLECMDTEXTF 'docobj.ab
+End Enum
+
+Const Enum OLECMDF 'docobj.ab
+End Enum
+
+Const Enum READYSTATE 'ocidl.ab
+End Enum
+
+'SID_SkipHung
+
+/* library SHDocVw */
+/* [version][lcid][helpstring][uuid] */
+
+'各種列挙体
+
+'LIBID_SHDocVw
+
+/* interface IWebBrowser */
+/* [object][oleautomation][dual][hidden][helpcontext][helpstring][uuid] */
+
+/* [helpstring][uuid] 14EE5380-A378-11cf-A731-00A0C9082637*/
+Const Enum BrowserNavConstants
+	navOpenInNewWindow = &h1
+	navNoHistory = &h2
+	navNoReadFromCache = &h4
+	navNoWriteToCache = &h8
+	navAllowAutosearch = &h10
+	navBrowserBar = &h20
+	navHyperlink = &h40
+	navEnforceRestricted = &h80
+	navNewWindowsManaged = &h100
+	navUntrustedForDownload = &h200
+	navTrustedForActiveX = &h400
+	navOpenInNewTab = &h800
+	navOpenInBackgroundTab = &h1000
+	navKeepWordWheelText = &h2000
+End Enum
+
+/* [helpstring][uuid] C317C261-A991-11cf-A731-00A0C9082637*/
+Const Enum RefreshConstants
+	REFRESH_NORMAL = 0
+	REFRESH_IFEXPIRED = 1
+	REFRESH_COMPLETELY = 3
+End Enum
+
+Dim IID_IWebBrowser = [&hEAB22AC1, &h30C1, &h11CF, [&hA7, &hEB, &h00, &h00, &hC0, &h5B, &hAE, &h0B]] As IID
+Interface IWebBrowser
+	Inherits IDispatch
+
+	/* [helpcontext][helpstring][id] */ Function GoBack() As HRESULT
+	/* [helpcontext][helpstring][id] */ Function GoForward() As HRESULT
+	/* [helpcontext][helpstring][id] */ Function GoHome() As HRESULT
+	/* [helpcontext][helpstring][id] */ Function GoSearch() As HRESULT
+	/* [helpcontext][helpstring][id] */ Function Navigate(
+		/* [in] */ URL As BSTR,
+		/* [optional][in] */ Flags As *VARIANT,
+		/* [optional][in] */ TargetFrameName As *VARIANT,
+		/* [optional][in] */ PostData As *VARIANT,
+		/* [optional][in] */ Headers As *VARIANT) As HRESULT
+	/* [helpcontext][helpstring][id] */ Function Refresh() As HRESULT
+	/* [helpcontext][helpstring][id] */ Function Refresh2(
+		/* [optional][in] */ Level As *VARIANT) As HRESULT
+	/* [helpcontext][helpstring][id] */ Function Stop() As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Application(
+		/* [retval][out] */ ByRef Disp As IDispatch) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Parent(
+		/* [retval][out] */ ByRef Disp As IDispatch) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Container(
+		/* [retval][out] */ ByRef Disp As IDispatch) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Document(
+		/* [retval][out] */ ByRef Disp As IDispatch) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_TopLevelContainer(
+		/* [retval][out] */ ByRef Bool As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Type(
+		/* [retval][out] */ ByRef Type_ As BSTR) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Left(
+		/* [retval][out] */ ByRef l As Long) As HRESULT
+	/* [propput][id] */ Function put_Left(
+		/* [in] */ Left As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Top(
+		/* [retval][out] */ ByRef l As Long) As HRESULT
+	/* [propput][id] */ Function put_Top(
+		/* [in] */ Top As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Width(
+		/* [retval][out] */ ByRef l As Long) As HRESULT
+	/* [propput][id] */ Function put_Width(
+		/* [in] */ Width As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Height(
+		/* [retval][out] */ ByRef l As Long) As HRESULT
+	/* [propput][id] */ Function put_Height(
+		/* [in] */ Height As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_LocationName(
+		/* [retval][out] */ ByRef LocationName As BSTR) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_LocationURL(
+		/* [retval][out] */ ByRef LocationURL As BSTR) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Busy(
+		/* [retval][out] */ ByRef Bool As VARIANT_BOOL) As HRESULT
+End Interface
+
+/* dispinterface DWebBrowserEvents */
+/* [hidden][helpstring][uuid] */
+
+Dim DIID_DWebBrowserEvents = [&hEAB22AC2, &h30C1, &h11CF, [&hA7, &hEB, &h00, &h00, &hC0, &h5B, &hAE, &h0B]] As IID
+Interface DIID_DWebBrowserEvents
+	Inherits IDispatch
+End Interface
+
+/* interface IWebBrowserApp */
+/* [object][dual][oleautomation][hidden][helpcontext][helpstring][uuid] */
+
+Dim IID_IWebBrowserApp = [&h0002DF05, 0, 0, [&hC0, 0, 0, 0, 0, 0, 46]] As IID
+Interface IWebBrowserApp
+	Inherits IWebBrowser
+
+	/* [helpcontext][helpstring][id] */ Function Quit() As HRESULT
+	/* [helpcontext][helpstring][id] */ Function ClientToWindow(
+		/* [out][in] */ ByRef cx As Long,
+		/* [out][in] */ ByRef pcy As Long) As HRESULT
+	/* [helpcontext][helpstring][id] */ Function PutProperty(
+		/* [in] */ Property As BSTR,
+		/* [in] */ vtValue As VARIANT) As HRESULT
+	/* [helpcontext][helpstring][id] */ Function GetProperty(
+		/* [in] */ Property As BSTR,
+		/* [retval][out] */ ByRef vtValue As VARIANT) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Name(
+		/* [retval][out] */ ByRef Name As BSTR) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_HWND(
+		/* [retval][out] */ ByRef hwnd As LONG_PTR) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_FullName(
+		/* [retval][out] */ ByRef FullName As BSTR) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Path(
+		/* [retval][out] */ ByRef Path As BSTR) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Visible(
+		/* [retval][out] */ ByRef Bool As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_Visible(
+		/* [in] */ Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_StatusBar(
+		/* [retval][out] */ ByRef Bool As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_StatusBar(
+		/* [in] */ Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_StatusText(
+		/* [retval][out] */ ByRef StatusText As BSTR) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_StatusText(
+		/* [in] */ StatusText As BSTR) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_ToolBar(
+		/* [retval][out] */ ByRef Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_ToolBar(
+		/* [in] */ Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_MenuBar(
+		/* [retval][out] */ ByRef Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_MenuBar(
+		/* [in] */ Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_FullScreen(
+		/* [retval][out] */ ByRef bFullScreen As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_FullScreen(
+		/* [in] */ bFullScreen As VARIANT_BOOL) As HRESULT
+End Interface
+
+/* interface IWebBrowser2 */
+/* [object][dual][oleautomation][hidden][helpcontext][helpstring][uuid] */
+
+Dim IID_IWebBrowser2 = [&hD30C1661, &hCDAF, &h11d0, [&h8A, &h3E, &h00, &hC0, &h4F, &hC9, &hE2, &h6E]] As IID
+Interface IWebBrowser2
+	Inherits IWebBrowserApp
+
+	/* [helpcontext][helpstring][id] */ Function Navigate2(
+		/* [in] */ URL As *VARIANT,
+		/* [optional][in] */ Flags As *VARIANT,
+		/* [optional][in] */ TargetFrameName As *VARIANT,
+		/* [optional][in] */ PostData As *VARIANT,
+		/* [optional][in] */ Headers As *VARIANT) As HRESULT
+	/* [helpcontext][helpstring][id] */ Function QueryStatusWB(
+		/* [in] */ cmdID As OLECMDID,
+		/* [retval][out] */ ByRef cmdf As OLECMDF) As HRESULT
+	/* [helpcontext][helpstring][id] */ Function ExecWB(
+		/* [in] */ cmdID As OLECMDID,
+		/* [in] */ cmdexecopt As OLECMDEXECOPT,
+		/* [optional][in] */ pvaIn As *VARIANT,
+		/* [optional][in][out] */ pvaOut As *VARIANT) As HRESULT
+	/* [helpcontext][helpstring][id] */ Function ShowBrowserBar(
+		/* [in] */ ByRef vaClsid As VARIANT,
+		/* [optional][in] */ pvarShow As *VARIANT,
+		/* [optional][in] */ pvarSize As *VARIANT) As HRESULT
+	/* [bindable][propget][id] */ Function get_ReadyState(
+		/* [out][retval] */ ByRef lReadyState As READYSTATE) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Offline(
+		/* [retval][out] */ ByRef bOffline As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_Offline(
+		/* [in] */ bOffline As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Silent(
+		/* [retval][out] */ ByRef bSilent As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_Silent(
+		/* [in] */ bSilent As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_RegisterAsBrowser(
+		/* [retval][out] */ ByRef bRegister As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_RegisterAsBrowser(
+		/* [in] */ bRegister As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_RegisterAsDropTarget(
+		/* [retval][out] */ ByRef bRegister As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_RegisterAsDropTarget(
+		/* [in] */ bRegister As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_TheaterMode(
+		/* [retval][out] */ ByRef bRegister As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_TheaterMode(
+		/* [in] */ bRegister As VARIANT_BOOL) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_AddressBar(
+		/* [retval][out] */ ByRef Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_AddressBar(
+		/* [in] */ Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propget][id] */ Function get_Resizable(
+		/* [retval][out] */ ByRef Value As Long) As HRESULT
+	/* [helpcontext][helpstring][propput][id] */ Function put_Resizable(
+		/* [in] */ Value As Long) As HRESULT
+End Interface
+
+/* dispinterface DWebBrowserEvents2 */
+/* [hidden][helpstring][uuid] */
+
+Dim DIID_DWebBrowserEvents2 = [&h34A715A0, &h6587, &h11D0, [&h92, &h4A, &h00, &h20, &hAF, &hC7, &hAC, &h4D]] As IID
+Interface DWebBrowserEvents2
+	Inherits IDispatch
+End Interface
+
+Dim CLSID_WebBrowser_V1 = [&hEAB22AC3, &h30C1, &h11CF, [&hA7, &hEB, &h00, &h00, &hC0, &h5B, &hAE, &h0B]] As CLSID
+Dim CLSID_WebBrowser = [&h8856F961, &h340A, &h11D0, [&hA9, &h6B, &h00, &hC0, &h4F, &hD7, &h05, &hA2]] As CLSID
+Dim CLSID_InternetExplorer = [&h0002DF01, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As CLSID
+Dim CLSID_ShellBrowserWindow = [&hc08afd90, &hf2a1, &h11d1, [&h84, &h55, &h00, &ha0, &hc9, &h1f, &h38, &h80]] As CLSID
+
+'DShellWindowsEvents
+'IShellWindows
+'ShellWindows
+'IShellUIHelper
+'IShellUIHelper2
+'ShellUIHelper
+'DShellNameSpaceEvents
+'IShellFavoritesNameSpace
+'IShellNameSpace
+'ShellNameSpace
+'ShellShellNameSpace
+'IScriptErrorList
+'CScriptErrorList
Index: trunk/Include/objbase.sbp
===================================================================
--- trunk/Include/objbase.sbp	(revision 302)
+++ trunk/Include/objbase.sbp	(revision 303)
@@ -107,9 +107,9 @@
 Declare Function CoInitialize Lib "ole32" (pvReserved As VoidPtr) As HRESULT
 Declare Sub CoUninitialize Lib "ole32" ()
-'Declare Sub CoGetMalloc Lib "ole32" (dwMemContext As DWord, ByRef pMalloc As IMalloc) As HRESULT
+'Declare Sub CoGetMalloc Lib "ole32" (dwMemContext As DWord, ByRef Malloc As IMalloc) As HRESULT
 Declare Function CoGetCurrentProcess Lib "ole32" () As DWord
-'Declare Function CoRegisterMallocSpy Lib "ole32" (pMallocSpy As *IMallocSpy) As HRESULT
+'Declare Function CoRegisterMallocSpy Lib "ole32" (ByRef MallocSpy As IMallocSpy) As HRESULT
 Declare Function CoRevokeMallocSpy Lib "ole32" () As HRESULT
-'Declare Function CoCreateStandardMalloc Lib "ole32" (memctx As DWord, ByRef pMalloc As *IMalloc) As HRESULT
+'Declare Function CoCreateStandardMalloc Lib "ole32" (memctx As DWord, ByRef Malloc As IMalloc) As HRESULT
 
 
@@ -129,5 +129,5 @@
 '#if (_WIN32_WINNT >= &h0501)
 ' 注意：このcokkieは本来ULARGE_INTEGER型
-'Declare Function CoRegisterInitializeSpy Lib "ole32" (pSpy As *IInitializeSpy, ByRef uliCokkie As QWord) As HRESULT
+'Declare Function CoRegisterInitializeSpy Lib "ole32" (Spy As IInitializeSpy, ByRef uliCokkie As QWord) As HRESULT
 Declare Function CoRevokeInitializeSpy Lib "ole32" (uliCookie As QWord) As HRESULT
 
@@ -179,5 +179,5 @@
 
 /* Registering surrogate processes */
-'Declare Function CoRegisterSurrogate Lib "ole32" (pSurrogate As *ISurrogate) As HRESULT
+'Declare Function CoRegisterSurrogate Lib "ole32" (Surrogate As ISurrogate) As HRESULT
 
 /* marshaling interface pointers */
Index: trunk/Include/objidl.sbp
===================================================================
--- trunk/Include/objidl.sbp	(revision 302)
+++ trunk/Include/objidl.sbp	(revision 303)
@@ -13,6 +13,4 @@
 /* interface IMarshal */
 /* [uuid][object][local] */
-
-TypeDef LPMARSHAL = /* [unique] */ *IMarshal
 
 Dim IID_IMarshal = [&h00000003, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
@@ -51,5 +49,14 @@
 End Interface
 
-' IMarshal2
+/* interface IMarshal2 */
+/* [uuid][object][local] */
+
+Dim IID_IMarshal2 = [&h000001Cf, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IMarshal2
+	Inherits IMarshal
+End Interface
+
+/* interface IMalloc */
+/* [uuid][object][local] */
 
 Dim IID_IMalloc = [&h00000002, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
@@ -69,5 +76,44 @@
 End Interface
 
-' IMallocSpy
+/* interface IMallocSpy */
+/* [uuid][object][local] */
+
+Dim IID_IMallocSpy = [&h0000001d, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IMallocSpy
+	Inherits IUnknown
+
+	Function PreAlloc(
+		/* [in] */ cbRequest As SIZE_T) As HRESULT
+	Function PostAlloc(
+		/* [in] */ pActual As VoidPtr) As VoidPtr
+	Function PreFree(
+		/* [in] */ pRequest As VoidPtr,
+		/* [in] */ fSpyed As BOOL) As VoidPtr
+	Sub PostFree(
+		/* [in] */ fSpyed As BOOL)
+	Function PreRealloc(
+		/* [in] */ pRequest As VoidPtr,
+		/* [in] */ cbRequestt As SIZE_T,
+		/* [out] */ ByRef ppNewRequest As VoidPtr,
+		/* [in] */ fSpyed As BOOL) As HRESULT
+	Function PostRealloc(
+		/* [in] */ pActual As VoidPtr,
+		/* [in] */ fSpyed As BOOL) As VoidPtr
+	Function PreGetSize(
+		/* [in] */ pRequest As VoidPtr,
+		/* [in] */ fSpyed As BOOL) As VoidPtr
+	Function PostGetSize(
+		/* [in] */ cbActual As SIZE_T,
+		/* [in] */ fSpyed As BOOL) As HRESULT
+	Function PreDidAlloc(
+	/* [in] */ pRequest As VoidPtr,
+	/* [in] */ fSpyed As BOOL) As VoidPtr
+	Function PostDidAlloc(
+	/* [in] */ pRequest As VoidPtr,
+	/* [in] */ fSpyed As BOOL,
+	/* [in] */ fActual As Long) As Long
+	Sub PreHeapMinimize()
+	Sub PostHeapMinimize()
+End Interface
 
 ' IStdMarshalInfo
@@ -77,10 +123,9 @@
 Type MULTI_QI
 	pIID As * /*Const*/ IID
-	pItf As *IUnknown
+	pItf As IUnknown
 	hr As HRESULT
 End Type
 
 Dim IID_IMultiQI = [&h00000020, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
-
 Interface IMultiQI
 	Inherits IUnknown
@@ -95,5 +140,24 @@
 ' IInternalUnknown
 
-' IEnumUnknown
+/* interface IEnumUnknown */
+/* [unique][uuid][object] */
+
+Dim IID_IEnumUnknown = [&h00000100, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IEnumUnknown
+	Inherits IUnknown
+
+	/* [local] */ Function Next_(
+		/* [in] */ celt As DWord,
+		/* [out] */ rgelt As *IUnknown,
+		/* [out] */ ByRef celtFetched As DWord) As HRESULT
+	Function Skip(
+		/* [in] */ celt As DWord) As HRESULT
+	Function Reset() As HRESULT
+	Function Clone(
+		/* [out] */ ByRef enumUnk As IEnumUnknown) As HRESULT
+End Interface
+
+/* interface IBindCtx */
+/* [unique][uuid][object] */
 
 Type BIND_OPTS
@@ -146,7 +210,7 @@
 		/* [unique][in] */ punk As IUnknown) As HRESULT
 	Function ReleaseBoundObjects() As HRESULT
-  	/* [local] */ Function SetBindOptions(
+	/* [local] */ Function SetBindOptions(
 		/* [in] */ ByRef bindopts As BIND_OPTS) As HRESULT
-  	/* [local] */ Function GetBindOptions(
+	/* [local] */ Function GetBindOptions(
 		/* [out][in] */ ByRef bindopts As BIND_OPTS) As HRESULT
 	Function GetRunningObjectTable(
@@ -159,13 +223,53 @@
 		/* [out] */ ByRef unk As IUnknown) As HRESULT
 	Function EnumObjectParam(
- 		/* [out] */ ByRef enumstr As IEnumString) As HRESULT
+		/* [out] */ ByRef enumstr As IEnumString) As HRESULT
 	Function RevokeObjectParam(
 		/* [in] */ pszKey As LPOLESTR) As HRESULT
 End Interface
 
-' IEnumMoniker
-
+/* interface IEnumMoniker */
+/* [unique][uuid][object] */
+
+Dim IID_IEnumMoniker = [&h00000102, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IEnumMoniker
+	Inherits IUnknown
+	/* [local] */ Function Next_(
+		/* [in] */ celt As DWord,
+		/* [length_is][size_is][out] */ rgelt As *IMoniker,
+		/* [out] */ ByRef celtFetched As DWord) As HRESULT
+	Function Skip(
+		/* [in] */ celt As DWord) As HRESULT
+	Function Reset() As HRESULT
+	Function Clone(
+		/* [out] */ enumMon As IEnumMoniker) As HRESULT
+End Interface
+
+/* interface IRunningObjectTable */
+/* [uuid][object] */
+
+Dim IID_IRunningObjectTable = [&h00000010, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
 Interface IRunningObjectTable
 	Inherits IUnknown
+
+	Function Register(
+		/* [in] */ grfFlags As DWord,
+		/* [unique][in] */ unkObject As IUnknown,
+		/* [unique][in] */ mkObjectName As IMoniker,
+		/* [out] */ ByRef dwRegister As DWord) As HRESULT
+	Function Revoke(
+		/* [in] */ dwRegister As DWord) As HRESULT
+	Function IsRunning(
+		/* [unique][in] */ mkObjectName As IMoniker) As HRESULT
+	Function GetObject(
+		/* [unique][in] */ mkObjectName As IMoniker,
+		/* [out] */ ByRef unkObject As IUnknown) As HRESULT
+	Function NoteChangeTime(
+		/* [in] */ dwRegister As DWord,
+		/* [in] */ ByRef filetime As FILETIME) As HRESULT
+	Function GetTimeOfLastChange(
+		/* [unique][in] */ mkObjectName As IMoniker,
+		/* [in] */ ByRef filetime As FILETIME) As HRESULT
+	Function EnumRunning(
+		/* [out] */ ByRef enumMoniker As IEnumMoniker) As HRESULT
 End Interface
 
@@ -186,16 +290,96 @@
 	Function Load(
 		/* [unique][in] */ Stm As IStream) As HRESULT
-
 	Function Save(
 		/* [unique][in] */ Stm As IStream,
 		/* [in] */ fClearDirty As BOOL) As HRESULT
-
 	Function GetSizeMax(
 		/* [out] */ ByRef cbSize As ULARGE_INTEGER) As HRESULT
 End Interface
 
+/* interface IMoniker */
+/* [unique][uuid][object] */
+
+Const Enum MKSYS
+	MKSYS_NONE = 0
+	MKSYS_GENERICCOMPOSITE = 1
+	MKSYS_FILEMONIKER = 2
+	MKSYS_ANTIMONIKER = 3
+	MKSYS_ITEMMONIKER = 4
+	MKSYS_POINTERMONIKER = 5
+	MKSYS_CLASSMONIKER = 7
+	MKSYS_OBJREFMONIKER = 8
+	MKSYS_SESSIONMONIKER = 9
+	MKSYS_LUAMONIKER = 10
+End Enum
+
+/* [v1_enum] */ Const Enum MKREDUCE
+	MKRREDUCE_ONE = (3 << 16)
+	MKRREDUCE_TOUSER = (2 << 16)
+	MKRREDUCE_THROUGHUSER = (1 << 16)
+	MKRREDUCE_ALL = 0
+End Enum
+
+Dim IID_IMoniker = [&h0000000f, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
 Interface IMoniker
 	Inherits IPersistStream
-End Interface
+
+	/* [local] */ Function BindToObject(
+		/* [unique][in] */ bc As IBindCtx,
+		/* [unique][in] */ mkToLeft As IMoniker,
+		/* [in] */ ByRef riidResult As IID,
+		/* [iid_is][out] */ ByRef Result As Any) As HRESULT
+	/* [local] */ Function BindToStorage(
+		/* [unique][in] */ bc As IBindCtx,
+		/* [unique][in] */ mkToLeft As IMoniker,
+		/* [in] */ ByRef riid As IID,
+		/* [iid_is][out] */ ByRef Obj As Any) As HRESULT
+	Function Reduce(
+		/* [unique][in] */ bc As IBindCtx,
+		/* [in] */ dwReduceHowFar As DWord,
+		/* [unique][out][in] */ ByRef mkToLeft As IMoniker,
+		/* [out] */ ByRef mkReduced As IMoniker) As HRESULT
+	Function ComposeWith(
+		/* [unique][in] */ ByRef mkRight As IMoniker,
+		/* [in] */ fOnlyIfNotGeneric As BOOL,
+		/* [out] */ ByRef mkComposite As IMoniker) As HRESULT
+	Function Enum_(
+		/* [in] */ fForward As BOOL,
+		/* [out] */ ByRef enumMoniker As IEnumMoniker) As HRESULT
+	Function IsEqual(
+		/* [unique][in] */ mkOtherMoniker As IMoniker) As HRESULT
+	Function Hash(
+		/* [out] */ ByRef dwHash As DWord) As HRESULT
+	Function IsRunning(
+		/* [unique][in] */ bc As IBindCtx,
+		/* [unique][in] */ mkToLeft As IMoniker,
+		/* [unique][in] */ mkNewlyRunning As IMoniker) As HRESULT
+	Function GetTimeOfLastChange(
+		/* [unique][in] */ bc As IBindCtx,
+		/* [unique][in] */ mkToLeft As IMoniker,
+		/* [out] */ ByRef FileTime As FILETIME) As HRESULT
+	Function Inverse(
+		/* [out] */ ByRef mk As IMoniker) As HRESULT
+	Function CommonPrefixWith(
+		/* [unique][in] */ mkOther As IMoniker,
+		/* [out] */ ByRef mkPrefix As IMoniker) As HRESULT
+	Function RelativePathTo(
+		/* [unique][in] */ mkOther As IMoniker,
+		/* [out] */ ByRef mkRelPath As IMoniker) As HRESULT
+	Function GetDisplayName(
+		/* [unique][in] */ bc As IBindCtx,
+		/* [unique][in] */ mkToLeft As IMoniker,
+		/* [out] */ ByRef pszDisplayName As LPOLESTR) As HRESULT
+	Function ParseDisplayName(
+		/* [unique][in] */ bc As IBindCtx,
+		/* [unique][in] */ mkToLeft As IMoniker,
+		/* [in] */  pszDisplayName As LPOLESTR,
+		/* [out] */ ByRef chEaten As DWord,
+		/* [out] */ ByRef mkOut As IMoniker) As HRESULT
+	Function IsSystemMoniker(
+		/* [out] */ ByRef dwMksys As DWord) As HRESULT
+End Interface
+
+/* interface IEnumString */
+/* [unique][uuid][object] */
 
 Dim IID_IEnumString = [&h00000101, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
@@ -214,11 +398,23 @@
 End Interface
 
+/* interface ISequentialStream */
+/* [unique][uuid][object] */
+
 Dim IID_ISequentialStream = [&h0c733a30, &h2a1c, &h11ce, [&had, &he5, &h00, &haa, &h00, &h44, &h77, &h3d]] As IID
 Interface ISequentialStream
 	Inherits IUnknown
 
-	Function Read(pv As VoidPtr, cb As DWord, ByRef cbRead As DWord) As HRESULT
-	Function Write(pv As VoidPtr, cb As DWord, ByRef cbWritten As DWord) As HRESULT
-End Interface
+	Function Read(
+		/* [length_is][size_is][out] */ pv As VoidPtr,
+		/* [in] */ cb As DWord,
+		/* [out] */ ByRef cbRead As DWord) As HRESULT
+	Function Write(
+		/* [size_is][in] */ pv As VoidPtr,
+		/* [in] */ cb As DWord,
+		/* [out] */ ByRef cbWritten As DWord) As HRESULT
+End Interface
+
+/* interface IStream */
+/* [unique][uuid][object] */
 
 Type STATSTG
@@ -259,22 +455,52 @@
 	Inherits ISequentialStream
 
-	Function Seek(dlibMove As LARGE_INTEGER, dwOrigin As DWord, plibNewPosition As *ULARGE_INTEGER) As HRESULT
-	Function SetSize(libNewSize As ULARGE_INTEGER) As HRESULT
-	Function CopyTo(pstm As *IStream, cb As ULARGE_INTEGER, pcbRead As *ULARGE_INTEGER, pcbWritten As *ULARGE_INTEGER) As HRESULT
-	Function Commit(grfCommitFlags As DWord) As HRESULT
+	/* [local] */ Function Seek(
+		/* [in] */ dlibMove As LARGE_INTEGER,
+		/* [in] */ dwOrigin As DWord,
+		/* [out] */ plibNewPosition As *ULARGE_INTEGER) As HRESULT
+	Function SetSize(
+		/* [in] */ libNewSize As ULARGE_INTEGER) As HRESULT
+	/* [local] */ Function CopyTo(
+		/* [unique][in] */ stm As IStream,
+		/* [in] */ cb As ULARGE_INTEGER,
+		/* [out] */ pcbRead As *ULARGE_INTEGER,
+		/* [out] */ pcbWritten As *ULARGE_INTEGER) As HRESULT
+	Function Commit(
+		/* [in] */ grfCommitFlags As DWord) As HRESULT
 	Function Revert() As HRESULT
-	Function LockRegion(libOffset As ULARGE_INTEGER, cb As ULARGE_INTEGER, dwLockType As DWord) As HRESULT
-	Function UnlockRegion(libOffset As ULARGE_INTEGER, cb As ULARGE_INTEGER, dwLockType As DWord) As HRESULT
-	Function Stat(pstatstg As *STATSTG, grfStatFlag As DWord) As HRESULT
-	Function Clone(ByRef stm As IStream) As HRESULT
-End Interface
+	Function LockRegion(
+		/* [in] */ libOffset As ULARGE_INTEGER,
+		/* [in] */ cb As ULARGE_INTEGER,
+		/* [in] */ dwLockType As DWord) As HRESULT
+	Function UnlockRegion(
+		/* [in] */ libOffset As ULARGE_INTEGER,
+		/* [in] */ cb As ULARGE_INTEGER,
+		/* [in] */ dwLockType As DWord) As HRESULT
+	Function Stat(
+		/* [out] */ pstatstg As *STATSTG,
+		/* [in] */ grfStatFlag As DWord) As HRESULT
+	Function Clone(
+		/* [out] */ ByRef stm As IStream) As HRESULT
+End Interface
+
 TypeDef LPSTREAM = *IStream
 
+/* interface IEnumSTATSTG */
+/* [unique][uuid][object] */
+
+Dim IID_IEnumSTATSTG = [&h0000000d, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
 Interface IEnumSTATSTG
 	Inherits IUnknown
-End Interface
-
-#ifndef __IStorage_INTERFACE_DEFINED__
-#define __IStorage_INTERFACE_DEFINED__
+
+	/* [local] */ Function Next_(
+		/* [in] */ celt As DWord,
+		/* [length_is][size_is][out] */ rgelt As *STATSTG,
+		/* [out] */ ByRef celtFetched As DWord) As HRESULT
+	Function Skip(
+		/* [in] */ celt As DWord) As HRESULT
+	Function Reset() As HRESULT
+	Function Clone(
+		/* [out] */ ByRef enumStat As IEnumSTATSTG) As HRESULT
+End Interface
 
 /* interface IStorage */
@@ -294,5 +520,4 @@
 
 Dim IID_IStorage = [&h0000000b, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
-
 Interface IStorage
 	Inherits IUnknown
@@ -361,6 +586,8 @@
 End Interface
 
-#endif 	/* __IStorage_INTERFACE_DEFINED__ */
-
+/* interface IPersistFile */
+/* [unique][uuid][object] */
+
+Dim IID_IPersistFile = [&h0000010b, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
 Interface IPersistFile
 	Inherits IPersist
@@ -379,9 +606,55 @@
 End Interface
 
-
-' IPersistStrage
-
+/* interface IPersistStorage */
+/* [unique][uuid][object] */
+
+Dim IID_IPersistStorage = [&h0000010a, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IPersistStorage
+	Inherits IPersist
+
+	Function IsDirty() As HRESULT
+	Function InitNew(
+		/* [unique][in] */ Stg As IStorage) As HRESULT
+	Function Load(
+		/* [unique][in] */ Stg As IStorage) As HRESULT
+	Function Save(
+		/* [unique][in] */ StgSave As IStorage,
+		/* [in] */ fSameAsLoad As BOOL) As HRESULT
+	Function SaveCompleted(
+		/* [unique][in] */ StgNew As IStorage) As HRESULT
+	Function HandsOffStorage() As HRESULT
+End Interface
+
+/* interface ILockBytes */
+/* [unique][uuid][object] */
+
+Dim IID_ILockBytes = [&h0000000a, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
 Interface ILockBytes
 	Inherits IUnknown
+
+	/* [local] */ Function ReadAt(
+		/* [in] */ ulOffset As ULARGE_INTEGER,
+		/* [length_is][size_is][out] */ pv As VoidPtr,
+		/* [in] */ cb As DWord,
+		/* [out] */ ByRef cbRead As DWord) As HRESULT
+	/* [local] */ Function WriteAt(
+		/* [in] */ ulOffset As ULARGE_INTEGER,
+		/* [size_is][in] */ pv As VoidPtr,
+		/* [in] */ cb As DWord,
+		/* [out] */ ByRef cbWritten As DWord) As HRESULT
+	Function Flush() As HRESULT
+	Function SetSize(
+	/* [in] */ cb As ULARGE_INTEGER) As HRESULT
+	Function LockRegion(
+		/* [in] */ libOffset As ULARGE_INTEGER,
+		/* [in] */ cb As ULARGE_INTEGER,
+		/* [in] */ dwLockType As DWord) As HRESULT
+	Function UnlockRegion(
+		/* [in] */ libOffset As ULARGE_INTEGER,
+		/* [in] */ cb As ULARGE_INTEGER,
+		/* [in] */ dwLockType As DWord) As HRESULT
+	Function Stat(
+		/* [out] */ ByRef statstg As STATSTG,
+		/* [in] */ grfStatFlag As DWord) As HRESULT
 End Interface
 
@@ -415,5 +688,17 @@
 End Interface
 
-' IRootStorage
+/* interface IRootStorage */
+/* [unique][uuid][object] */
+
+Dim IID_IRootStorage = [&h00000012, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IRootStorage
+	Inherits IUnknown
+
+	Function SwitchToFile(
+		/* [in] */ pszFile As LPOLESTR) As HRESULT
+End Interface
+
+/* interface IAdviseSink */
+/* [unique][async_uuid][uuid][object] */
 
 Enum /*[transmit_as(long)]*/ TYMED
@@ -428,5 +713,14 @@
 End Enum
 
-Type STGMEDIUM
+Type RemSTGMEDIUM
+	tymed As DWord
+	dwHandleType As DWord
+	pData As DWord
+	pUnkForRelease As DWord
+	cbData As DWord
+	data[ELM(1)] As Byte
+End Type
+
+/* [wire_marshal] */ Type STGMEDIUM
 	tymed As DWord
 	data As VoidPtr
@@ -445,6 +739,60 @@
 End Type
 
+Type GDI_OBJECT
+'	ObjectType As DWord
+'	/* [switch_type] */ u As Union
+'		hBitmap As wireHBITMAP
+'		hPalette As wireHPALETTE
+'		hGeneric As wireHGLOBAL
+'	End Union
+End Type
+
+Type userSTGMEDIUM
+'	tymed As DWord
+'	/* [switch_type] */ u As Union
+'		/* Empty union arm */
+'		hMetaFilePict As wireHMETAFILEPICT
+'		hHEnhMetaFile As wireHENHMETAFILE
+'		hGdiHandle As *GDI_OBJECT
+'		hGlobal As wireHGLOBAL
+'		lpszFileName As LPOLESTR
+'		pstm As *BYTE_BLOB
+'		pstg As BYTE_BLOB
+'	End Union
+'	pUnkForRelease As IUnknown
+End Type
+
+TypeDef wireSTGMEDIUM = /* [unique] */ *userSTGMEDIUM
+TypeDef ASYNC_STGMEDIUM = /* [unique] */ *userSTGMEDIUM
+TypeDef wireSTGMEDIUM = /* [wire_marshal] */ STGMEDIUM
+
+Type userFLAG_STGMEDIUM
+'	ContextFlags As Long
+'	fPassOwnership As Long
+'	Stgmed As userSTGMEDIUM
+End Type
+
+TypeDef wireFLAG_STGMEDIUM = /* [unique] */ *userFLAG_STGMEDIUM
+
+Type /* [wire_marshal] */ FLAG_STGMEDIUM
+	ContextFlags As Long
+	fPassOwnership As Long
+	Stgmed As STGMEDIUM
+End Type
+
+Dim IID_IAdviseSink = [&h0000010f, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
 Interface IAdviseSink
 	Inherits IUnknown
+
+	/* [local] */ Sub OnDataChange(
+		/* [unique][in] */ ByRef Formatetc As FORMATETC,
+		/* [unique][in] */ ByRef Stgmed As STGMEDIUM)
+	/* [local] */ Sub OnViewChange(
+		/* [in] */ dwAspect As DWord,
+		/* [in] */ lindex As Long)
+	/* [local] */ Sub OnRename(
+		/* [in] */ mk As IMoniker)
+	/* [local] */ Sub OnSave()
+	/* [local] */ Sub OnClose()
 End Interface
 
@@ -455,4 +803,5 @@
 ' AsyncIAdviseSink2
 
+Dim IID_IDataObject = [&h0000010e, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
 Interface IDataObject
 	Inherits IUnknown
@@ -524,5 +873,4 @@
 
 Dim IID_IMessageFilter = [&h00000016, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
-
 Interface IMessageFilter
 	Inherits IUnknown
@@ -533,10 +881,8 @@
 		/* [in] */ dwTickCount As DWord,
 		/* [in] */ lpInterfaceInfo As LPINTERFACEINFO) As DWord
-
 	Function RetryRejectedCall(
 		/* [in] */ htaskCallee As HTASK,
 		/* [in] */ dwTickCount As DWord,
 		/* [in] */ dwRejectType As DWord) As DWord
-
 	Function MessagePending(
 		/* [in] */ htaskCallee As HTASK,
@@ -653,3 +999,3 @@
 ' IInitializeSpy
 
-#endif'_INC_OBJIDL
+#endif '_INC_OBJIDL
Index: trunk/Include/ole2.ab
===================================================================
--- trunk/Include/ole2.ab	(revision 302)
+++ trunk/Include/ole2.ab	(revision 303)
@@ -3,32 +3,4 @@
 
 ' 暫定措置
-
-Interface IPersistStorage
-	Inherits IUnknown
-End Interface
-
-Interface IDropTarget
-	Inherits IUnknown
-End Interface
-
-Interface IDropSource
-	Inherits IUnknown
-End Interface
-
-Interface IOleInPlaceFrame
-	Inherits IUnknown
-End Interface
-
-Interface IOleInPlaceActiveObject
-	Inherits IUnknown
-End Interface
-
-Interface IOleAdviseHolder
-	Inherits IUnknown
-End Interface
-
-Interface IEnumOLEVERB
-	Inherits IUnknown
-End Interface
 
 #require <api_winerror.sbp>
Index: trunk/Include/oleidl.ab
===================================================================
--- trunk/Include/oleidl.ab	(revision 302)
+++ trunk/Include/oleidl.ab	(revision 303)
@@ -1,13 +1,65 @@
 'oleidl.ab
 
-Const Enum OLERENDER 
+#require <objidl.sbp>
+
+Dim IID_IOleAdviseHolder = [&h00000111, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IOleAdviseHolder
+	Inherits IUnknown
+
+	Function Advise(
+		/* [unique][in] */ Advise As IAdviseSink,
+		/* [out] */ ByRef dwConnection As DWord) As HRESULT
+	Function Unadvise(
+		/* [in] */ dwConnection As DWord) As HRESULT
+	Function EnumAdvise(
+		/* [out] */ ByRef enumAdvise As IEnumSTATDATA) As HRESULT
+	Function SendOnRename(
+		/* [unique][in] */ pmk As IMoniker) As HRESULT
+	Function SendOnSave() As HRESULT
+	Function SendOnClose() As HRESULT
+End Interface
+
+'IOleCache
+'IOleCache2
+'IOleCacheControl
+
+/* interface IParseDisplayName */
+/* [unique][uuid][object] */
+
+Dim IID_IParseDisplayName = [&h0000011a, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+
+Interface IParseDisplayName
+	Inherits IUnknown
+
+	Function ParseDisplayName(
+		/* [unique][in] */ bc As IBindCtx,
+		/* [in] */ pszDisplayName As LPOLESTR,
+		/* [out] */ ByRef chEaten As DWord,
+		/* [out] */ ByRef mkOut As IMoniker) As HRESULT
+End Interface
+
+/* interface IOleContainer */
+/* [unique][uuid][object] */
+
+Dim IID_IOleContainer = [&h0000011b, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IOleContainer
+	Inherits IParseDisplayName
+
+	Function EnumObjects(
+		/* [in] */ grfFlags As DWord,
+		/* [out] */ ByRef enumUnk As IEnumUnknown) As HRESULT
+	Function LockContainer(
+		/* [in] */ fLock As BOOL) As HRESULT
+End Interface
+
+Const Enum OLERENDER
 	OLERENDER_NONE = 0
 	OLERENDER_DRAW = 1
 	OLERENDER_FORMAT = 2
-	OLERENDER_ASIS = 3 
+	OLERENDER_ASIS = 3
 End Enum
 
 Dim IID_IOleClientSite = [&h00000118, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
-Interface IOleClientSite 
+Interface IOleClientSite
 	Inherits IUnknown
 
@@ -16,7 +68,7 @@
 		/* [in] */ dwAssign As DWord,
 		/* [in] */ dwWhichMoniker As DWord,
-		/* [out] */ ByRef pmk As *IMoniker) As HRESULT
+		/* [out] */ ByRef mk As IMoniker) As HRESULT
 	Function GetContainer(
-		/* [out] */ ByRef pContainer As VoidPtr /* *IOleContainer*/) As HRESULT
+		/* [out] */ ByRef Container As IOleContainer) As HRESULT
 	Function ShowObject() As HRESULT
 	Function OnShowWindow(
@@ -25,4 +77,57 @@
 End Interface
 
+/* interface IOleObject */
+/* [unique][uuid][object] */
+
+Const Enum  OLEGETMONIKER
+	OLEGETMONIKER_ONLYIFTHERE = 1
+	OLEGETMONIKER_FORCEASSIGN = 2
+	OLEGETMONIKER_UNASSIGN = 3
+	OLEGETMONIKER_TEMPFORUSER = 4
+End Enum
+
+Const Enum  OLEWHICHMK
+	OLEWHICHMK_CONTAINER = 1
+	OLEWHICHMK_OBJREL = 2
+	OLEWHICHMK_OBJFULL = 3
+End Enum
+
+Const Enum  USERCLASSTYPE
+	USERCLASSTYPE_FULL = 1
+	USERCLASSTYPE_SHORT = 2
+	USERCLASSTYPE_APPNAME = 3
+End Enum
+
+Const Enum  OLEMISC
+	OLEMISC_RECOMPOSEONRESIZE = &h1
+	OLEMISC_ONLYICONIC = &h2
+	OLEMISC_INSERTNOTREPLACE = &h4
+	OLEMISC_STATIC = &h8
+	OLEMISC_CANTLINKINSIDE = &h10
+	OLEMISC_CANLINKBYOLE1 = &h20
+	OLEMISC_ISLINKOBJECT = &h40
+	OLEMISC_INSIDEOUT = &h80
+	OLEMISC_ACTIVATEWHENVISIBLE = &h100
+	OLEMISC_RENDERINGISDEVICEINDEPENDENT = &h200
+	OLEMISC_INVISIBLEATRUNTIME = &h400
+	OLEMISC_ALWAYSRUN = &h800
+	OLEMISC_ACTSLIKEBUTTON = &h1000
+	OLEMISC_ACTSLIKELABEL = &h2000
+	OLEMISC_NOUIACTIVATE = &h4000
+	OLEMISC_ALIGNABLE = &h8000
+	OLEMISC_SIMPLEFRAME = &h10000
+	OLEMISC_SETCLIENTSITEFIRST = &h20000
+	OLEMISC_IMEMODE = &h40000
+	OLEMISC_IGNOREACTIVATEWHENVISIBLE = &h80000
+	OLEMISC_WANTSTOMENUMERGE = &h100000
+	OLEMISC_SUPPORTSMULTILEVELUNDO = &h200000
+End Enum
+
+Const Enum OLECLOSE
+	OLECLOSE_SAVEIFDIRTY = 0
+	OLECLOSE_NOSAVE = 1
+	OLECLOSE_PROMPTSAVE = 2
+End Enum
+
 Dim IID_IOleObject = [&h00000112, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
 Interface IOleObject
@@ -30,35 +135,35 @@
 
 	Function SetClientSite(
-		/* [unique][in] */ pClientSite As IOleClientSite) As HRESULT    
+		/* [unique][in] */ ClientSite As IOleClientSite) As HRESULT
 	Function GetClientSite(
-		/* [out] */ ByRef pClientSite As *IOleClientSite) As HRESULT
+		/* [out] */ ByRef ClientSite As IOleClientSite) As HRESULT
 	Function SetHostNames(
 		/* [in] */ szContainerApp As LPCOLESTR,
 		/* [unique][in] */ szContainerObj As LPCOLESTR) As HRESULT
 	Function Close(
-		/* [in] */ dwSaveOption As DWord) As HRESULT   
+		/* [in] */ dwSaveOption As DWord) As HRESULT
 	Function SetMoniker(
 		/* [in] */ dwWhichMoniker As DWord,
-		/* [unique][in] */ pmk As *IMoniker) As HRESULT
+		/* [unique][in] */ mk As IMoniker) As HRESULT
 	Function GetMoniker(
 		/* [in] */ dwAssign As DWord,
 		/* [in] */ dwWhichMoniker As DWord,
-		/* [out] */ ByRef pmk As *IMoniker) As HRESULT
+		/* [out] */ ByRef mk As IMoniker) As HRESULT
 	Function InitFromData(
-		/* [unique][in] */ pDataObject As IDataObject,
+		/* [unique][in] */ DataObject As IDataObject,
 		/* [in] */ fCreation As BOOL,
 		/* [in] */ dwReserved As DWord) As HRESULT
 	Function GetClipboardData(
 		/* [in] */ dwReserved As DWord,
-		/* [out] */ ByRef pDataObject As *IDataObject) As HRESULT
+		/* [out] */ ByRef DataObject As IDataObject) As HRESULT
 	Function DoVerb(
 		/* [in] */ iVerb As Long,
 		/* [unique][in] */ lpmsg As *MSG,
-		/* [unique][in] */ pActiveSite As IOleClientSite,
+		/* [unique][in] */ ActiveSite As IOleClientSite,
 		/* [in] */ lindex As Long,
 		/* [in] */ hwndParent As HWND,
 		/* [unique][in] */ lprcPosRect As *RECT /*LPCRECT*/) As HRESULT
 	Function EnumVerbs(
-		/* [out] */ ByRef pEnumOleVerb As *IUnknown /*IEnumOLEVERB*/) As HRESULT
+		/* [out] */ ByRef EnumOleVerb As IUnknown /*IEnumOLEVERB*/) As HRESULT
 	Function Update() As HRESULT
 	Function IsUpToDate() As HRESULT
@@ -75,5 +180,5 @@
 		/* [out] */ ByRef sizel As SIZEL) As HRESULT
 	Function Advise(
-		/* [unique][in] */ pAdvSink As *IAdviseSink,
+		/* [unique][in] */ AdvSink As IAdviseSink,
 		/* [out] */ ByRef dwConnection As DWord) As HRESULT
 	Function Unadvise(
@@ -87,2 +192,129 @@
 		/* [in] */ ByRef Logpal As LOGPALETTE) As HRESULT
 End Interface
+
+/* interface IOleWindow */
+/* [unique][uuid][object] */
+
+Dim IID_IOleWindow = [&h00000114, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IOleWindow
+	Inherits IUnknown
+
+	/* [input_sync] */ Function GetWindow(
+		/* [out] */ ByRef hwnd As HWND) As HRESULT
+	Function ContextSensitiveHelp(
+		/* [in] */ fEnterMode As BOOL) As HRESULT
+End Interface
+
+'IOleLink
+'IOleItemContainer
+'IOleInPlaceUIWindow
+'IOleInPlaceActiveObject
+Interface IOleInPlaceActiveObject
+	Inherits IOleWindow
+End Interface
+
+'IOleInPlaceFrame
+Interface IOleInPlaceFrame
+	Inherits IOleWindow
+End Interface
+
+'IOleInPlaceObject
+'IOleInPlaceSite
+'IContinue
+'IViewObject
+'IViewObject2
+
+/* interface IDropSource */
+/* [uuid][object][local] */
+
+Dim IID_IDropSource = [&h00000121, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+
+Interface IDropSource
+	Inherits IUnknown
+
+	Function QueryContinueDrag(
+		fEscapePressed As DWord,
+		grfKeyState As DWord) As HRESULT
+	Function GiveFeedback(
+		dwEffect As DWord) As HRESULT
+End Interface
+
+/* interface IDropTarget */
+/* [unique][uuid][object] */
+
+Const MK_ALT = &h20
+
+Const DROPEFFECT_NONE = 0
+Const DROPEFFECT_COPY = 1
+Const DROPEFFECT_MOVE = 2
+Const DROPEFFECT_LINK = 4
+Const DROPEFFECT_SCROLL = &h80000000
+
+Const DD_DEFSCROLLINSET = 11
+Const DD_DEFSCROLLDELAY = 50
+Const DD_DEFSCROLLINTERVAL = 50
+Const DD_DEFDRAGDELAY = 200
+Const DD_DEFDRAGMINDIST = 2
+
+Dim IID_IDropTarget = [&h00000122, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IDropTarget
+	Inherits IUnknown
+
+	Function DragEnter(
+		/* [unique][in] */ DataObj As IDataObject,
+		/* [in] */ grfKeyState As DWord,
+		/* [in] */ x As Long, y As Long,
+		/* [out][in] */ ByRef effect As DWord) As HRESULT
+	Function DragOver(
+		/* [in] */ grfKeyState As DWord,
+		/* [in] */ x As Long, y As Long,
+		/* [out][in] */ ByRef effect As DWord) As HRESULT
+	Function DragLeave() As HRESULT
+	Function Drop(
+		/* [unique][in] */ DataObj As IDataObject,
+		/* [in] */ grfKeyState As DWord,
+		/* [in] */ x As Long, y As Long,
+		/* [out][in] */ ByRef effect As DWord) As HRESULT
+End Interface
+
+/* interface IDropSourceNotify */
+/* [unique][uuid][object][local] */
+
+Dim IID_IDropSourceNotify = [&h0000012B, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IDropSourceNotify
+	Inherits IUnknown
+
+	Function DragEnterTarget(
+		/* [in] */ hwndTarget As HWND) As HRESULT
+	Function DragLeaveTarget() As HRESULT
+End Interface
+
+/* interface IEnumOLEVERB */
+/* [unique][uuid][object] */
+
+Type OLEVERB
+	lVerb As Long
+	lpszVerbName As LPOLESTR
+	fuFlags As DWord
+	grfAttribs As DWord
+End Type
+
+/* [v1_enum] */ Const Enum OLEVERBATTRIB
+	OLEVERBATTRIB_NEVERDIRTIES = 1
+	OLEVERBATTRIB_ONCONTAINERMENU = 2
+End Enum
+
+Dim IID_IEnumOLEVERB = [&h00000104, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
+Interface IEnumOLEVERB
+	Inherits IUnknown
+
+	/* [local] */ Function Next_(
+		/* [in] */ celt As DWord,
+		/* [length_is][size_is][out] */ rgelt As *OLEVERB,
+		/* [out] */ ByRef celtFetched As DWord) As HRESULT
+	Function Skip(
+		/* [in] */ celt As DWord) As HRESULT
+	Function Reset() As HRESULT
+	Function Clone(
+		/* [out] */ ByRef enumOleVerb As IEnumOLEVERB) As HRESULT
+End Interface
Index: trunk/Include/system/string.sbp
===================================================================
--- trunk/Include/system/string.sbp	(revision 302)
+++ trunk/Include/system/string.sbp	(revision 303)
@@ -5,10 +5,15 @@
 #define _INC_BASIC_STRING
 
+#require <Classes/System/String.ab>
+#require <Classes/System/Text/StringBuilder.ab>
+
 Function StrPtr(s As String) As *StrChar
 	StrPtr = s.StrPtr
 End Function
-
-Function ZeroString(length As Long) As String
-	Return New String(0 As StrChar, length)
+'StringBuilder版はClasses/System/Text/StringBuilder.abに定義されている
+
+Function ZeroString(length As Long) As System.Text.StringBuilder
+	ZeroString = New System.Text.StringBuilder
+	ZeroString.Length = length
 End Function
 
Index: trunk/Include/windows.sbp
===================================================================
--- trunk/Include/windows.sbp	(revision 302)
+++ trunk/Include/windows.sbp	(revision 303)
@@ -20,8 +20,6 @@
 #require <api_system.sbp>
 #require <api_window.sbp>
-#require <api_commdlg.sbp>
 #require <api_gdi.sbp>
 #require <api_shell.sbp>
-#require <api_reg.sbp>
 #require <api_msg.sbp>
 #require <api_windowstyles.sbp>
@@ -29,4 +27,19 @@
 #require <api_console.sbp>
 #require <winver.ab>
+#require <api_reg.sbp>
+
+#ifndef WIN32_LEAN_AND_MEAN
+#require <api_mmsys.sbp>
+#require <ole2.ab>
+#require <api_commdlg.sbp>
+#endif
+
+#ifdef INC_OLE2
+#require <ole2.ab>
+#endif
+
+#ifndef NOIME
+#require <api_imm.sbp>
+#endif
 
 #endif '_INC_WINDOWS
Index: trunk/Include/wtypes.ab
===================================================================
--- trunk/Include/wtypes.ab	(revision 302)
+++ trunk/Include/wtypes.ab	(revision 303)
@@ -451,6 +451,6 @@
 
 TypeDef wireBSTR = /* [unique] */ *FLAGGED_WORD_BLOB
-TypeDef BSTR = /* [wire_marshal] */ OLECHAR
-TypeDef LPBSTR = BSTR
+TypeDef BSTR = /* [wire_marshal] */ *OLECHAR
+TypeDef LPBSTR = *BSTR
 
 TypeDef VARIANT_BOOL = Integer
