format PE GUI 4.0
entry Start

include "%lib%\freshlib.inc"
LIB_MODE equ OLD

include "%finc%\libs\msgutils.inc"
include "%finc%\libs\tform.inc"
include "%finc%\libs\templates.inc"

include "%finc%\libs\msgutils.asm"
include "%finc%\libs\gui.asm"
include "%finc%\libs\tform.asm"
include "%finc%\libs\templates.asm"

include "%lib%\freshlib.asm"

include "MainForm.frm"

uglobal
  hInstance dd ?
  hMainForm dd ?
endg

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

        InitializeAll

        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


data resource from 'resources/planets.res'
end data

IncludeAllGlobals
