Seite 1 von 1

Problem mit Windows SWAP

Verfasst: 01.02.2018 11:34
von Velindos
Hallo Leute,

wenn ich das Windows rechts oder links einklicke, dann verändert sich mein Fenster auf kleiner! Obwohl ich mit WindowsBounds das Fenster binde!

Jetzt kommts, wenn ich Maximize drücke dann passt die Grösse des Fensters wieder, warum'?

Code: Alles auswählen

Enumeration
  #Hwnd_Otelo
  #StatusBar
  #btn
EndEnumeration


Global FensterTitel$ = "Swap test"

Global flags =#PB_Window_SystemMenu |#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget

If OpenWindow(#Hwnd_Otelo,#PB_Ignore,#PB_Ignore,667,732,FensterTitel$,flags)
  
  WindowBounds(#Hwnd_Otelo, 667, 732, 667, 732)
  
  ;{ STATUSBAR OTLEO(667)
  If CreateStatusBar(#StatusBar, WindowID(#Hwnd_Otelo))
    ; StatusBar 0 [StatusBarText(#StatusBar,0]
    AddStatusBarField(30) 
    ; StatusBar 1 [StatusBarText(#StatusBar,1]
    AddStatusBarField(0) 
    ; StatusBar 2 [StatusBarText(#StatusBar,0] => 2
    AddStatusBarField(417)
    ; StatusBar 3  [StatusBarText(#StatusBar,1] => 3
    AddStatusBarField(220)
  EndIf
  ;}
  ButtonGadget(#btn,0,0,667,732-StatusBarHeight(#StatusBar),"DECKBLATT")
  
  
  Define Event,Quit
  Repeat
    Event = WaitWindowEvent()
    
    If Event = #PB_Event_CloseWindow  ; If the user has pressed on the close button
      Quit = 1
    EndIf
    
  Until Quit = 1
  
EndIf

End   ; All the opened windows are closed automatically by PureBasic

Jemand eine Idee warum das passiert!

Gruss ... Velindos

Re: Problem mit Windows SWAP

Verfasst: 01.02.2018 11:41
von RSBasic
Kann ich bestätigen. Abhilfe:

Code: Alles auswählen

Enumeration
  #Hwnd_Otelo
  #StatusBar
  #btn
EndEnumeration



Global FensterTitel$ = "Swap test"

Global flags =#PB_Window_SystemMenu |#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget

If OpenWindow(#Hwnd_Otelo,0,0,667,732,FensterTitel$,flags)
  
  WindowBounds(#Hwnd_Otelo, 667, 732, 667, 732)
  
  ;{ STATUSBAR OTLEO(667)
  If CreateStatusBar(#StatusBar, WindowID(#Hwnd_Otelo))
    ; StatusBar 0 [StatusBarText(#StatusBar,0]
    AddStatusBarField(30)
    ; StatusBar 1 [StatusBarText(#StatusBar,1]
    AddStatusBarField(0)
    ; StatusBar 2 [StatusBarText(#StatusBar,0] => 2
    AddStatusBarField(417)
    ; StatusBar 3  [StatusBarText(#StatusBar,1] => 3
    AddStatusBarField(220)
  EndIf
  ;}
  ButtonGadget(#btn,0,0,667,732-StatusBarHeight(#StatusBar),"DECKBLATT")
  
  
  Define Event,Quit
  Repeat
    Event = WaitWindowEvent()
    If Event = #PB_Event_SizeWindow
      ResizeWindow(#Hwnd_Otelo, #PB_Ignore, #PB_Ignore, 667, 732)
    EndIf
    Debug Str(WindowWidth(#Hwnd_Otelo)) + "x" + Str(WindowHeight(#Hwnd_Otelo))
    If Event = #PB_Event_CloseWindow  ; If the user has pressed on the close button
      Quit = 1
    EndIf
    
  Until Quit = 1
  
EndIf

End   ; All the opened windows are closed automatically by PureBasic
Aber warum benutzt du überhaupt #PB_Window_SizeGadget, wenn man die Fenstergröße eh nicht verändern darf?

Re: Problem mit Windows SWAP

Verfasst: 01.02.2018 11:50
von Velindos
Hallo,
wenn ich #PB_Window_SizeGadget weg lasse, dann hängt sich mein Fenster nicht am Windows Desktop Rand ein!

Danke, für deinen Vorschlag!

Gruss ... Velindos