MEDGUI_EXPORT and small modifs