How To Create Window with CreateWindowEx ?

Miscellaneous Forums/Win32 Discussion/How To Create Window with CreateWindowEx ?

hm, there is an Problem with the Maximize

Strict 

Framework PUB.Win32 
Import BRL.System 
Import BRL.EventQueue 
Import BRL.basic 

Extern "Win32" 
   Function UpdateWindow(hWnd) 
End Extern 


Global CLASS_NAME:Byte Ptr="bbW32 Window".ToCString() ' Wie heißt unsere Anwendung 
Global hinst=GetModuleHandleA(0) ' was ist uinsere instance 


Local hwnd%=CreateHWND(600,400,0,"Jan_'s Win32 Application".ToCString()) ' Fenster erstellen 
'showwindow(hwnd,sw_show) ' fenster Zeigen 
'showwindow(hwnd,sw_hide) ' fenster verstecken 
Local ende% 
Repeat 
   WaitEvent() ' warten, das was passiert, das wichtig ist --> 0% CPU last 
   ende=True 
Until (ende=True) 

DestroyWindow(hWnd) ' das Fenster wieder löschen 
End 

Function WndProc( hwnd,message,wp,lp ) "win32" 
   Local event:TEvent 

   Select message ' hier reagieren wir auf die aktionen die der nutzer auslöst 
   Case WM_CLOSE ' schließen 
      event=New TEvent 
      PostEvent(event) ' so, das sendet an Waitevent das es was machen soll (siehe oben) 
      postquitmessage(0) 
      DestroyWindow(hWnd) 
      End 
      Return 
   Case WM_DESTROY ' zerstören 
      event=New TEvent 
      PostEvent(event) ' so, das sendet an Waitevent das es was machen soll (siehe oben) 
      postquitmessage(0) 
      DestroyWindow(hWnd) 
      End 
      Return 
   Case WM_MOVE ' bewegen 
      'updatewindow(hwnd) 
      Return 
   Case WM_SIZE 
      'bbSystemEmitOSEvent hwnd,message,wp,lp,Null 
      'updatewindow(hwnd) 
      Return 
   Case WM_Paint 
      updatewindow(hwnd) 
      Return 
'   Case WM_MOUSEMOVE 
   'Default 
      'bbSystemEmitOSEvent hwnd,message,wp,lp,Null 
   End Select 
   Return DefWindowProcA( hwnd,message,wp,lp ) 
End Function 

Function CreateHWND(width,height,fullscreen,WINDOW_TITLE:Byte Ptr,PosX%=100,PosY%=100) ' Fenster erstellen 
    
   Local style,ex_style,hwnd 
   Local hinst=GetModuleHandleA(0) 
    
   Global wndClas 
    
   If Not wndClas 
      Local wc:WNDCLASS=New WNDCLASS 
      Local hinst=GetModuleHandleA(0) 
      'Local icon:Byte Ptr="IDI_INFORMATION".ToCString() 
      wc.style=CS_HREDRAW Or CS_VREDRAW ' Fensterstyle 
      wc.lpfnWndProc=WndProc 'Zeiger auf die Fensterprozedur 
      wc.cbClsExtra=0 
      wc.cbWndExtra=0 
      wc.hInstance=hinst ' Instanz des Programms 
      wc.hIcon=LoadIconA(Null, Null) 'Handle eines Icons das z.B. mit LoadIcon() geladen wurde 
      wc.hbrBackground = GetStockObject (LTGRAY_BRUSH) 
      wc.hCursor=LoadCursorA( Null,Byte Ptr IDC_ARROW ) 'Handle eines Cursors 
      wc.lpszClassName=CLASS_NAME ' Name der zu registrierenden Fensterklasse 
      wndClas=RegisterClassA( wc ) 
      If Not wndClas 
         Throw "Failed to register window class" 
      EndIf 
   EndIf 

   ex_style=WS_EX_TRANSPARENT 
   style=WS_VISIBLE|WS_SYSMENU|WS_CAPTION|WS_MAXIMIZEBOX|WS_MINIMIZEBOX|WS_SIZEBOX'|WS_SYSMENU 
    
   Local rect[]=[posx,posy,width+posx,height+posy] 

   hWnd=CreateWindowExA(.. 
      ex_style,.. 
      CLASS_NAME,.. 
      WINDOW_TITLE,.. 
      style,.. 
      posx,posy,width,height,.. 
      0,0,hinst,Null) 
   ShowWindow(hWnd,SW_SHOW); 

   MemFree WINDOW_TITLE 
   If Not hwnd Throw "Failed to create window" 
   Return hwnd 
End Function