dwmstatus in cpp in working order - optimisations needed