without warning
object jk
atom arg, t1, t2, speed, diff
include machine.e
include dll.e

arg=allocate(8)
constant
kernel=open_dll("kernel32.dll"),
ctr=define_c_func( kernel,"QueryPerformanceCounter",{C_INT},C_INT),
freq=define_c_func( kernel,"QueryPerformanceFrequency",{C_INT},C_INT)
jk=c_func(freq,{arg})
if jk = 0 then
printf(1,"%s\n",{"...OOPS,NO COUNTER FOUND !"})
else
speed=peek4u(arg)
jk=c_func(ctr,{arg})
t1=peek4u(arg)
end if

include win32lib.ew

constant SimpleWin =  
    create( Window, "..using Win32lib", 0, Default, Default, 200, 150, 0 ),

    ExitMenu = create( Menu, "E&xit", SimpleWin, 0, 0, 0, 0, 0 ), 
    ExitNow = create(MenuItem,"Now!", ExitMenu, 0, 0, 0, 0, 0),

    AboutBox = create( PushButton, "About", SimpleWin, 10, 10, 50, 25, 0 ),
    SpText = create( LText, "" , SimpleWin, 5, 50, 180, 40, 0)
--------

procedure onButton_About(atom self, atom event, sequence params)
object jk

    jk = message_box("...it's GREAT !", "* Euphoria *", 0 )
end procedure
setHandler( AboutBox, w32HClick, routine_id("onButton_About") )

--------

procedure onMenu_Exit(atom self, atom event, sequence params)
    closeWindow( SimpleWin )
end procedure
setHandler( ExitNow, w32HClick, routine_id("onMenu_Exit") )

jk=c_func(ctr,{arg})
t2=peek4u(arg)
diff=t2-t1
setText(SpText,sprintf("program time = %.8f sec.",{(diff/speed)}))

-- go ahead, run the window ! --
WinMain( SimpleWin,Normal )
--------------------------------
