Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Application.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Application.ab	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Application.ab	(revision 551)
@@ -58,5 +58,5 @@
 
 Private
-	Static Sub OnMainFormClosed(sender As Object, e As EventArgs)
+	Static Sub OnMainFormClosed(sender As Object, e As Args)
 		ExitThread()
 	End Sub
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ApplicationEvent.sbp
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ApplicationEvent.sbp	(revision 551)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ApplicationEvent.sbp	(revision 551)
@@ -0,0 +1,22 @@
+Public
+	Sub AddThreadExit(h As Handler)
+		If IsNothing(threadExit) Then
+			threadExit = h
+		Else
+			threadExit += h
+		End If
+	End Sub
+	Sub RemoveThreadExit(h As Handler)
+		If Not IsNothing(threadExit) Then
+			threadExit -= h
+		End If
+	End Sub
+Protected
+	Sub OnThreadExit(e As Args)
+		If Not IsNothing(threadExit) Then
+			threadExit(This, e)
+		End If
+	End Sub
+Private
+	threadExit As Handler
+
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ApplicationEventList.txt
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ApplicationEventList.txt	(revision 551)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ApplicationEventList.txt	(revision 551)
@@ -0,0 +1,1 @@
+ThreadExit		スレッドが終了するときに呼ばれます。
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab	(revision 551)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab	(revision 551)
@@ -0,0 +1,37 @@
+'Classes/ActiveBasic/Windows/UI/Button.ab
+
+#require <Classes/ActiveBasic/Windows/UI/Control.ab>
+
+Namespace ActiveBasic
+Namespace Windows
+Namespace UI
+
+/*!
+@date 2008/07/13
+@brief	ボタンを表すクラス。
+@author Egtra
+*/
+Class Button
+	Inherits Control
+Protected
+	Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
+		With cs
+			.lpszClass = "BUTTON"
+			.style Or= BS_PUSHBUTTON
+			.x = 0
+			.y = 0
+			.cx = 0
+			.cy = 0
+		End With
+	End Sub
+Public
+	Sub RaiseClick()
+		OutputDebugString(Ex"RaiseClick\r\n")
+		OnClick(Args.Empty)
+	End Sub
+
+End Class
+
+End Namespace 'UI
+End Namespace 'Widnows
+End Namespace 'ActiveBasic
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab	(revision 551)
@@ -14,4 +14,9 @@
 	Inherits WindowHandle
 Public
+	/*!
+	@brief Destroyイベントよりも後に呼ばれるDestroyイベントデリゲート
+	@date	2008/07/16
+	*/
+	finalDestroy As ActiveBasic.Windows.UI.Handler
 
 	Sub Control()
@@ -34,11 +39,9 @@
 Private
 	Static Function FromHWndCore(hwnd As HWND) As Control
-		If _System_GetClassLongPtr(hwnd, GCW_ATOM) = atom Then
-			Dim gchValue = GetProp(hwnd, PropertyInstance As ULONG_PTR As PCTSTR) As ULONG_PTR
-			If gchValue <> 0 Then
-				Dim gch = System.Runtime.InteropServices.GCHandle.FromIntPtr(gchValue)
-				FromHWndCore = gch.Target As Control
-				Exit Function
-			End If
+		Dim gchValue = GetProp(hwnd, PropertyInstance As ULONG_PTR As PCTSTR) As ULONG_PTR
+		If gchValue <> 0 Then
+			Dim gch = System.Runtime.InteropServices.GCHandle.FromIntPtr(gchValue)
+			FromHWndCore = gch.Target As Control
+			Exit Function
 		End If
 	End Function
@@ -55,16 +58,35 @@
 
 Public
-	Sub Create()
+	Sub Create(parent = Nothing As Control, style = 0 As DWord, exStyle = 0 As DWord, hmenu = 0 As HMENU)
 		Dim cs As CREATESTRUCT
-		cs.hInstance = hInstance
-		cs.lpszClass = (atom As ULONG_PTR) As LPCTSTR
+		With cs
+			.dwExStyle = exStyle
+			.lpszClass = (atom As ULONG_PTR) As LPCTSTR
+			.lpszName = 0
+			.style = style Or WS_CHILD Or WS_VISIBLE
+			.x = CW_USEDEFAULT
+			.y = CW_USEDEFAULT
+			.cx = CW_USEDEFAULT
+			.cy = CW_USEDEFAULT
+			If IsNothing(parent) Then
+				.hwndParent = 0
+			Else
+				.hwndParent = parent As HWND
+				.style Or= WS_CHILD
+			End If
+			.hMenu = hmenu
+			.hInstance = hInstance
+		End With
 		GetCreateStruct(cs)
-		createImpl(cs)
-	End Sub
-
+		createImpl(cs, parent)
+	End Sub
+
+	Sub Create(parent As Control, style As DWord, exStyle As DWord, id As Long)
+		Create(parent, style, exStyle, id As HMENU)
+	End Sub
 Protected
 	Abstract Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
 
-	Sub createImpl(ByRef cs As CREATESTRUCT)
+	Sub createImpl(ByRef cs As CREATESTRUCT, parent As Control)
 		Imports System.Runtime.InteropServices
 
@@ -75,10 +97,20 @@
 
 		With cs
-			Dim hwnd = CreateWindowEx(.dwExStyle, .lpszClass, .lpszName, .style,
+			'よそのクラスの場合、WndProcFirst内のhwndの代入が行われないため、ここでも行っておく。
+			hwnd = CreateWindowEx(.dwExStyle, .lpszClass, .lpszName, .style,
 				.x, .y, .cx, .cy, .hwndParent, .hMenu, .hInstance, .lpCreateParams)
 			If hwnd = 0 Then
 				ActiveBasic.Windows.ThrowByWindowsError(GetLastError())
 			End If
+			
+			If IsNothing(FromHWndCore(hwnd)) <> False Then
+				AssociateHWnd(gch, hwnd)
+				TlsSetValue(tlsIndex, 0)
+			End If
 		End With
+
+		If IsNothing(parent) = False Then
+			RegisterUnassociateHWnd(parent)
+		End If
 	End Sub
 
@@ -88,9 +120,9 @@
 Public
 	Virtual Function WndProc(msg As DWord, wp As WPARAM, lp As LPARAM) As LRESULT
-		Dim h = Nothing As MessageEventHandler
+		Dim h = Nothing As MessageHandler
 		Dim b = messageMap.TryGetValue(Hex$(msg), h)
 		If b Then
 			If Not IsNothing(h) Then
-				Dim a = New MessageEventArgs(hwnd, msg, wp, lp)
+				Dim a = New MessageArgs(hwnd, msg, wp, lp)
 				h(This, a)
 				WndProc = a.LResult
@@ -106,5 +138,5 @@
 
 Private
-	Static Function makeKeysFormMsg(e As MessageEventArgs) As Keys
+	Static Function makeKeysFormMsg(e As MessageArgs) As Keys
 		Dim t As DWord
 		t = e.WParam And Keys.KeyCode
@@ -115,8 +147,8 @@
 	End Function
 
-	Static Function makeMouseEventFromMsg(e As MessageEventArgs) As MouseEventArgs
+	Static Function makeMouseEventFromMsg(e As MessageArgs) As MouseArgs
 		Dim wp = e.WParam
 		Dim lp = e.LParam
-		makeMouseEventFromMsg = New MouseEventArgs(LOWORD(wp) As MouseButtons, 1, GET_X_LPARAM(lp), GET_Y_LPARAM(lp), 0)
+		makeMouseEventFromMsg = New MouseArgs(LOWORD(wp) As MouseButtons, 1, GET_X_LPARAM(lp), GET_Y_LPARAM(lp), 0)
 	End Function
 
@@ -128,15 +160,15 @@
 	Sub StartWndProc()
 		AddMessageEvent(WM_ERASEBKGND, AddressOf(OnEraseBackground))
-		Dim md = New MessageEventHandler(AddressOf(OnMouseDownBase))
+		Dim md = New MessageHandler(AddressOf(OnMouseDownBase))
 		AddMessageEvent(WM_LBUTTONDOWN, md)
 		AddMessageEvent(WM_RBUTTONDOWN, md)
 		AddMessageEvent(WM_MBUTTONDOWN, md)
 		AddMessageEvent(WM_XBUTTONDOWN, md)
-		Dim mu = New MessageEventHandler(AddressOf(OnMouseUpBase))
+		Dim mu = New MessageHandler(AddressOf(OnMouseUpBase))
 		AddMessageEvent(WM_LBUTTONUP, mu)
 		AddMessageEvent(WM_RBUTTONUP, mu)
 		AddMessageEvent(WM_MBUTTONUP, mu)
 		AddMessageEvent(WM_XBUTTONUP, mu)
-		Dim mb = New MessageEventHandler(AddressOf(OnMouseDblClkBase))
+		Dim mb = New MessageHandler(AddressOf(OnMouseDblClkBase))
 		AddMessageEvent(WM_LBUTTONDBLCLK, mu)
 		AddMessageEvent(WM_RBUTTONDBLCLK, mu)
@@ -148,9 +180,9 @@
 		AddMessageEvent(WM_PAINT, AddressOf(OnPaintBase))
 		AddMessageEvent(WM_KEYDOWN, AddressOf(OnKeyDownBase))
-'		AddMessageEvent(WM_CHAR, AddressOf(OnChar))	
+		AddMessageEvent(WM_CHAR, AddressOf(OnChar))	
 		AddMessageEvent(WM_CREATE, AddressOf(OnCreateBase))
 	End Sub
 
-	Sub OnEraseBackground(sender As Object, e As MessageEventArgs)
+	Sub OnEraseBackground(sender As Object, e As MessageArgs)
 		Dim rc = ClientRect
 		FillRect(e.WParam As HDC, rc, (COLOR_3DFACE + 1) As HBRUSH)
@@ -158,12 +190,12 @@
 	End Sub
 
-	Sub OnMouseDownBase(sender As Object, e As MessageEventArgs)
+	Sub OnMouseDownBase(sender As Object, e As MessageArgs)
 		OnMouseDown(makeMouseEventFromMsg(e))
 	End Sub
 
-	Sub OnMouseUpBase(sender As Object, e As MessageEventArgs)
+	Sub OnMouseUpBase(sender As Object, e As MessageArgs)
 		Dim me = makeMouseEventFromMsg(e)
 		If doubleClickFired = False Then
-'			OnClick(System.EventArgs.Empty)
+'			OnClick(System.Args.Empty)
 			OnMouseClick(me)
 			doubleClickFired = False
@@ -172,13 +204,13 @@
 	End Sub
 
-	Sub OnMouseDblClkBase(sender As Object, e As MessageEventArgs)
+	Sub OnMouseDblClkBase(sender As Object, e As MessageArgs)
 		Dim me = makeMouseEventFromMsg(e)
 		doubleClickFired = True
 		OnMouseDown(me)
-'		OnDoubleClick(System.EventArgs.Empty)
+'		OnDoubleClick(System.Args.Empty)
 		OnMouseDoubleClick(me)
 	End Sub
 
-	Sub OnMouseMoveBase(sender As Object, e As MessageEventArgs)
+	Sub OnMouseMoveBase(sender As Object, e As MessageArgs)
 		Dim me = makeMouseEventFromMsg(e)
 		If mouseEntered Then
@@ -190,5 +222,5 @@
 	End Sub
 
-	Sub OnMouseLeaveBase(sender As Object, e As MessageEventArgs)
+	Sub OnMouseLeaveBase(sender As Object, e As MessageArgs)
 		Dim me = makeMouseEventFromMsg(e)
 		OnMouseLeave(me)
@@ -196,9 +228,9 @@
 	End Sub
 
-	Sub OnPaintBase(sender As Object, e As MessageEventArgs)
+	Sub OnPaintBase(sender As Object, e As MessageArgs)
 		Dim ps As PAINTSTRUCT
 		BeginPaint(ps)
 		Try
-			OnPaintDC(New PaintDCEventArgs(ps.hdc, ps.rcPaint))
+			OnPaintDC(New PaintDCArgs(ps.hdc, ps.rcPaint))
 		Finally
 			EndPaint(ps)
@@ -206,22 +238,21 @@
 	End Sub
 
-	Sub OnKeyDownBase(sender As Object, e As MessageEventArgs)
-		OnKeyDown(New KeyEventArgs(makeKeysFormMsg(e)))
-	End Sub
-
-	Sub OnKeyUpBase(sender As Object, e As MessageEventArgs)
-		OnKeyUp(New KeyEventArgs(makeKeysFormMsg(e)))
-	End Sub
-
-'	コメントアウト解除のときはStartWndProcのコメントアウト解除も忘れないこと
-'	Sub OnChar(sender As Object, e As MessageEventArgs)
-'		OnKeyPress(New KeyPressEventArgs(e.WParam As Char))
-'	End Sub
-
-	Sub OnCreateBase(sender As Object, e As MessageEventArgs)
-		OnCreate(New CreateEventArgs(e.LParam As *CREATESTRUCT))
-	End Sub
-
-	messageMap As System.Collections.Generic.Dictionary<Object /*DWord*/, MessageEventHandler>
+	Sub OnKeyDownBase(sender As Object, e As MessageArgs)
+		OnKeyDown(New KeyArgs(makeKeysFormMsg(e)))
+	End Sub
+
+	Sub OnKeyUpBase(sender As Object, e As MessageArgs)
+		OnKeyUp(New KeyArgs(makeKeysFormMsg(e)))
+	End Sub
+
+	Sub OnChar(sender As Object, e As MessageArgs)
+		OnKeyPress(New KeyPressArgs(e.WParam As Char))
+	End Sub
+
+	Sub OnCreateBase(sender As Object, e As MessageArgs)
+'		OnCreate(New CreateArgs(e.LParam As *CREATESTRUCT))
+	End Sub
+
+	messageMap As System.Collections.Generic.Dictionary<Object /*DWord*/, MessageHandler>
 
 Public
@@ -230,11 +261,11 @@
 	@date	2007/12/04
 	*/
-	Sub AddMessageEvent(message As DWord, h As MessageEventHandler)
+	Sub AddMessageEvent(message As DWord, h As MessageHandler)
 		If Not IsNothing(h) Then
 			If IsNothing(messageMap) Then
-				messageMap = New System.Collections.Generic.Dictionary<Object, MessageEventHandler>
+				messageMap = New System.Collections.Generic.Dictionary<Object, MessageHandler>
 			End If
 			Dim msg = Hex$(message)
-			Dim m = Nothing As MessageEventHandler
+			Dim m = Nothing As MessageHandler
 			If messageMap.TryGetValue(msg, m) Then
 				messageMap.Item[msg] = m + h
@@ -249,5 +280,5 @@
 	@date	2007/12/04
 	*/
-	Sub RemoveMessageEvent(message As DWord, a As MessageEventHandler)
+	Sub RemoveMessageEvent(message As DWord, a As MessageHandler)
 		If Not IsNothing(a) Then
 			If Not IsNothing(messageMap) Then
@@ -302,18 +333,17 @@
 			' ウィンドウが作られて最初にWndProcFirstが呼ばれたとき
 
-			If IsNothing(rThis) Then
+			If AssociateHWnd(gch, hwnd) = False Then
 				Goto *InstanceIsNotFound
 			End If
-			rThis.hwnd = hwnd
-			rThis.Prop[PropertyInstance] = gchValue As HANDLE
+		End If
+		If msg = WM_NCDESTROY Then
+			rThis.UnassociateHWnd()
+		End If
+		If msg = WM_DESTROY And IsNothing(rThis.finalDestroy) = False Then
+			Dim f = rThis.finalDestroy
+			f(rThis, Args.Empty)
+'			finalDestroy(This, Args.Empty)
 		End If
 		WndProcFirst = rThis.WndProc(msg, wp, lp)
-		If msg = WM_NCDESTROY Then
-			Dim gchValue = rThis.Prop(PropertyInstance) As ULONG_PTR
-			If gchValue <> 0 Then
-				GCHandle.FromIntPtr(gchValue).Free()
-			End If
-		End If
-
 		Exit Function
 
@@ -322,4 +352,50 @@
 		WndProcFirst = DefWindowProc(hwnd, msg, wp, lp)
 	End Function
+
+	/*!
+	@brief	Controlインスタンスとウィンドウハンドルを結び付ける。
+	@param[in] 結び付けられるControlインスタンスを格納したGCHandle
+	@param[in] hwnd	結び付けるウィンドウハンドル
+	@date	2008/07/16
+	これを実行することで、UnassociateHWndされるまでControlがGC対象にならなくなる。
+	*/
+	Static Function AssociateHWnd(gch As System.Runtime.InteropServices.GCHandle, hwnd As HWND) As Boolean
+		Imports System.Runtime.InteropServices
+		Dim rThis = gch.Target As Control
+		If IsNothing(rThis) Then
+			Exit Function
+		End If
+		rThis.hwnd = hwnd
+		rThis.Prop[PropertyInstance] = GCHandle.ToIntPtr(gch) As HANDLE
+	End Function
+
+	/*!
+	@brief	オーナーの破棄時にこのControlインスタンスとウィンドウハンドルの結び付けを解除するよう登録する。
+	@param[in] owner 結び付けの解除を連動させるControl
+	@date	2008/07/16
+	ownerのFinalDestoryでこのControlとHWNDとの結び付けを解除する。
+	*/
+	Sub RegisterUnassociateHWnd(owner As Control)
+		If IsNothing(owner) = False Then
+			Dim e = New Handler(AddressOf(UnassociateHWndOnEvent))
+			If IsNothing(finalDestroy) Then
+				owner.finalDestroy = e
+			Else
+				owner.finalDestroy += e
+			End If
+		End If
+	End Sub
+
+	Sub UnassociateHWndOnEvent(sender As Object, e As Args)
+		UnassociateHWnd()
+	End Sub
+
+	Sub UnassociateHWnd()
+		Imports System.Runtime.InteropServices
+		Dim gchValue = Prop(PropertyInstance) As ULONG_PTR
+		If gchValue <> 0 Then
+			GCHandle.FromIntPtr(gchValue).Free()
+		End If
+	End Sub
 
 '	Static Const WM_CONTROL_INVOKE = WM_USER + 0 As DWord
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEvent.sbp
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEvent.sbp	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEvent.sbp	(revision 551)
@@ -1,4 +1,4 @@
 Public
-	Sub AddPaintDC(h As PaintDCEventHandler)
+	Sub AddPaintDC(h As PaintDCHandler)
 		If IsNothing(paintDC) Then
 			paintDC = h
@@ -7,11 +7,11 @@
 		End If
 	End Sub
-	Sub RemovePaintDC(h As PaintDCEventHandler)
+	Sub RemovePaintDC(h As PaintDCHandler)
 		If Not IsNothing(paintDC) Then
 			paintDC -= h
 		End If
 	End Sub
-Private
-	Sub OnPaintDC(e As PaintDCEventArgs)
+Protected
+	Sub OnPaintDC(e As PaintDCArgs)
 		If Not IsNothing(paintDC) Then
 			paintDC(This, e)
@@ -19,8 +19,74 @@
 	End Sub
 Private
-	paintDC As PaintDCEventHandler
-
-Public
-	Sub AddMouseEnter(h As MouseEventHandler)
+	paintDC As PaintDCHandler
+
+Public
+	Sub AddClick(h As Handler)
+		If IsNothing(click) Then
+			click = h
+		Else
+			click += h
+		End If
+	End Sub
+	Sub RemoveClick(h As Handler)
+		If Not IsNothing(click) Then
+			click -= h
+		End If
+	End Sub
+Protected
+	Sub OnClick(e As Args)
+		If Not IsNothing(click) Then
+			click(This, e)
+		End If
+	End Sub
+Private
+	click As Handler
+
+Public
+	Sub AddDoubleClick(h As Handler)
+		If IsNothing(doubleClick) Then
+			doubleClick = h
+		Else
+			doubleClick += h
+		End If
+	End Sub
+	Sub RemoveDoubleClick(h As Handler)
+		If Not IsNothing(doubleClick) Then
+			doubleClick -= h
+		End If
+	End Sub
+Protected
+	Sub OnDoubleClick(e As Args)
+		If Not IsNothing(doubleClick) Then
+			doubleClick(This, e)
+		End If
+	End Sub
+Private
+	doubleClick As Handler
+
+Public
+	Sub AddMove(h As Handler)
+		If IsNothing(move) Then
+			move = h
+		Else
+			move += h
+		End If
+	End Sub
+	Sub RemoveMove(h As Handler)
+		If Not IsNothing(move) Then
+			move -= h
+		End If
+	End Sub
+Protected
+	Sub OnMove(e As Args)
+		If Not IsNothing(move) Then
+			move(This, e)
+		End If
+	End Sub
+Private
+	move As Handler
+
+Public
+	Sub AddMouseEnter(h As MouseHandler)
 		If IsNothing(mouseEnter) Then
 			mouseEnter = h
@@ -29,11 +95,11 @@
 		End If
 	End Sub
-	Sub RemoveMouseEnter(h As MouseEventHandler)
+	Sub RemoveMouseEnter(h As MouseHandler)
 		If Not IsNothing(mouseEnter) Then
 			mouseEnter -= h
 		End If
 	End Sub
-Private
-	Sub OnMouseEnter(e As MouseEventArgs)
+Protected
+	Sub OnMouseEnter(e As MouseArgs)
 		If Not IsNothing(mouseEnter) Then
 			mouseEnter(This, e)
@@ -41,8 +107,8 @@
 	End Sub
 Private
-	mouseEnter As MouseEventHandler
-
-Public
-	Sub AddMouseMove(h As MouseEventHandler)
+	mouseEnter As MouseHandler
+
+Public
+	Sub AddMouseMove(h As MouseHandler)
 		If IsNothing(mouseMove) Then
 			mouseMove = h
@@ -51,11 +117,11 @@
 		End If
 	End Sub
-	Sub RemoveMouseMove(h As MouseEventHandler)
+	Sub RemoveMouseMove(h As MouseHandler)
 		If Not IsNothing(mouseMove) Then
 			mouseMove -= h
 		End If
 	End Sub
-Private
-	Sub OnMouseMove(e As MouseEventArgs)
+Protected
+	Sub OnMouseMove(e As MouseArgs)
 		If Not IsNothing(mouseMove) Then
 			mouseMove(This, e)
@@ -63,8 +129,8 @@
 	End Sub
 Private
-	mouseMove As MouseEventHandler
-
-Public
-	Sub AddMouseHover(h As MouseEventHandler)
+	mouseMove As MouseHandler
+
+Public
+	Sub AddMouseHover(h As MouseHandler)
 		If IsNothing(mouseHover) Then
 			mouseHover = h
@@ -73,11 +139,11 @@
 		End If
 	End Sub
-	Sub RemoveMouseHover(h As MouseEventHandler)
+	Sub RemoveMouseHover(h As MouseHandler)
 		If Not IsNothing(mouseHover) Then
 			mouseHover -= h
 		End If
 	End Sub
-Private
-	Sub OnMouseHover(e As MouseEventArgs)
+Protected
+	Sub OnMouseHover(e As MouseArgs)
 		If Not IsNothing(mouseHover) Then
 			mouseHover(This, e)
@@ -85,8 +151,8 @@
 	End Sub
 Private
-	mouseHover As MouseEventHandler
-
-Public
-	Sub AddMouseLeave(h As MouseEventHandler)
+	mouseHover As MouseHandler
+
+Public
+	Sub AddMouseLeave(h As MouseHandler)
 		If IsNothing(mouseLeave) Then
 			mouseLeave = h
@@ -95,11 +161,11 @@
 		End If
 	End Sub
-	Sub RemoveMouseLeave(h As MouseEventHandler)
+	Sub RemoveMouseLeave(h As MouseHandler)
 		If Not IsNothing(mouseLeave) Then
 			mouseLeave -= h
 		End If
 	End Sub
-Private
-	Sub OnMouseLeave(e As MouseEventArgs)
+Protected
+	Sub OnMouseLeave(e As MouseArgs)
 		If Not IsNothing(mouseLeave) Then
 			mouseLeave(This, e)
@@ -107,8 +173,8 @@
 	End Sub
 Private
-	mouseLeave As MouseEventHandler
-
-Public
-	Sub AddMouseDown(h As MouseEventHandler)
+	mouseLeave As MouseHandler
+
+Public
+	Sub AddMouseDown(h As MouseHandler)
 		If IsNothing(mouseDown) Then
 			mouseDown = h
@@ -117,11 +183,11 @@
 		End If
 	End Sub
-	Sub RemoveMouseDown(h As MouseEventHandler)
+	Sub RemoveMouseDown(h As MouseHandler)
 		If Not IsNothing(mouseDown) Then
 			mouseDown -= h
 		End If
 	End Sub
-Private
-	Sub OnMouseDown(e As MouseEventArgs)
+Protected
+	Sub OnMouseDown(e As MouseArgs)
 		If Not IsNothing(mouseDown) Then
 			mouseDown(This, e)
@@ -129,8 +195,8 @@
 	End Sub
 Private
-	mouseDown As MouseEventHandler
-
-Public
-	Sub AddMouseClick(h As MouseEventHandler)
+	mouseDown As MouseHandler
+
+Public
+	Sub AddMouseClick(h As MouseHandler)
 		If IsNothing(mouseClick) Then
 			mouseClick = h
@@ -139,11 +205,11 @@
 		End If
 	End Sub
-	Sub RemoveMouseClick(h As MouseEventHandler)
+	Sub RemoveMouseClick(h As MouseHandler)
 		If Not IsNothing(mouseClick) Then
 			mouseClick -= h
 		End If
 	End Sub
-Private
-	Sub OnMouseClick(e As MouseEventArgs)
+Protected
+	Sub OnMouseClick(e As MouseArgs)
 		If Not IsNothing(mouseClick) Then
 			mouseClick(This, e)
@@ -151,8 +217,8 @@
 	End Sub
 Private
-	mouseClick As MouseEventHandler
-
-Public
-	Sub AddMouseDoubleClick(h As MouseEventHandler)
+	mouseClick As MouseHandler
+
+Public
+	Sub AddMouseDoubleClick(h As MouseHandler)
 		If IsNothing(mouseDoubleClick) Then
 			mouseDoubleClick = h
@@ -161,11 +227,11 @@
 		End If
 	End Sub
-	Sub RemoveMouseDoubleClick(h As MouseEventHandler)
+	Sub RemoveMouseDoubleClick(h As MouseHandler)
 		If Not IsNothing(mouseDoubleClick) Then
 			mouseDoubleClick -= h
 		End If
 	End Sub
-Private
-	Sub OnMouseDoubleClick(e As MouseEventArgs)
+Protected
+	Sub OnMouseDoubleClick(e As MouseArgs)
 		If Not IsNothing(mouseDoubleClick) Then
 			mouseDoubleClick(This, e)
@@ -173,8 +239,8 @@
 	End Sub
 Private
-	mouseDoubleClick As MouseEventHandler
-
-Public
-	Sub AddMouseUp(h As MouseEventHandler)
+	mouseDoubleClick As MouseHandler
+
+Public
+	Sub AddMouseUp(h As MouseHandler)
 		If IsNothing(mouseUp) Then
 			mouseUp = h
@@ -183,11 +249,11 @@
 		End If
 	End Sub
-	Sub RemoveMouseUp(h As MouseEventHandler)
+	Sub RemoveMouseUp(h As MouseHandler)
 		If Not IsNothing(mouseUp) Then
 			mouseUp -= h
 		End If
 	End Sub
-Private
-	Sub OnMouseUp(e As MouseEventArgs)
+Protected
+	Sub OnMouseUp(e As MouseArgs)
 		If Not IsNothing(mouseUp) Then
 			mouseUp(This, e)
@@ -195,8 +261,8 @@
 	End Sub
 Private
-	mouseUp As MouseEventHandler
-
-Public
-	Sub AddKeyDown(h As KeyEventHandler)
+	mouseUp As MouseHandler
+
+Public
+	Sub AddKeyDown(h As KeyHandler)
 		If IsNothing(keyDown) Then
 			keyDown = h
@@ -205,11 +271,11 @@
 		End If
 	End Sub
-	Sub RemoveKeyDown(h As KeyEventHandler)
+	Sub RemoveKeyDown(h As KeyHandler)
 		If Not IsNothing(keyDown) Then
 			keyDown -= h
 		End If
 	End Sub
-Private
-	Sub OnKeyDown(e As KeyEventArgs)
+Protected
+	Sub OnKeyDown(e As KeyArgs)
 		If Not IsNothing(keyDown) Then
 			keyDown(This, e)
@@ -217,8 +283,8 @@
 	End Sub
 Private
-	keyDown As KeyEventHandler
-
-Public
-	Sub AddKeyUp(h As KeyEventHandler)
+	keyDown As KeyHandler
+
+Public
+	Sub AddKeyUp(h As KeyHandler)
 		If IsNothing(keyUp) Then
 			keyUp = h
@@ -227,11 +293,11 @@
 		End If
 	End Sub
-	Sub RemoveKeyUp(h As KeyEventHandler)
+	Sub RemoveKeyUp(h As KeyHandler)
 		If Not IsNothing(keyUp) Then
 			keyUp -= h
 		End If
 	End Sub
-Private
-	Sub OnKeyUp(e As KeyEventArgs)
+Protected
+	Sub OnKeyUp(e As KeyArgs)
 		If Not IsNothing(keyUp) Then
 			keyUp(This, e)
@@ -239,8 +305,30 @@
 	End Sub
 Private
-	keyUp As KeyEventHandler
-
-Public
-	Sub AddCreate(h As CreateEventHandler)
+	keyUp As KeyHandler
+
+Public
+	Sub AddKeyPress(h As KeyPressHandler)
+		If IsNothing(keyPress) Then
+			keyPress = h
+		Else
+			keyPress += h
+		End If
+	End Sub
+	Sub RemoveKeyPress(h As KeyPressHandler)
+		If Not IsNothing(keyPress) Then
+			keyPress -= h
+		End If
+	End Sub
+Protected
+	Sub OnKeyPress(e As KeyPressArgs)
+		If Not IsNothing(keyPress) Then
+			keyPress(This, e)
+		End If
+	End Sub
+Private
+	keyPress As KeyPressHandler
+/*
+Public
+	Sub AddCreate(h As CreateHandler)
 		If IsNothing(create) Then
 			create = h
@@ -249,11 +337,11 @@
 		End If
 	End Sub
-	Sub RemoveCreate(h As CreateEventHandler)
+	Sub RemoveCreate(h As CreateHandler)
 		If Not IsNothing(create) Then
 			create -= h
 		End If
 	End Sub
-Private
-	Sub OnCreate(e As CreateEventArgs)
+Protected
+	Sub OnCreate(e As CreateArgs)
 		If Not IsNothing(create) Then
 			create(This, e)
@@ -261,4 +349,26 @@
 	End Sub
 Private
-	create As CreateEventHandler
-
+	create As CreateHandler
+
+Public
+	Sub AddDestroy(h As Handler)
+		If IsNothing(destroy) Then
+			destroy = h
+		Else
+			destroy += h
+		End If
+	End Sub
+	Sub RemoveDestroy(h As Handler)
+		If Not IsNothing(destroy) Then
+			destroy -= h
+		End If
+	End Sub
+Protected
+	Sub OnDestroy(e As Args)
+		If Not IsNothing(destroy) Then
+			destroy(This, e)
+		End If
+	End Sub
+Private
+	destroy As Handler
+*/
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEventList.txt
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEventList.txt	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEventList.txt	(revision 551)
@@ -1,23 +1,23 @@
-PaintDC	PaintDCEvent	ウィンドウの描画が必要なときに呼び出されます。
-'Click	Event	クリックされたときに呼び出されます。
-'DoubleClick	Event	ダブルクリックされたときに呼び出されます。
-'EnableChanged	Event	有効状態が変化したときに呼び出されます。
-'Move	Event	ウィンドウが移動したときに呼び出されます。
-'Resize	Event	ウィンドウの大きさが変化したときに呼び出されます。
-'VisibleChanged	Event	ウィンドウの表示状態が変化したときに呼び出されます。
-'SetFocus	Event	フォーカスを得たときに呼び出されます。
-'KillFocus	Event	フォーカスを失ったときに呼び出されます。
-MouseEnter	MouseEvent	マウスカーソルがコントロールに入ってくると呼び出されます。
-MouseMove	MouseEvent	マウスカーソルがコントロール上で移動すると呼び出されます
-MouseHover	MouseEvent	マウスカーソルがコントロール上で静止すると呼び出されます。
-MouseLeave	MouseEvent	マウスカーソルがコントロールから出て行くと呼び出されます。
-MouseDown	MouseEvent	マウスボタンが押されたときに呼び出されます。
-MouseClick	MouseEvent	マウスでクリックされたときに呼び出されます。
-MouseDoubleClick	MouseEvent	マウスでダブルクリックされたときに呼び出されます。
-MouseUp	MouseEvent	マウスボタンが離されたときに呼び出されます。
-'MouseWheel	MouseEvent	マウスホイールが回されたときに呼び出されます。
-KeyDown	KeyEvent	キーが押されたときに呼ばれます。
-KeyUp	KeyEvent	キーが離されたときに呼ばれます。
-'なぜかコンパイルエラーを起こすのでコメントアウト KeyPress	KeyPressEvent	キーが押されて文字が打たれたときに呼ばれます。
-Create	CreateEvent	ウィンドウが作成されたときに呼ばれます。
-'Destroy	Event	ウィンドウが破棄されるときに呼ばれます。
+PaintDC	PaintDC	ウィンドウの描画が必要なときに呼び出されます。
+Click		クリックされたときに呼び出されます。
+DoubleClick		ダブルクリックされたときに呼び出されます。
+'EnableChanged		有効状態が変化したときに呼び出されます。
+Move		ウィンドウが移動したときに呼び出されます。
+'Resize		ウィンドウの大きさが変化したときに呼び出されます。
+'VisibleChanged		ウィンドウの表示状態が変化したときに呼び出されます。
+'SetFocus		フォーカスを得たときに呼び出されます。
+'KillFocus		フォーカスを失ったときに呼び出されます。
+MouseEnter	Mouse	マウスカーソルがコントロールに入ってくると呼び出されます。
+MouseMove	Mouse	マウスカーソルがコントロール上で移動すると呼び出されます
+MouseHover	Mouse	マウスカーソルがコントロール上で静止すると呼び出されます。
+MouseLeave	Mouse	マウスカーソルがコントロールから出て行くと呼び出されます。
+MouseDown	Mouse	マウスボタンが押されたときに呼び出されます。
+MouseClick	Mouse	マウスでクリックされたときに呼び出されます。
+MouseDoubleClick	Mouse	マウスでダブルクリックされたときに呼び出されます。
+MouseUp	Mouse	マウスボタンが離されたときに呼び出されます。
+'MouseWheel	Mouse	マウスホイールが回されたときに呼び出されます。
+KeyDown	Key	キーが押されたときに呼ばれます。
+KeyUp	Key	キーが離されたときに呼ばれます。
+KeyPress	KeyPress	キーが押されて文字が打たれたときに呼ばれます。
+Create	Create	ウィンドウが作成されたときに呼ばれます。
+Destroy		ウィンドウが破棄されるときに呼ばれます。
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab	(revision 551)
@@ -1,4 +1,4 @@
 /**
-@file Include/Classes/ActiveBasic/Windows/UI/EventArgs.ab
+@file Include/Classes/ActiveBasic/Windows/UI/Args.ab
 @brief イベントハンドラ関連
 */
@@ -8,16 +8,12 @@
 Namespace UI
 
-'TypeDef EventArgs = System.EventArgs
-'TypeDef EventHandler = System.EventHandler
-Class EventArgs
-Public
-	Static Empty = Nothing As EventArgs
-End Class
-Delegate Sub EventHandler(sender As Object, e As EventArgs)
-
-Class MessageEventArgs
-	Inherits EventArgs
-Public
-	Sub MessageEventArgs(hwndSrc As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM)
+TypeDef Args = System.EventArgs
+'TypeDef Handler = System.EventHandler
+Delegate Sub Handler(sender As Object, e As Args)
+
+Class MessageArgs
+	Inherits Args
+Public
+	Sub MessageArgs(hwndSrc As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM)
 		msg = message
 '		hwnd = hwndSrc
@@ -58,10 +54,10 @@
 End Class
 
-Delegate Sub MessageEventHandler(sender As Object, e As MessageEventArgs)
-
-Class PaintDCEventArgs
-	Inherits EventArgs
-Public
-	Sub PaintDCEventArgs(hdcTarget As HDC, ByRef rect As RECT)
+Delegate Sub MessageHandler(sender As Object, e As MessageArgs)
+
+Class PaintDCArgs
+	Inherits Args
+Public
+	Sub PaintDCArgs(hdcTarget As HDC, ByRef rect As RECT)
 		hdc = hdcTarget
 		rc = rect
@@ -81,11 +77,11 @@
 End Class
 
-Delegate Sub PaintDCEventHandler(sender As Object, e As PaintDCEventArgs)
-
-Class PaintDCHandledEventArgs
-	Inherits PaintDCEventArgs
-Public
-	Sub PaintDCHandledEventArgs(hdcTarget As HDC, ByRef rect As RECT)
-		PaintDCEventArgs(hdcTarget, rect)
+Delegate Sub PaintDCHandler(sender As Object, e As PaintDCArgs)
+
+Class PaintDCHandledArgs
+	Inherits PaintDCArgs
+Public
+	Sub PaintDCHandledArgs(hdcTarget As HDC, ByRef rect As RECT)
+		PaintDCArgs(hdcTarget, rect)
 	End Sub
 
@@ -102,5 +98,5 @@
 End Class
 
-TypeDef PaintDCBackGroundEventArgs = PaintDCHandledEventArgs
+TypeDef PaintDCBackGroundArgs = PaintDCHandledArgs
 
 Enum MouseButtons
@@ -116,12 +112,11 @@
 End Enum
 
-Class MouseEventArgs
-	Inherits EventArgs
-Public
-	Sub MouseEventArgs(button As MouseButtons, clicks As Long, x As Long, y As Long, delta As Long)
+Class MouseArgs
+	Inherits Args
+Public
+	Sub MouseArgs(button As MouseButtons, clicks As Long, x As Long, y As Long, delta As Long)
 		This.button = button
 		This.clicks = clicks
 		This.pt = New System.Drawing.Point(x, y)
-		OutputDebugString(ToTCStr(Hex$(y) + " " + Hex$(pt.Y) + " " +  Ex" mea\r\n"))
 		This.delta = delta
 	End Sub
@@ -158,10 +153,10 @@
 End Class
 
-Delegate Sub MouseEventHandler(sender As Object, e As MouseEventArgs)
-
-Class KeyPressEventArgs
-	Inherits EventArgs
-Public
-	Sub KeyPressEventArgs(keyChar As Char)
+Delegate Sub MouseHandler(sender As Object, e As MouseArgs)
+
+Class KeyPressArgs
+	Inherits Args
+Public
+	Sub KeyPressArgs(keyChar As Char)
 		key = keyChar
 	End Sub
@@ -187,5 +182,5 @@
 End Class
 
-Delegate Sub KeyPressEventHandler(sender As Object, e As KeyPressEventArgs)
+Delegate Sub KeyPressHandler(sender As Object, e As KeyPressArgs)
 
 Enum Keys
@@ -384,8 +379,8 @@
 End Enum
 
-Class KeyEventArgs
-	Inherits EventArgs
-Public
-	Sub KeyEventArgs(keyData As Keys)
+Class KeyArgs
+	Inherits Args
+Public
+	Sub KeyArgs(keyData As Keys)
 		key = keyData
 	End Sub
@@ -436,10 +431,10 @@
 End Class
 
-Delegate Sub KeyEventHandler(sender As Object, e As KeyEventArgs)
-
-Class CreateEventArgs
-	Inherits EventArgs
-Public
-	Sub CreateEventArgs(pCreateStruct As *CREATESTRUCT)
+Delegate Sub KeyHandler(sender As Object, e As KeyArgs)
+
+Class CreateArgs
+	Inherits Args
+Public
+	Sub CreateArgs(pCreateStruct As *CREATESTRUCT)
 		pcs = pCreateStruct
 	End Sub
@@ -494,10 +489,10 @@
 End Class
 
-Delegate Sub CreateEventHandler(sender As Object, e As CreateEventArgs)
-
-Class FormClosingEventArgs
-	Inherits EventArgs
-Public
-	Sub FormClosingEventArgs()
+Delegate Sub CreateHandler(sender As Object, e As CreateArgs)
+
+Class FormClosingArgs
+	Inherits Args
+Public
+	Sub FormClosingArgs()
 		c = False
 	End Sub
@@ -514,5 +509,5 @@
 End Class
 
-Delegate Sub FormClosingEventHandler(sender As Object, e As FormClosingEventArgs)
+Delegate Sub FormClosingHandler(sender As Object, e As FormClosingArgs)
 
 End Namespace 'UI
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab	(revision 551)
@@ -2,4 +2,5 @@
 
 #require <Classes/ActiveBasic/Windows/UI/Control.ab>
+#require <Classes/ActiveBasic/Windows/UI/Button.ab>
 
 Namespace ActiveBasic
@@ -12,23 +13,30 @@
 @author Egtra
 */
+
 Class Form
 	Inherits Control
+Public
+	Sub Form()
+		AddMessageEvent(WM_COMMAND, AddressOf (OnCommand))
+	End Sub
+
 Protected
 	Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
-		With cs
-			.lpCreateParams = 0
-			'.hInstance
-			.hMenu = 0
-			.hwndParent = 0
-			.cy = CW_USEDEFAULT
-			.cx = CW_USEDEFAULT
-			.y = CW_USEDEFAULT
-			.x = CW_USEDEFAULT
-			.style = WS_OVERLAPPEDWINDOW
-			.lpszName = ""
-			'.lpszClass
-			.dwExStyle = 0
-		End With
+		cs.style = WS_OVERLAPPEDWINDOW
 	End Sub
+
+	Sub OnCommand(sender As Object, e As MessageArgs)
+		Dim id = e.WParam And &hffff 'LOWORD(e.WParam)
+		Dim cmd = (e.WParam >> 16) And &hffff 'HIWORD(e.WParam)
+		Dim hwnd = e.LParam As HWND
+		If cmd = BN_CLICKED And hwnd <> 0 Then
+			Dim c = Control.FromHWnd(hwnd)
+			If IsNothing(c) = False Then
+				Dim b = c As Button
+				b.RaiseClick()
+			End If
+		End If
+	End Sub
+
 #include "FormEvent.sbp"
 End Class
@@ -42,4 +50,5 @@
 
 #require <Classes/ActiveBasic/Windows/UI/Application.ab>
+#require <Classes/ActiveBasic/Windows/UI/Button.ab>
 
 Imports ActiveBasic.Windows.UI
@@ -48,30 +57,27 @@
 Control.Initialize(GetModuleHandle(0))
 
+Sub Paint(sender As Object, e As PaintDCArgs)
+	TextOut(e.Handle, 10, 10, "Hello world!", 12)
+End Sub
+
 Class MyForm
 	Inherits Form
 Public
 	Sub MyForm()
-		Dim f = This
-		AddMessageEvent(WM_DESTROY, AddressOf (f.Destory))
-		AddPaintDC(AddressOf (f.Paint))
-		AddMouseClick(AddressOf (f.Mouse))
-		s = ""
+		AddPaintDC(AddressOf (Paint))
+		AddMouseClick(AddressOf (Mouse))
+		s = "aaa"
 	End Sub
 
-	Sub Destory(sender As Object, e As EventArgs)
-		OutputDebugString(Ex"Destory\r\n")
-		PostQuitMessage(0)
+'	Sub Paint(sender As Object, e As PaintDCArgs)
+'		TextOut(e.Handle, 10, 10, ToTCStr(s), s.Length)
+'	End Sub
+
+	Sub Mouse(sender As Object, e As MouseArgs)
+		Invalidate()
 	End Sub
 
-	Sub Paint(sender As Object, e As PaintDCEventArgs)
-		TextOut(e.Handle, 10, 10, ToTCStr(s), s.Length)
-	End Sub
-
-	Sub Mouse(sender As Object, e As MouseEventArgs)
-		Dim sb = New System.Text.StringBuilder
-		sb.Append("X = ").Append(e.X).Append(", Y = ").Append(e.Y)
-		s = sb.ToString
-		OutputDebugString(ToTCStr(s + " " + Hex$(ObjPtr(e)) + Ex"\r\n"))
-		Invalidate()
+	Sub OnClick(sender As Object, e As Args)
+		OutputDebugString(Ex"====OnClick====\r\n")
 	End Sub
 
@@ -81,4 +87,12 @@
 Dim f = New MyForm
 f.Create()
+f.Text = "Hello"
+
+Dim b = New Button
+b.Create(f)
+b.Move(50, 50, 100, 100)
+b.Text = "Ok"
+b.AddClick(AddressOf(f.OnClick))
+
 Application.Run(f)
 f = Nothing
@@ -89,3 +103,2 @@
 
 End
-
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/FormEvent.sbp
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/FormEvent.sbp	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/FormEvent.sbp	(revision 551)
@@ -1,4 +1,4 @@
 Public
-	Sub AddQueryClose(h As FormClosingEventHandler)
+	Sub AddQueryClose(h As FormClosingHandler)
 		If IsNothing(queryClose) Then
 			queryClose = h
@@ -7,11 +7,11 @@
 		End If
 	End Sub
-	Sub RemoveQueryClose(h As FormClosingEventHandler)
+	Sub RemoveQueryClose(h As FormClosingHandler)
 		If Not IsNothing(queryClose) Then
 			queryClose -= h
 		End If
 	End Sub
-Private
-	Sub OnQueryClose(e As FormClosingEventArgs)
+Protected
+	Sub OnQueryClose(e As FormClosingArgs)
 		If Not IsNothing(queryClose) Then
 			queryClose(This, e)
@@ -19,4 +19,4 @@
 	End Sub
 Private
-	queryClose As FormClosingEventHandler
+	queryClose As FormClosingHandler
 
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/FormEventList.txt
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/FormEventList.txt	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/FormEventList.txt	(revision 551)
@@ -4,5 +4,5 @@
 'f	QueryClose	WM_CLOSE
 'f	Timer	WM_TIMER
-'Activate	Event	ウィンドウがアクティブになったときに呼ばれます。
-'Deactivate	Event	ウィンドウがアクティブでなくなったときに呼ばれます。
-QueryClose	FormClosingEvent	ウィンドウが閉じられようとしているときに呼ばれます。
+'Activate		ウィンドウがアクティブになったときに呼ばれます。
+'Deactivate		ウィンドウがアクティブでなくなったときに呼ばれます。
+QueryClose	FormClosing	ウィンドウが閉じられようとしているときに呼ばれます。
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/MakeControlEventHandler.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/MakeControlEventHandler.ab	(revision 547)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/MakeControlEventHandler.ab	(revision 551)
@@ -40,5 +40,5 @@
 	out.WriteLine(Ex"\t\tEnd If")
 	out.WriteLine(Ex"\tEnd Sub")
-	out.WriteLine("Private")
+	out.WriteLine("Protected")
 '	out.WriteLine(Ex"\t/*!")
 '	out.WriteLine(Ex"\t@brief " & comment)
@@ -79,3 +79,4 @@
 MakeControlEvent("Control")
 MakeControlEvent("Form")
+MakeControlEvent("Application")
 End
