invoke CreateRectRgnIndirect, addr CaptionRect
mov hRgnCaption, eax
mov hRgnNew, eax
...
invoke DeleteObject, hRgnCaption
PrintDec eax

invoke DefWindowProc, hWnd, WM_NCPAINT, hRgnNew, lParam

invoke DeleteObject, hRgnNew
PrintDec eax

The 1st DeleteObject() is success as the eax is non-zero. However the 2nd DeleteObject fails.

Anyone knows what problem?
Posted on 2002-05-03 10:42:16 by yoursguideline
you already deleted the object hRgnNew points to because it's the same one hRgnCaption points to

you created 2 pointers to the same object, not a copy of the object
Posted on 2002-05-03 10:49:51 by Hiroshimator
Thanks for your fastest response.

Could you suggest how to copy the handler?
Posted on 2002-05-03 10:54:09 by yoursguideline
well if you need to keep using it, then skip the first DeleteObject :)
else create 2 different ones.
Posted on 2002-05-03 10:57:42 by Hiroshimator
i see.
Thanks
Posted on 2002-05-03 10:59:35 by yoursguideline
what you're doing is


mov firstvar, handletoobject
mov secondvar, handletothesameobjectasfirstvarpointsto

so that's a bit redundant. :)
Posted on 2002-05-03 11:00:50 by Hiroshimator