

If you want a license for PBDev it will be even cheaper next week.
$29 only.
See the 'side-effect' of this on the main website.
Ok. I didn't want to download it and test it because I'm not an illegal-this-that guy..Edwin Knoppert wrote:It's an older and incomplete one + my current setups require an account for downloading.
Code: Select all
Protected hWndMain.l ; First window's hWnd.
Protected MainID.l ; First window's ID.
Protected WindowID.l ; WindowID (ordinal)
Protected GadgetID.l ; GadgetID (ordinal)
Protected EventID.l ; Message type
; The first form you want to show, callback is optional.
hWndMain = PBD_CreateForm( #FORM1, @Form1_Callback() )
If hWndMain = 0: ProcedureReturn 1: EndIf
>>>
; Obtain window id, we use it during the loop.
MainID = PBD_GetWindowId( hWndMain )
; Messageloop
Repeat
; Wait on message.
EventID = WaitWindowEvent()
; Get the purebasic window id (not hWnd).
WindowID = EventWindow()
Select WindowID
Case MainID
; Form and/or gadgetevents.
Select EventID
Case #PB_Event_CloseWindow
CloseWindow( WindowID )
MainID = 0
Case #PB_Event_Menu
;Select EventMenu()
;Case 0 ; <-- Change to your Menuid like: #IDM_FORM1_EXIT
; PBD_FormClose( hWndMain )
;EndSelect
; Case #PB_Event_Gadget
; Select EventGadget()
; Case 0 ; <-- Change to your Gadgetid like: #ID_FORM1_BUTTON1
;
; Obtain eventtype for this gadget.
; ;Select EventType()
; ;Case #PB_EventType_LeftClick
;EndSelect
; EndSelect
EndSelect
EndSelect
Until MainID = 0