我的程序如何在后台继续工作? [英] How do I my program's keep working in the background?

查看:96
本文介绍了我的程序如何在后台继续工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在开发Windows 8程序。我的节目播放视频。当我最小化(Windows键+ D || Alt + Tab)我的程序并再次打开后我希望继续。但它重新启动。我需要程序继续前进。我怎么才能做到?

提前谢谢。

Hi,
I am developing windows 8 program. My program plays video. When i minimized(Windows key + D || Alt + Tab ) my program and click to open again After I was hoping to continue. But it restarts. I need program's keep going. How can I make it?
Thanks in advance.

推荐答案

将处理程序连接到 暂停 [ ^ ] 事件以及何时触发存储视频的当前位置。

当应用程序恢复时,读取该值并在恢复视频播放之前寻找该位置。



双方都有事件发生(几乎) Windows 8应用程序的应用程序生命周期中的每个州[< a href =http://msdn.microsoft.com/en-us/library/windows/apps/hh464925.aspxtarget =_ blanktitle =New Window> ^ ],听他们相应的反应是关键。



希望这会有所帮助,

Fredrik
Wire up a handler to the Suspending[^] event and when that fires store the current position of the video.
When the application is resumed, read that value and seek to that position before resuming video playback.

There are events firing on both sides of (almost) every state in the application lifecycle of Windows 8 apps[^], listening to them and reacting accordingly is key.

Hope this helps,
Fredrik


这篇关于我的程序如何在后台继续工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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