Use a window handle as an owner for a VB6 form

别说谁变了你拦得住时间么 提交于 2019-12-23 20:52:01

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!