将命令行工具的窗口重定向到您的应用程序 (Windows)
有没有一种方法(在 Windows XP+ 上)将由 CreateProcess 创建的进程创建的窗口的输出重定向到您自己的程序的窗口?
我想为 ffplay.exe 制作一个更好的 GUI,它是一个开源视频播放器。它是一个命令行工具,可打开一个简单的窗口,在其中播放视频。我可以“捕获”这个窗口并以某种方式在我自己的程序中显示输出吗?
感谢您提供的任何提示。
is there a way (on Windows XP+) to redirect the output of a window created by a process created with e.g. CreateProcess to a window of your own program?
I'd like to make a nicer GUI for ffplay.exe which is an open source video player. It is a command line tool, which opens a simple window in which it plays back the video. Can I "capture" this window and display the output in my own program somehow?
Thanks for any hints you can provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从这个开始。然后设置一个计时器。我意识到这不是您想要的,但我认为您需要一个内核驱动程序来完成无缝视频捕获。我怀疑人们卖东西就是为了这个。我认为这(带有计时器)是您在用户空间中获得的最好的。
Start with this. Then set a timer. I realize that it isn't what you want, but I think that you need a kernel driver to accomplish seamless video capture. I suspect that people sell things for this. I think this (with a timer) is the best you will get in user space.
您可能最好简单地获取视频输出的 HWND(使用 EnumWindows() 和 GetWindowThreadProcessId() 来查找属于您的应用程序正在启动的 ffplay.exe 进程的所有 HWND),然后将其重新定位在范围内根据需要使用 SetWindowPos() 或 MoveWindow() 创建您自己的 UI。由于进程边界的原因,您实际上无法使视频 HWND 成为 UI 窗口的子级,但是随着您自己的 UI 移动而移动视频 HWND 可以实现几乎相同的效果。
You are probably best off simply obtaining the HWND of the video output (use EnumWindows() and GetWindowThreadProcessId() to locate all of the HWNDs that belong to the ffplay.exe process your app is launching) and then re-position it within the confines of your own UI using SetWindowPos() or MoveWindow() as needed. You can't actually make the video HWND be a child of your UI's windows because of the process boundaries, but moving the video HWND around as your own UI moves around accomplishes almost the same effect.