Win32 Wrapper not doing anything with messages

Ok, basically i'm putting together a win32 wrapper based on various tutorials I've seen.
But when I try to close it via the close buttong (top right) or via the esacpe button it doesn't do anything, with the first it closes the window but doesn't end the program, with the latter it just doesn't acknowledge a thing.