format PE GUI 4.0
entry Start

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

include "%finc%\libs\msgutils.inc"
include "%finc%\libs\gui.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 "%finc%\libs\SplitGrid2.asm"
include "%finc%\libs\giflib.asm"
include "%lib%\graphics\rectangles.asm"

include "%lib%\freshlib.asm"

include 'actions.asm'

include 'Form1.frm'


uglobal
  hInstance       dd 0  ; Instance handle for common use.
  hHeap           dd 0

  hIml            dd 0
  hImlGray        dd 0
endg

iglobal
  cMainTitle db 'Visual test',0
endg

resAppIcon = 1
resMainToolbar = 2

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

; Init common controls
        invoke  InitCommonControls      ;Ex,ComCtrlsFlags

        InitializeAll

        stdcall CreateForm, Form1, 0
        mov     [hMainForm], ebx

;----------------------------------------------
; Main message loop
;----------------------------------------------
Run:
        call    ProcessMessages
        jc      .terminate

        invoke  SendMessageW, [hMainForm], FM_ONIDLE, 0, 0
        invoke  WaitMessage
        jmp     Run

.terminate:
        push    eax
        FinalizeAll
        invoke  ExitProcess


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


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


IncludeAllGlobals
