
; extended Win32 programming headers (ASCII)

format PE GUI 4.0

include '%fasminc%/win32a.inc'

include '%fasminc%/macro/if.inc'

addr equ
ADDR equ

macro pushd arg
 { if _#arg in <_addr arg,_ADDR arg>
    local ..opcode,..address
    virtual at 0
     label ..address at arg
     mov eax,dword [..address]
     load ..opcode from 0
    end virtual
    if ..opcode = 0A1h
     push arg
    else
     lea edx,[..address]
     push edx
    end if
   else if arg eqtype ""
    local ..continue
    call ..continue
    db arg,0
    ..continue:
   else
    push arg
   end if }

macro .data { section '.data' data readable writeable }

macro .code { section '.text' code readable executable }

macro .end label
 {
   entry label

   section '.idata' import data readable writeable

     library kernel32,'KERNEL32.DLL',\
	     user32,'USER32.DLL',\
	     gdi32,'GDI32.DLL',\
	     advapi32,'ADVAPI32.DLL',\
	     comctl32,'COMCTL32.DLL',\
	     comdlg32,'COMDLG32.DLL',\
	     shell32,'SHELL32.DLL',\
	     wsock32,'WSOCK32.DLL'

     include '%fasminc%/apia/kernel32.inc'
     include '%fasminc%/apia/user32.inc'
     include '%fasminc%/apia/gdi32.inc'
     include '%fasminc%/apia/advapi32.inc'
     include '%fasminc%/apia/comctl32.inc'
     include '%fasminc%/apia/comdlg32.inc'
     include '%fasminc%/apia/shell32.inc'
     include '%fasminc%/apia/wsock32.inc'
 }
