Je souhaite déplacer cette petite fenêtre a l'aide des 4 boutons flèche. de 1 pixel a la fois.En vertical tous est oK. Mais en horizontal j'ai un résultat plutôt étrange.
Faite un éssai. J'ai peu-être trop fumé la moquette de mon bureau
Code : Tout sélectionner
OpenWindow(165,0,0,80,80,"",#PB_Window_BorderLess|#WS_SIZEBOX|#PB_Window_ScreenCentered)
StickyWindow(165,#True)
WID=WindowID(165)
SetWindowLongPtr_(WID,#GWL_EXSTYLE,GetWindowLongPtr_(WID,#GWL_EXSTYLE) | #WS_EX_LAYERED)
SetLayeredWindowAttributes_(WID,0,100,#LWA_ALPHA)
AddKeyboardShortcut(165,#PB_Shortcut_Up,1)
AddKeyboardShortcut(165,#PB_Shortcut_Down,2)
AddKeyboardShortcut(165,#PB_Shortcut_Left,3)
AddKeyboardShortcut(165,#PB_Shortcut_Right,4)
; Boucle générale
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Menu
Select EventMenu()
Case 1
ResizeWindow(165,#PB_Ignore,WindowY(165)-1,#PB_Ignore,#PB_Ignore)
Case 2
ResizeWindow(165,#PB_Ignore,WindowY(165)+1,#PB_Ignore,#PB_Ignore)
Case 3
ResizeWindow(165,WindowX(165)-1,#PB_Ignore,#PB_Ignore,#PB_Ignore)
Case 4
ResizeWindow(165,WindowX(165)+1,#PB_Ignore,#PB_Ignore,#PB_Ignore)
EndSelect
EndSelect
Until EventID=#PB_Event_CloseWindow
End