Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab	(revision 679)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab	(revision 698)
@@ -57,4 +57,16 @@
 	End Function
 
+	Function AddRef() As DWord
+		AddRef = comImpl.AddRef()
+	End Function
+
+	Function Release() As DWord
+		Release = comImpl.Release()
+	End Function
+
+	Function QueryInterface(ByRef riid As IID, ByRef pv As Any) As HRESULT
+		QueryInterface = comImpl.QueryInterface(riid, pv)
+	End Function
+
 Private
 	Static Function FromHWndCore(hwnd As HWND) As Control
@@ -70,4 +82,6 @@
 	@date 2008/08/02
 	通常はCreateやCreateFormその他を使ってください。
+	ここで渡された引数は、GetCreateStructへ渡して修正の機会を与えた後に、
+	CreateWindowExへ渡される。
 	*/
 	Sub CreateEx(parent As Control, style As DWord, exStyle As DWord, hmenu As HMENU)
@@ -115,7 +129,13 @@
 
 Protected
+	/*!
+	@brief ウィンドウ作成前の初期設定確認
+	派生クラスでオーバーライドして、csを書き換えてよい。
+	書き換えられたcsを基にCreateWindowExが呼ばれる。
+	*/
 	Virtual Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
 	End Sub
 
+Private
 	Sub createImpl(ByRef cs As CREATESTRUCT, parent As Control)
 		throwIfAlreadyCreated()
@@ -153,4 +173,5 @@
 	End Sub
 */
+
 	Sub BeginSubclass()
 		throwIfNotCreated()
@@ -207,6 +228,5 @@
 Private
 	Static Function makeKeysFormMsg(e As MessageArgs) As Keys
-		Dim t As DWord
-		t = e.WParam And Keys.KeyCode
+		Dim t = (e.WParam As DWord) And Keys.KeyCode
 		t Or= (GetKeyState(VK_SHIFT) As Word And &h8000) << 1
 		t Or= (GetKeyState(VK_CONTROL) As Word And &h8000) << 2
@@ -354,5 +374,14 @@
 
 	Sub OnCreateBase(sender As Object, e As MessageArgs)
-		e.Handled = e.Handled And OnCreate(New CreateArgs(e.LParam As *CREATESTRUCT))
+		Dim c = New CreateArgs(e.LParam As *CREATESTRUCT)
+		If e.LResult = -1 Then
+			c.Cancel = True
+		End If
+		e.Handled = e.Handled And OnCreate(c)
+		If c.Cancel Then
+			e.LResult = -1
+		Else
+			e.LResult = 0
+		End If
 	End Sub
 
@@ -579,5 +608,5 @@
 			.hIcon = 0
 			.hCursor = LoadImage(0, MAKEINTRESOURCE(IDC_ARROW), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE Or LR_SHARED) As HCURSOR
-			.hbrBackground = 0
+			.hbrBackground = (COLOR_3DFACE + 1) As HBRUSH
 			.lpszMenuName = 0
 			.lpszClassName = ToTCStr(WindowClassName)
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab	(revision 679)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab	(revision 698)
@@ -128,5 +128,6 @@
 		This.button = button
 		This.clicks = clicks
-		This.pt = New System.Drawing.Point(x, y)
+		This.pt.X = x
+		This.pt.Y = y
 		This.delta = delta
 	End Sub
@@ -145,5 +146,5 @@
 
 	Const Function Locale() As System.Drawing.Point
-		Locale = New System.Drawing.Point(pt.X, pt.Y)
+		Locale = pt
 	End Function
 
@@ -495,6 +496,15 @@
 		CreateStruct = pcs
 	End Function
+
+	Const Function Cancel() As Boolean
+		Cancel = cancel
+	End Function
+
+	Sub Cancel(c As Boolean)
+		cancel = c
+	End Sub
 Private
 	pcs As *CREATESTRUCT
+	cancel As Boolean
 End Class
 
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab	(revision 679)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab	(revision 698)
@@ -19,5 +19,4 @@
 	Sub Form()
 		AddMessageEvent(WM_COMMAND, AddressOf(OnCommand))
-		AddPaintBackground(AddressOf(OnPaintBackground))
 	End Sub
 
@@ -31,9 +30,4 @@
 			.cy = CW_USEDEFAULT
 		End With
-	End Sub
-
-	Sub OnPaintBackground(sender As Object, e As PaintBackgroundArgs)
-		Dim rc = ClientRect
-		FillRect(e.Handle, rc, (COLOR_3DFACE + 1) As HBRUSH)
 	End Sub
 
