Assorted cut and paste fodder for messing with some syscall / USER / GDI stuff from Ruby.