'Classes/ActiveBasic/Windows/UI/Form.ab #require #require Namespace ActiveBasic Namespace Windows Namespace UI /*! @date 2008/07/13 @brief トップレベルウィンドウを表すクラス。 @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 .style = WS_OVERLAPPEDWINDOW .x = CW_USEDEFAULT .y = CW_USEDEFAULT .cx = CW_USEDEFAULT .cy = CW_USEDEFAULT End With 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) As Word 'HIWORD(e.WParam) Dim hwnd = e.LParam As HWND If hwnd <> 0 Then Dim c = Control.FromHWnd(hwnd) As WmCommandControl If IsNothing(c) = False Then c.RaiseCommandEvent(cmd) End If End If End Sub #include "FormEvent.sbp" End Class End Namespace 'UI End Namespace 'Widnows End Namespace 'ActiveBasic