-
CreateWindowEx(...) help
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.
:D
-
I don't think that there is any window class called 'CancelButton'. Why don't you just use the 'button' window class.
-
P.S. GetLastError() and FormatMessage() are your friends.
-
Review the CreateWindowEx() function. The second parameter is a registered Windows class. Unless you have previously registered a class called "CancelButton", windows will not find it and correctly fail. I suspect you want "button" in there.
-
I changed the "Cancel Button" to just "button" and it works fine now..... so I take it there is a class called button?
Thanks for all the help guys. it is appreciated.