Index: trunk/Include/Classes/System/Windows/Forms/Application.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/Application.ab	(revision 458)
+++ trunk/Include/Classes/System/Windows/Forms/Application.ab	(revision 461)
@@ -31,4 +31,22 @@
 		PostQuitMessage(0)
 	End Sub
+
+	/*!
+	@brief	現在のスレッドで標準のアプリケーション メッセージ ループの実行を開始し、
+			指定したフォームを表示します。
+	*/
+	Static Sub Run( form As Form )
+
+		' フォームを表示する
+		form.Show()
+
+		Dim msgMain As MSG, iResult As Long
+		Do
+			iResult=GetMessage(msgMain,0,0,0)
+			If iResult=0 or iResult=-1 Then Exit Do
+			TranslateMessage(msgMain)
+			DispatchMessage(msgMain)
+		Loop
+	End Sub
 End Class
 	
Index: trunk/Include/Classes/System/Windows/Forms/ContainerControl.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/ContainerControl.ab	(revision 461)
+++ trunk/Include/Classes/System/Windows/Forms/ContainerControl.ab	(revision 461)
@@ -0,0 +1,13 @@
+Namespace System
+Namespace Windows
+Namespace Forms
+
+
+Class ContainerControl
+	Inherits ScrollableControl
+End Class
+
+
+End Namespace
+End Namespace
+End Namespace
Index: trunk/Include/Classes/System/Windows/Forms/Control.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/Control.ab	(revision 458)
+++ trunk/Include/Classes/System/Windows/Forms/Control.ab	(revision 461)
@@ -1,25 +1,4 @@
 ' Classes/System/Windows/Forms/Control.ab
 
-#ifndef __SYSTEM_WINDOWS_FORMS_CONTROL_AB__
-#define __SYSTEM_WINDOWS_FORMS_CONTROL_AB__
-
-/*
-#require <Classes/System/Windows/Forms/misc.ab>
-#require <Classes/System/Windows/Forms/CreateParams.ab>
-#require <Classes/System/Windows/Forms/Message.ab>
-#require <Classes/System/Windows/Forms/PaintEventArgs.ab>
-#require <Classes/System/misc.ab>
-#require <Classes/System/Math.ab>
-#require <Classes/System/Threading/WaitHandle.ab>
-*/
-#require <Classes/System/Drawing/Color.ab>
-#require <Classes/System/Drawing/Point.ab>
-#require <Classes/System/Drawing/Size.ab>
-#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>
-*/
 Namespace System
 Namespace Windows
@@ -77,6 +56,5 @@
 
 Class Control
-
-'	Inherits IWin32Window
+	Implements IWin32Window
 Public
 	'---------------------------------------------------------------------------
@@ -100,5 +78,5 @@
 	'CheckForIllegalCrossThreadCalls
 
-	/*Override*/ Function Handle() As HWND
+	Override Function Handle() As HWND
 		Return wnd.HWnd
 	End Function
@@ -301,6 +279,26 @@
 
 	Sub init(parent As Control, text As String, left As Long, top As Long, width As Long, height As Long)
+		This.text = text
 		This.parent = parent
-'		CreateControl()
+
+		Dim rgb = GetSysColor( COLOR_HIGHLIGHT )
+		This.bkColor = New Color( GetRValue(rgb) As Byte, GetGValue(rgb) As Byte, GetBValue(rgb) As Byte )
+
+		Dim hParentWnd = NULL As HWND
+		If Not ActiveBasic.IsNothing( parent ) Then
+			hParentWnd = parent.Handle
+		End If
+
+		createParams = New CreateParams()
+		With createParams
+			.Caption = text
+			.X = left
+			.Y = top
+			.Width = width
+			.Height = height
+			.Parent = hParentWnd
+		End With
+
+		CreateControl()
 	End Sub
 	
@@ -358,6 +356,9 @@
 		If IsWindow(hwnd) Then
 			If GetClassLongPtr(hwnd, GCW_ATOM) = atom Then
-				Dim gch = System.Runtime.InteropServices.GCHandle.FromIntPtr(GetWindowLongPtr(hwnd, GWLP_THIS))
-				Return gch.Target As Control
+				Dim lpValue = GetWindowLongPtr(hwnd, GWLP_THIS)
+				If lpValue Then
+					Dim gch = System.Runtime.InteropServices.GCHandle.FromIntPtr( lpValue )
+					Return gch.Target As Control
+				End If
 			End If
 		End If
@@ -370,5 +371,5 @@
 
 	Override Function ToString() As String
-		Return text
+		Return Super.ToString + ", Text: " + This.Text
 	End Function
 
@@ -383,5 +384,4 @@
 
 	Sub Show()
-		Debug
 		wnd.Show(SW_SHOW)
 	End Sub
@@ -418,5 +418,4 @@
 	' Protected Methods
 	Virtual Sub CreateHandle()
-		Debug
 		If Not Object.ReferenceEquals(wnd, Nothing) Then
 			If wnd.HWnd <> 0 Then
@@ -424,29 +423,42 @@
 			End If
 		End If
-		
-		Dim createParams = CreateParams()
+
 		Dim gch = System.Runtime.InteropServices.GCHandle.Alloc(This)
 		TlsSetValue(tlsIndex, System.Runtime.InteropServices.GCHandle.ToIntPtr(gch) As VoidPtr)
-		With createParams
-			Dim pText As PCTSTR
-			If String.IsNullOrEmpty(text) Then
-				pText = "" As PCTSTR
-			Else
-				pText = ToTCStr(text)
-			End If
-
-			If CreateWindowEx(.ExStyle, atom As ULONG_PTR As PCSTR, pText, .Style, _
-				.X, .Y, .Width, .Height, _
-				.Parent, 0, hInstance, 0) = 0 Then
-				' Error
-				Dim buf[1023] As TCHAR
-				wsprintf(buf, ToTCStr(Ex"Control: CreateWindowEx failed. Error code: &h%08X\r\n"), GetLastError())
-				OutputDebugString(buf)
-
-				gch.Free()
+
+		Dim pText As PCTSTR
+		If String.IsNullOrEmpty(text) Then
+			pText = "" As PCTSTR
+		Else
+			pText = ToTCStr(text)
+		End If
+
+		Dim result As HANDLE
+		With This.CreateParams
+			result = CreateWindowEx(
+				.ExStyle,						' 拡張ウィンドウ スタイル
+				atom As ULONG_PTR As PCSTR,		' クラス名
+				pText,							' キャプション
+				.Style,							' ウィンドウ スタイル
+				.X,								' X座標
+				.Y,								' Y座標
+				.Width,							' 幅
+				.Height,						' 高さ
+				.Parent,						' 親ウィンドウ ハンドル
+				0,								' メニュー ハンドル
+				hInstance,						' アプリケーション インスタンス ハンドル
+				0)								' ウィンドウ作成データ
+		End With
+
+		If result = NULL Then
+			' Error
+			Dim buf[1023] As TCHAR
+			wsprintf(buf, ToTCStr(Ex"Control: CreateWindowEx failed. Error code: &h%08X\r\n"), GetLastError())
+			OutputDebugString(buf)
+
+			gch.Free()
 '				Debug
-				ExitThread(0)
-			End If
-		End With
+			ExitThread(0)
+		End If
 		
 	End Sub
@@ -549,9 +561,8 @@
 	' Member variables
 	wnd As ActiveBasic.Windows.WindowHandle
+	createParams As CreateParams
 	text As String
 	parent As Control
 	bkColor As Color
-
-	Static createParams As CreateParams
 
 	'ウィンドウ作成時にウィンドウプロシージャへThisを伝えるためのもの
@@ -593,15 +604,4 @@
 			ExitThread(0)
 		End If
-
-		With createParams
-			' 値は暫定的なもの
-			.Style = WS_OVERLAPPEDWINDOW
-			.ExStyle = WS_EX_APPWINDOW
-			.Caption = String.Empty
-			.X = 0
-			.Y = 0
-			.Width = 0
-			.Height = 0
-		End With
 	End Sub
 
@@ -672,5 +672,2 @@
 End Namespace 'Widnows
 End Namespace 'System
-
-#endif '__SYSTEM_WINDOWS_FORMS_CONTROL_AB__
-
Index: trunk/Include/Classes/System/Windows/Forms/CreateParams.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/CreateParams.ab	(revision 458)
+++ trunk/Include/Classes/System/Windows/Forms/CreateParams.ab	(revision 461)
@@ -1,6 +1,2 @@
-' Classes/System/Windows/Forms/CreateParams.ab
-
-#ifndef __SYSTEM_WINDOWS_FORMS_CREATEPARAMS_AB__
-#define __SYSTEM_WINDOWS_FORMS_CREATEPARAMS_AB__
 
 Namespace System
@@ -26,4 +22,2 @@
 End Namespace 'Widnows
 End Namespace 'System
-
-#endif '__SYSTEM_WINDOWS_FORMS_CREATEPARAMS_AB__
Index: trunk/Include/Classes/System/Windows/Forms/Form.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/Form.ab	(revision 461)
+++ trunk/Include/Classes/System/Windows/Forms/Form.ab	(revision 461)
@@ -0,0 +1,64 @@
+Namespace System
+Namespace Windows
+Namespace Forms
+
+
+Enum DialogResult
+	None	= NULL		'ダイアログ ボックスから Nothing が返されます。つまり、モーダル ダイアログ ボックスの実行が継続します。 
+	Abort	= IDABORT	'ダイアログ ボックスの戻り値は Abort です (通常は "中止" というラベルが指定されたボタンから送られます)。 
+	Cancel	= IDCANCEL	'ダイアログ ボックスの戻り値は Cancel です (通常は "キャンセル" というラベルが指定されたボタンから送られます)。 
+	Ignore	= IDIGNORE	'ダイアログ ボックスの戻り値は Ignore です (通常は "無視" というラベルが指定されたボタンから送られます)。 
+	No		= IDNO		'ダイアログ ボックスの戻り値は No です (通常は "いいえ" というラベルが指定されたボタンから送られます)。 
+	OK		= IDOK		'ダイアログ ボックスの戻り値は OK です (通常は "OK" というラベルが指定されたボタンから送られます)。 
+	Retry	= IDRETRY	'ダイアログ ボックスの戻り値は Retry です (通常は "再試行" というラベルが指定されたボタンから送られます)。 
+	Yes		= IDYES		'ダイアログ ボックスの戻り値は Yes です (通常は "はい" というラベルが指定されたボタンから送られます)。 
+End Enum
+
+Class Form
+	Inherits ContainerControl
+Public
+
+	Sub Form()
+		With createParams
+			.Style		or= WS_OVERLAPPEDWINDOW or WS_VISIBLE or WS_CLIPSIBLINGS or WS_CLIPCHILDREN
+			.ExStyle	or= WS_EX_WINDOWEDGE or WS_EX_CONTROLPARENT or WS_EX_APPWINDOW
+			.Width		= 300
+			.Height		= 300
+		End With
+	End Sub
+
+	Function ShowDialog() As DialogResult
+		Dim isParentEnable = False
+		If Not ActiveBasic.IsNothing( This.Parent ) Then
+			' 親コントロールを無効にする
+			isParentEnable = This.Parent.Enabled
+			This.Parent.Enabled = False
+		End If
+
+		This.Show()
+
+		' メッセージループ
+		Dim msg As MSG, iResult As Long
+		Do
+			iResult=GetMessage(msg,0,0,0)
+			If iResult=0 or iResult=-1 Then Exit Do
+			If IsDialogMessage(This.Handle,msg) Then Continue
+			TranslateMessage(msg)
+			DispatchMessage(msg)
+		Loop
+
+		If Not ActiveBasic.IsNothing( This.Parent ) Then
+			' もともと親コントロールが有効だった場合には有効に戻す
+			If isParentEnable Then
+				This.Parent.Enabled = True
+			End If
+		End If
+
+		Return msg.wParam As DialogResult
+	End Function
+End Class
+
+
+End Namespace
+End Namespace
+End Namespace
Index: trunk/Include/Classes/System/Windows/Forms/ScrollableControl.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/ScrollableControl.ab	(revision 461)
+++ trunk/Include/Classes/System/Windows/Forms/ScrollableControl.ab	(revision 461)
@@ -0,0 +1,13 @@
+Namespace System
+Namespace Windows
+Namespace Forms
+
+
+Class ScrollableControl
+	Inherits Control
+End Class
+
+
+End Namespace
+End Namespace
+End Namespace
Index: trunk/Include/Classes/System/Windows/Forms/WebBrowser.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/WebBrowser.ab	(revision 461)
+++ trunk/Include/Classes/System/Windows/Forms/WebBrowser.ab	(revision 461)
@@ -0,0 +1,13 @@
+Namespace System
+Namespace Windows
+Namespace Forms
+
+
+Class WebBrowser
+	Inherits WebBrowserBase
+End Class
+
+
+End Namespace
+End Namespace
+End Namespace
Index: trunk/Include/Classes/System/Windows/Forms/WebBrowserBase.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/WebBrowserBase.ab	(revision 461)
+++ trunk/Include/Classes/System/Windows/Forms/WebBrowserBase.ab	(revision 461)
@@ -0,0 +1,14 @@
+Namespace System
+Namespace Windows
+Namespace Forms
+
+
+Class WebBrowserBase
+	Inherits Control
+Public
+End Class
+
+
+End Namespace
+End Namespace
+End Namespace
Index: trunk/Include/Classes/System/Windows/Forms/misc.ab
===================================================================
--- trunk/Include/Classes/System/Windows/Forms/misc.ab	(revision 458)
+++ trunk/Include/Classes/System/Windows/Forms/misc.ab	(revision 461)
@@ -222,5 +222,4 @@
 */
 
-TypeDef DialogResult = DWord
 TypeDef MouseButtons = DWord
 
Index: trunk/Include/Classes/index.ab
===================================================================
--- trunk/Include/Classes/index.ab	(revision 458)
+++ trunk/Include/Classes/index.ab	(revision 461)
@@ -38,23 +38,21 @@
 #require "./System/Diagnostics/TraceListener.ab"
 #require "./System/Diagnostics/TraceListenerCollection.ab"
-/*
-#require "./System/Drawing/CharacterRange.ab"
+'#require "./System/Drawing/CharacterRange.ab"
 #require "./System/Drawing/Color.ab"
-#require "./System/Drawing/Font.ab"
-#require "./System/Drawing/Graphics.ab"
-#require "./System/Drawing/Image.ab"
-#require "./System/Drawing/misc.ab"
+'#require "./System/Drawing/Font.ab"
+'#require "./System/Drawing/Graphics.ab"
+'#require "./System/Drawing/Image.ab"
+'#require "./System/Drawing/misc.ab"
 #require "./System/Drawing/Point.ab"
-#require "./System/Drawing/PointF.ab"
+'#require "./System/Drawing/PointF.ab"
 #require "./System/Drawing/Rectangle.ab"
-#require "./System/Drawing/RectangleF.ab"
+'#require "./System/Drawing/RectangleF.ab"
 #require "./System/Drawing/Size.ab"
-#require "./System/Drawing/SizeF.ab"
-#require "./System/Drawing/Drawing2D/Matrix.ab"
-#require "./System/Drawing/Drawing2D/misc.ab"
-#require "./System/Drawing/Imaging/MetafileHeader.ab"
-#require "./System/Drawing/Imaging/misc.ab"
-#require "./System/Drawing/Text/misc.ab"
-*/
+'#require "./System/Drawing/SizeF.ab"
+'#require "./System/Drawing/Drawing2D/Matrix.ab"
+'#require "./System/Drawing/Drawing2D/misc.ab"
+'#require "./System/Drawing/Imaging/MetafileHeader.ab"
+'#require "./System/Drawing/Imaging/misc.ab"
+'#require "./System/Drawing/Text/misc.ab"
 #require "./System/IO/Directory.ab"
 #require "./System/IO/DirectoryInfo.ab"
@@ -92,10 +90,15 @@
 #require "./System/Threading/WaitHandle.ab"
 #require "./System/Windows/Forms/Application.ab"
+#require "./System/Windows/Forms/ContainerControl.ab"
 #require "./System/Windows/Forms/Control.ab"
 #require "./System/Windows/Forms/CreateParams.ab"
+#require "./System/Windows/Forms/Form.ab"
 #require "./System/Windows/Forms/Message.ab"
 #require "./System/Windows/Forms/MessageBox.ab"
 #require "./System/Windows/Forms/misc.ab"
 #require "./System/Windows/Forms/PaintEventArgs.ab"
+#require "./System/Windows/Forms/ScrollableControl.ab"
+#require "./System/Windows/Forms/WebBrowser.ab"
+#require "./System/Windows/Forms/WebBrowserBase.ab"
 #require "./System/Xml/XmlAttribute.ab"
 #require "./System/Xml/XmlCharacterData.ab"
