如何在启动时隐藏我的SmartDevice应用程序? [英] How to hide my SmartDevice application on startup?

查看:104
本文介绍了如何在启动时隐藏我的SmartDevice应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个 SmartDevice 应用程序,该应用程序在启动时运行,我希望在首次启动时将其隐藏。

I made a SmartDevice application that runs on startup and I want it to be hidden at first launch.

我尝试了 this.Hide() this.Visible = false ShowWindow (句柄,SW_HIDE)在表单 Load()事件和 InitializeComponent()中没有

I've tried this.Hide(), this.Visible = false and ShowWindow(Handle, SW_HIDE) in Form Load() event and InitializeComponent() with no luck.

任何帮助将不胜感激。

推荐答案

CF自动在传递给Application.Run的窗体上调用Show。没有避免对Application.Run的调用,这是无法避免的。

The CF automatically calls Show on the Form passed to Application.Run. There is no avoiding that without avoiding the call to Application.Run.

SDF有一个Application2.Run,​​它带有一个参数来告诉它不显示表单。

The SDF has an Application2.Run that takes a parameter to tell it to not show the form.

您可以通过创建自己的消息泵来做到这一点(尽管这不是一件容易的事)。

You could do the same by creating your own message pump (though it's not a straightforward thing to do).

这篇关于如何在启动时隐藏我的SmartDevice应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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