作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我的笔记本电脑上,我可以通过按 FN+F12 手动切换飞行模式,我想从 VB6 项目或 VBA 自动执行相同的操作。
我进行了大量搜索,只找到了有关启用/禁用无线适配器或使用 Windows 8 的 Sendkeys
的答案:
Dim WSh As Object
Set WSh = CreateObject("Wscript.Shell")
WSh.Run "C:\WINDOWS\system32\rundll32.exe %SystemRoot%\system32\van.dll,RunVAN", , True
Sleep 200
WSh.SendKeys " "
Sleep 1000
WSh.SendKeys "{ESC}"
但是这段代码并不可靠,我认为它不适用于 Windows 7 或 Windows 10。
所以我的问题是:有没有可靠的方法可以在 Windows 上自动切换飞行模式。
最佳答案
我的键盘上没有功能键,这还没有经过测试,只是一个想法 - 你为什么不尝试这样:
Sub SetMode()
CreateObject("Shell.Application").MinimizeAll
Application.SendKeys "{F12}" 'Try a way to refer the function key
End Sub
另一个可能的选项是这样的,具体取决于您的 Windows:
Option Explicit
Public Sub TestMe()
Application.SendKeys ("^{ESC}")
Application.Wait Now + TimeValue("00:00:01")
SendKeys ("{s}")
SendKeys ("{e}")
SendKeys ("{t}")
SendKeys ("{t}")
SendKeys ("{i}")
SendKeys ("{n}")
SendKeys ("{g}")
SendKeys ("{s}")
SendKeys "~", False
Application.Wait Now + TimeValue("00:00:01")
SendKeys ("{a}")
SendKeys ("{i}")
SendKeys ("{r}")
Application.Wait Now + TimeValue("00:00:01")
SendKeys "~", False
Application.Wait Now + TimeValue("00:00:01")
SendKeys "~", False
End Sub
~
符号用于 ENTER,ctrl+escape
模拟键盘上的 windows
键。到达所需内容后,您可以使用选项卡和箭头进行导航。
关于vba - 如何在 Windows 上自动切换飞行模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42090800/
在休眠状态挂接到我的JBoss AS 7.1之前,我试图在应用程序中运行flyway。我尝试使用@javax.ejb.Startup批注,但是在初始化Hibernate和检查数据库方案之后,此批注便会
我想将 div 移动到另一个 div 中。现在它们飞过整个页面。 我应该在代码中更改什么才能使其正常工作? $(document).ready(function() { $('.balloon')
我是一名优秀的程序员,十分优秀!