module winex.winmm; import winex.dynloader; alias uint MMRESULT; /* error return code, 0 means no error */ instance DynFunc( Windows, MMRESULT, uint ) I_I_Ldr; instance DynFunc( Windows, DWORD ) I_V_Ldr; I_I_Ldr.fp timeBeginPeriod; I_I_Ldr.fp timeEndPeriod; I_V_Ldr.fp timeGetTime; static this() { timeBeginPeriod = I_I_Ldr.require( "winmm.dll", "timeBeginPeriod" ); I_I_Ldr.use( timeEndPeriod, "winmm.dll", "timeEndPeriod" ); I_V_Ldr.use( timeGetTime, "winmm.dll", "timeGetTime" ); }