Code : Tout sélectionner
Enumeration
#Window_0
#MenuBar_0
#MENU_1
#Window_1
EndEnumeration
LoadImage(0,"c:\image.bmp")
Declare Affiche_Image()
Declare Affiche_FenetreSecondaire()
Declare CallBack(Hnd,msg,wParam,lParam)
OpenWindow(#Window_0, 350, 100, 406, 580, #PB_Window_MinimizeGadget | #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered, "Fenetre principale")
CreateGadgetList(WindowID(#Window_0))
CreateMenu(#MenuBar_0, WindowID())
MenuTitle("Menu")
MenuItem(#MENU_1, "Fenetre secondaire")
SetWindowCallback(@CallBack())
Affiche_Image()
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventMenu
Select EventMenuID()
Case #MENU_1
Affiche_FenetreSecondaire()
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
Procedure Affiche_Image()
ImageGadget(0, 0, 30, 440, 440, UseImage(0))
EndProcedure
Procedure Affiche_FenetreSecondaire()
EnableWindow_(WindowID(#Window_0), 0)
OpenWindow(#Window_1, 533, 373, 282, 195, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_WindowCentered , "Meilleurs temps")
CreateGadgetList(WindowID(#Window_1))
TextGadget(#PB_Any, 10, 10, 50, 20, "TEST")
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_Event_CloseWindow
EnableWindow_(WindowID(#Window_0), 1)
CloseWindow(#Window_1)
EndProcedure
Procedure CallBack(Hnd,msg,wParam,lParam)
Resultat = #PB_ProcessPureBasicEvents
Select msg
Case #WM_PAINT
Affiche_Image()
EndSelect
ProcedureReturn Resultat
EndProcedure
ce bout de code rafraichit bien la fenetre principale lorsque l'image est alteree, mais je ne veux pas qu'il detecte d'alteration d'image lorsque j'ouvre ma fenetre secondaire.
merci pour ta patience