且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

创建另一个进程的 HWND 的子窗口?(例如屏幕保护程序预览)

更新时间:2023-11-14 13:10:46

你需要调用一个 win32 api.该 api 在 C 中.您需要使用互操作层来执行此操作.我认为每个选项都会很糟糕.

You need to call a win32 api. That api is in C. You'll need to the interop layer to do this. I think every option will be gross.

对于Java,我认为是JNI.有关如何执行此操作,请参阅此.

For Java, I think that is JNI. See this on how to do it.

您还需要将该值传递给 SetParent.

You will also need to pass that value to SetParent.

屏幕保护程序以与屏幕保护程序对话框相同的安全权限运行,因此这不是安全问题.

The screen saver runs at the same security rights as the screensaver dialog so this isn't a security issue.