[ACCEPTED]-How to change a Window Owner using its handle-owner

Accepted answer
Score: 17

I think you're looking for is to P/Invoke 1 SetWindowLongPtr(win32window, GWLP_HWNDPARENT, formhandle)

Google Search

Score: 2

Yes! I've already have a P/Invoke import 7 of SetWindowLongPtr (which is x64 safe). And 6 using Reflector I searched upon the Form.Owner 5 property ( i.e. the get_Owner(Form value) method 4 ) and managed to change the owner with

SetWindowLongPtr(childHdl, -8, OwnerHdl)

I 3 was looking what the -8 (0xFFFFFFFFFFFFFFF8) meant 2 before I could post the solution here, but 1 Joel has already pointed it out.

Thanks!

More Related questions