问题
What is the Win32 equivalant of Form2.Show vbModeless, Form1
that allows me to set the owner (not the parent) to an arbitrary hWnd and set the default position, etc?
As far as I'm aware, this can only be set when creating a window.
回答1:
I'm not sure what you are trying to accomplish, but I think you might be looking for the SetParent function.
Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
hWndChild is the handle to the child window.
hWndNewParent is the handle to the new parent. Pass null (0 if I remember correctly) to make the desktop the owner.
You can find more information about it here.
来源:https://stackoverflow.com/questions/6940874/use-a-window-handle-as-an-owner-for-a-vb6-form