Thanks for the update Eri. That's a neat way and not obvious from what documentation I've read.
Ok but I didn't use dynamic allocation to mimic your example but because the help I read for GetWindowRect specified LPRECT (and I didn't see any use of "RECT and &rect")
Originally Posted by Eri523
I did have the following in my original Win32::GetWindowRect
For some reason I didn't use it but can't now remember why... Am I right in thinking this would be ok from the GC POV?
System::Drawing::Rectangle^ nrect = gcnew System::Drawing::Rectangle(rect->left,rect->top,rect->right-rect->left,rect->bottom-rect->top);