format PE GUI 4.0
entry Start

include '%finc%/win32/win32a.inc'

include "%finc%/libs/msgutils.inc"
include "%finc%/libs/tform.inc"
include "%finc%/libs/parents.inc"
include "%finc%/libs/templates.inc"

include "%finc%/libs/msgutils.asm"
include "%finc%/libs/tform.asm"
include "%finc%/libs/parents.asm"
include "%finc%/libs/templates.asm"

include "MainForm.frm"

options.ShowSizes = 1


uglobal
  hInstance dd ?
  hHeap     dd ?
  hMainForm dd ?
endg



Start:
        invoke  GetModuleHandleA,0
        mov     [hInstance],eax
        invoke  GetProcessHeap
        mov     [hHeap], eax

        InitializeAll

        invoke  InitCommonControls

        stdcall CreateForm, frmMain, NULL
        xor     eax, eax
        test    ebx, ebx
        jz      .terminate

        mov     [hMainForm], ebx

.run:
        call    ProcessMessages
        jc      .terminate

        invoke  WaitMessage
        jmp     .run

.terminate:
        push    eax
        FinalizeAll
        invoke  ExitProcess ; exit code from the stack.

data import
  include "%finc%/win32/allimports.asm"
end data

IncludeAllGlobals
