标题: [求助]如何通过rundll32.exe实现命令行更改桌面背景.
[打印本页]
作者: tghksj
时间: 2006-12-4 19:10
标题: [求助]如何通过rundll32.exe实现命令行更改桌面背景.
如题:
显示器
模块: desk.cpl
命令: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0
结果: 背景设置。
上面那个也不能直接改...下面却是屏保的,郁闷
模块: appwiz.cpl
命令: rundll32.exe desk.cpl,InstallScreenSaver c:\winnt\system\Flying Windows.scr
结果: 安装屏幕保护并显示预览属性页。
对于网络上可以查找到的rundll32.exe调用命令只是可以显示出某个操作界面.
对于脚本自动化没有任何作用...
关于命令行方式调用.dll函数的格式
以及支持带参调用的方式 是怎样 的资料一点也没有查到.
[
Last edited by tghksj on 2006-12-6 at 02:50 PM ]
作者: redtek
时间: 2006-12-4 21:07
兄可以参考下面贴子内容,从注册表更改桌面背景到刷新桌面到使用第三方工具都谈及了~:)
更换桌面背景
http://www.cn-dos.net/forum/view ... =%E6%A1%8C%E9%9D%A2
设置背景桌面 建立快捷方式 清空回收站 命令小工具
http://www.cn-dos.net/forum/view ... =%E6%A1%8C%E9%9D%A2
用Rundll32如何“刷新桌面”和重新加载“explorer.exe”?
http://www.cn-dos.net/forum/view ... =%E6%A1%8C%E9%9D%A2
[
Last edited by redtek on 2006-12-4 at 08:08 AM ]
作者: tghksj
时间: 2006-12-7 03:41
RE redtek :
我的设想是想利用rundll32.exe可以调用函数的功能,实现单句达到目的.
因为在user.dll中有替换桌面背景的函数,只是我在命令行中用rundll32.exe调用后
没有任何反映.
我的问题的关键不在"更换桌面背景"而在于如何通过rundll32.exe来实现.
既然rundll32.exe可以调用.dll函数,那么批处理为什么不能利用它象VB.VC的面向对象编程呢?
关于借助于第3方插件的批处理我早就已经实现并使用.借助MS的"壁纸自动换"代码如下
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
COPY bgswitch.dll %WINDIR%\SYSTEM32\
COPY bgswitch.exe %WINDIR%\SYSTEM32\
REGSVR32 /S bgswitch.dll
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Directory" /t REG_SZ /d F:\桌面背景\wallpaper /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Refresh Unit" /t REG_DWORD /d 0 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Refresh Frequency" /t REG_DWORD /d 0 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Random" /t REG_DWORD /d 0 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Disabled" /t REG_DWORD /d 0 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Force Stretch" /t REG_DWORD /d 0 /f
bgswitch
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
啊对了,谢谢你给我的那个"TGHKSJ.CMD"加的5分,呵呵:P
[
Last edited by tghksj on 2006-12-6 at 02:54 PM ]
作者: lovehack2006
时间: 2007-2-16 03:29
好东西。。。。
作者: anqing
时间: 2007-2-16 22:24
顶一下,我也想知道api的函数功能
作者: gne3
时间: 2007-2-17 01:14
ding
作者: everest79
时间: 2007-2-17 02:49
reg add "hkcu\control panel\desktop" /v TileWallpaper /d 0 /f
reg add "hkcu\control panel\desktop" /v Wallpaper /d %wallpaper% /f
reg add "hkcu\control panel\desktop" /v WallpaperStyle /d 2 /f
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
%wallpaper%为完整路径的BMP文件