Your right I shouldn't of changed that to size_t. It needs to be %04lx. Although I've just had a look at GetCurrentThreadID and it could be broken on systems where pthread_t is a struct not an integer, (e.g. AIX). not sure AIX is to big of a worry though.