本文介绍了模拟" Windows和QUOT;键和" + QUOT;键可放大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 7中(最终)还内置了屏幕缩放功能。按住Windows键,然后你可以使用+键放大, - 键缩小。因此,我一直在试图模仿这种组合。随着AutoIt的我曾尝试:

Windows 7 (finally) has built-in zoom feature for the screen. Hold down the "Windows" key and you can then use the "+" key to zoom in and the "-" key to zoom out. As a result I have been trying to simulate this combination. With AutoIt I have tried:

1)

Send("{LWINDOWN}" & "+" & "{LWINUP}")

2)

$x = Chr(43)
Send("{LWINDOWN}" & $x & "{LWINUP}")

3)

Send("#{+}") ;//works but it also sends "+" key

4)

Send("{LWINDOWN}")
Sleep(10)
Send("+",1)
Sleep(10)
Send("{LWINUP}")

这些4个步骤无工作...

其实我是想用C#的这个功能。如果我管理与AutoIt的做到这一点,我可以调用该脚本使用C#,所以我不介意langauage。我也模拟键盘按键,因为我不知道我怎么会能够使用C#进行放大。

I actually want to use this functionality on c#. If I manage to do it with autoit I could invoke that script with c# so I don't mind the langauage. I am also simulating keystrokes because I don't know how I will be able to zoom in using c#.

推荐答案

导入位于库:

然后执行:

 WindowsInput.InputSimulator.SimulateKeyDown
                          (WindowsInput.VirtualKeyCode.LWIN);
 WindowsInput.InputSimulator.SimulateKeyPress
                          (WindowsInput.VirtualKeyCode.OEM_PLUS);
 WindowsInput.InputSimulator.SimulateKeyUp
                          (WindowsInput.VirtualKeyCode.LWIN);

这篇关于模拟" Windows和QUOT;键和" + QUOT;键可放大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 01:10