I was wondering if anyone could tell me why it is this function will return an invalid handle to a window (child or parent). I wrote this code and the hCancel variable keeps returning a NULL handle. I can see no reason for it. If anyone can tell me why windows does this, please let me know. This is not the first time I have had this stupid error but it is the first time I got it from a child window. Anyways here is the code in an attached file. Any help is appreciated.