如何使用其句柄更改窗口所有者 [英] How to change a Window Owner using its handle

查看:127
本文介绍了如何使用其句柄更改窗口所有者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为另一个外部应用程序(不是与.NET相关的纯Win32)制作一个.NET窗体作为TopMost窗体,以便它保持在该Win32App之上,而不是其余正在运行的应用程序.

I want to make a .NET Form as a TopMost Form for another external App (not .NET related, pure Win32) so it stays above that Win32App, but not the rest of the apps running.

我具有Win32App的句柄(由Win32App本身提供),并且我已经尝试 P/在C#中调用,但是后来我的.NET窗体被限制在Win32App中,那不是我想要的.

I Have the handle of the Win32App (provided by the Win32App itself), and I've tried Win32 SetParent() function, via P/Invoke in C#, but then my .NET Form gets confined into the Win32App and that's not what I want.

推荐答案

我认为您要查找的是P/Invoke SetWindowLongPtr(win32window, GWLP_HWNDPARENT, formhandle)

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

Google搜索

这篇关于如何使用其句柄更改窗口所有者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆