如何编程开启和关闭windows的桌面扩展功能? ( 积分: 200 )

  • 主题发起人 主题发起人 amourz
  • 开始时间 开始时间
A

amourz

Unregistered / Unconfirmed
GUEST, unregistred user!
windows的桌面扩展功能,可以使用第2个显示器,在delphi中,如何编程开启和关闭windows的桌面扩展功能?我有个VBS脚本,可以通过模拟点击的方法实现,那么,在delphi中,如何实现呢?可以通过修改注册表实现吗?
VBS脚本如下:
Option Explicit
Dim WshShell, Dummy, Splash

On Error Resume Next

Set WshShell = WScript.CreateObject("WScript.Shell")

'Main
Call DoIt
WScript.Quit

Sub DoIt
wshshell.Run("%systemroot%/system32/control.exe desk.cpl,@0,3")

' Give Display Properties time to load
WScript.Sleep 1000
WshShell.SendKeys "2"
WScript.Sleep 10
WshShell.SendKeys "%E"
WScript.Sleep 500
WshShell.SendKeys "%A"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"

WshShell.SendKeys "{ENTER}"
End Sub 'DoIt
 
后退
顶部