有什么方法可以通过代码禁用航空捕捉吗? [英] Is there any way to disable aero snap through code?

查看:64
本文介绍了有什么方法可以通过代码禁用航空捕捉吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Visual Basic 2010应用程序,需要保持最大化.

我知道您可以通过便捷的访问中心来禁用aero snap,也可以通过编辑注册表项来禁用它.

不过,我需要通过代码完成此操作,并且仅在我的应用程序运行时,此后才能再次启用它.

编辑注册表项的问题是您必须注销然后重新启动或重新启动计算机.

如果没有其他方法,是否可以编辑注册表项并以某种方式使其处于活动状态而无需注销/登录或重新启动?

我已经在网上搜索了3天,对您的帮助将不胜感激.您的应用程序会话.这意味着您的代码将在您的代码运行时影响系统上运行的所有其他内容.这被认为是非常糟糕的做法.

我知道在应用程序上执行此操作的唯一方法是修改.EXE的快捷方式,在兼容性"选项卡上,选中禁用桌面合成".


I am writing a Visual Basic 2010 application that I need to stay maximised.

I know you can disable the aero snap through the ease of access centre and there is also a way to disable it by editing a registry key.

I need this done through code though, and just for the time that my application is running, it can be enabled again afterwards.

The problem with editing the registry key is that you have to log off and on or reboot the computer.

If there is no other way, is it posible then to edit the registry keys and somehow make it active without log off/on or restart?

I''ve been searching the web for 3 days now, any help would be appreciated!

解决方案

You cannot do that without disabling it system-wide for the life of your application session. That means what your code does will affect everything else running on the system at the time your code is running. This is considered extremely bad practice.

The only way I know of to do it on an application basis is by modifying a shortcut to your .EXE, on the Compatibility tab, check "Disable desktop composition".


这篇关于有什么方法可以通过代码禁用航空捕捉吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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