
Code : Tout sélectionner
Enumeration
#Window : #Button :#Image
EndEnumeration
Global Win_Options.l, Image0 = CatchImage(#Image, ?Image0), rc.s = Chr(13)+Chr(10)
DataSection
Image0:
IncludeBinary "c:\windows\winnt256.bmp"
EndDataSection
Procedure Fond(Win,Ima)
Fond.LOGBRUSH\lbStyle=3 : Fond\lbColor=0 : Fond\lbHatch=ImageID(Ima)
SetClassLong_(WindowID(Win),-10,CreateBrushIndirect_(Fond))
EndProcedure
Procedure.l Open_Window()
Win_Options =#PB_Window_SystemMenu|#PB_Window_ScreenCentered| #PB_Window_MaximizeGadget
Win_Options | #PB_Window_MinimizeGadget|#PB_Window_SizeGadget
OpenWindow(#Window,256,154,250,170,"Fenêtre",Win_Options)
Fond(#Window,#Image)
CreateGadgetList(WindowID(#Window))
ButtonGadget(#Button,10,20,80,30,"Test")
EndProcedure
Open_Window()
Repeat ; Start of the event loop
Event = WaitWindowEvent()
WindowID = EventWindow()
GadgetID = EventGadget()
EventType = EventType()
If Event = #PB_Event_Gadget
If GadgetID = #Button
ResizeWindow(#Window,0,0,520,350)
MessageRequester("Test","Essayez d'étirer la fenêtre !")
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
End
; IDE Options = PureBasic v4.02 (Windows - x86)
; CursorPosition = 40
; FirstLine = 29