<Controls>
  <ControlName>Window</ControlName>
  <Template>QMainWindow</Template>
  <Lib>Winapi</Lib>
  <Type>Container</Type>
  <Tooltip>Ein Window ist ein Fenster für dein Programm!</Tooltip>
  <PreviewX>x</PreviewX>
  <PreviewY>y</PreviewY>
  <PreviewWidth>width</PreviewWidth>
  <PreviewHeight>height</PreviewHeight>
  
  <InitOnceGlobal>
  function WndProc ( byval hWnd as HWND, _
                   byval wMsg as UINT, _
                   byval wParam as WPARAM, _
                   byval lParam as LPARAM ) as LRESULT
    
    function = DefWindowProc( hWnd, wMsg, wParam, lParam )    
    
  end function
  </InitOnceGlobal>  

  <InitOnce>
  dim as HINSTANCE hInstance = GetModuleHandle( null )
  dim as integer iCmdShow = SW_NORMAL
  dim wcls as WNDCLASS  
  
  with wcls
    	.style         = CS_HREDRAW or CS_VREDRAW
    	.lpfnWndProc   = @WndProc
    	.cbClsExtra    = 0
    	.cbWndExtra    = 0
    	.hInstance     = hInstance
    	.hIcon         = LoadIcon( NULL, IDI_APPLICATION )
    	.hCursor       = LoadCursor( NULL, IDC_ARROW )
    	.hbrBackground = CreateSolidBrush(bgr(240,240,240))
    	.lpszMenuName  = NULL
    	.lpszClassName = @"Window"
  end with
          
  if( RegisterClass( @wcls ) = FALSE ) then
    MessageBox( null, "Failed to register wcls", "Error", MB_ICONERROR )
    end
  end if

  </InitOnce>


  <InitCode>dim as HWND name = CreateWindowEx( 0, _
                           @"Window", _
                           titel, _
                           WS_OVERLAPPEDWINDOW, _
                           x, _
                           y, _
                           width, _
                           height, _
                           NULL, _
                           NULL, _
                           hInstance, _
                           NULL )
                          

    ShowWindow( name, iCmdShow )
    UpdateWindow( name )
  </InitCode>

  <Property>
    <Name>name</Name>
    <Type>string</Type>
    <MustHave>true</MustHave>
    <Default>Window</Default>
    <Tooltip>Interner Name des Controls</Tooltip>
  </Property>


  <Property>
    <Name>titel</Name>
    <Type>string</Type>
    <MustHave>true</MustHave>
    <Default>Fenstertitel</Default>
    <ScriptValueChange>widget.windowTitle = new_value</ScriptValueChange>
  </Property>

  <Property>
    <Name>x</Name>
    <Type>integer</Type>
    <MustHave>false</MustHave>
    <Default>10</Default>
    <Min>0</Min>
    <Max>3000</Max>
    <Tooltip>X-Position des Fensters</Tooltip>
    <ScriptValueChange>widget2.moveWidget(new_value,y)</ScriptValueChange>
  </Property>

  <Property>
    <Name>y</Name>
    <Type>integer</Type>
    <MustHave>false</MustHave>
    <Default>10</Default>
    <Min>0</Min>
    <Max>3000</Max>
    <Tooltip>Y-Position des Fensters</Tooltip>
    <ScriptValueChange>widget2.moveWidget(x,new_value)</ScriptValueChange>
  </Property>

  <Property>
    <Name>width</Name>
    <Type>integer</Type>
    <MustHave>false</MustHave>
    <Default>200</Default>
    <Min>0</Min>
    <Max>3000</Max>
    <Tooltip>Breite des Fensters</Tooltip>
    <ScriptValueChange>widget2.resizeWidget(new_value,height)</ScriptValueChange>
  </Property>

  <Property>
    <Name>height</Name>
    <Type>integer</Type>
    <MustHave>false</MustHave>
    <Default>200</Default>
    <Min>0</Min>
    <Max>3000</Max>
    <Tooltip>Höhe des Fensters</Tooltip>
    <ScriptValueChange>widget2.resizeWidget(width,new_value)</ScriptValueChange>
  </Property>

</Controls>