je souhaite mettre une fenêtre qui est cachée sous une autre au premier plan.
j'ai trouvé ça mais c'est pas top :
il faut lancer le code, mettre une fenêtre devant la fenêtre de test (l'éditeur de pb par exemple) et appuyé sur ALT + A pour mettre la fenêtre au premier
Code : Tout sélectionner
OpenWindow(0, 0, 0, 200, 200, #PB_Window_ScreenCentered, "Test")
If CreateGadgetList(WindowID())
TextGadget(1, 5, 5, 150, 15, "")
EndIf
#HotKeyID = 45
; On associe un touche au programme
; Ici la touche "Alt + A"
RegisterHotKey_(WindowID(0), #HotKeyID, #MOD_ALT, #PB_Shortcut_A)
Repeat
Event = WaitWindowEvent()
If Event = #WM_HOTKEY ; Si on appui sur une touche de raccourci
If EventwParam() = #HotKeyID ; Si on a appuyé sur la touche #HotKeyID qui correpond ici à "Alt + A"
SetGadgetText(1, "Touche appuyée") ; On change le texte
; On met la fenêtre au premier plan
SetWindowPos_(WindowID(0), -1, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)
SetWindowPos_(WindowID(0), 0, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)
; ShowWindow_(WindowID(0), #SW_SHOWNORMAL | #SW_RESTORE) ; Marche pas
; BringWindowToTop_(WindowID(0)) ; Marche pas
EndIf
EndIf
Until Event = #WM_CLOSE
UnregisterHotKey_(WindowID(0), #HotKeyID)
c'est moi qui suit nul ou bien ?