Add macro for generating window hint functions
Use ~str for window creation failure result