Bords collants
Publié : mer. 10/mars/2004 21:18
Salut a tous ! Je ne sais plus qui avait fait un code pour une fenetre avec les bords collant... et ca avait pas trop marché ! Voici ma version qui je l'espère marchera mieux :
1 - Les valeur 125, et 115 sont tout a fait arbitraires.... Je l'ai ait trouvé en testant, enfin ca doit être largeur fenetre + bard, etc... et longueur fentre + bord,etc...
2 - Si quelqu'un pouvait me troeuver l'ancien code.... ce serait sympa
Code : Tout sélectionner
ScreenX = GetSystemMetrics_(#SM_CXSCREEN)
ScreenY = GetSystemMetrics_(#SM_CYSCREEN)
If OpenWindow(Fenetre, 0, 0, 100, 100, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "Bords 'collants'")
EndIf
Repeat
WinX = WindowX()
WinY = WindowY()
If WinX < 0
MoveWindow(0,WinY)
EndIf
If WinX < 20
MoveWindow(0,WinY)
EndIf
If WinY < 0
MoveWindow(WinX,0)
EndIf
If WinY < 20
MoveWindow(WinX,0)
EndIf
If WinX + 115 > ScreenX
MoveWindow(ScreenX - 115,WinY)
EndIf
If WinX + 115 > ScreenX - 20
MoveWindow(ScreenX - 115,WinY)
EndIf
If WinY + 125 > ScreenY
MoveWindow(WinX,ScreenY - 125)
EndIf
If WinY + 125 > ScreenY - 20
MoveWindow(WinX,ScreenY - 125)
EndIf
Until WaitWindowEvent() = #PB_Event_CloseWindow
2 - Si quelqu'un pouvait me troeuver l'ancien code.... ce serait sympa