在Windwos中调用系统功能

对程序员而言,有一句至理名言就是:“写得好就是写得少!(Writing better is writing less)”
回答:
以下命令可以直接在Windows的运行窗口直接执行,在Delphi中你要这样使用:
winexec(Pchar(‘ABCD’),sw_Show);
其中”ABCD”代表以下命令之一:
“rundll32 shell32,Control_RunDLL” – 运行控制面板
“rundll32 shell32,OpenAs_RunDLL” – 打开”打开方式”窗口
“rundll32 shell32,ShellAboutA Info-Box” – 打开”关于”窗口
“rundll32 shell32,Control_RunDLL desk.cpl” – 打开”显示属性”窗口
“rundll32 user,cascadechildwindows” – 层叠全部窗口
“rundll32 user,tilechildwindows” – 最小化所有的子窗口
“rundll32 user,repaintscreen” – 刷新桌面
“rundll32 shell,shellexecute Explorer” – 重新运行Windows Explorer
“rundll32 keyboard,disable” – 锁写键盘
“rundll32 mouse,disable” – 让鼠标失效
“rundll32 user,swapmousebutton” – 交换鼠标按钮
“rundll32 user,setcursorpos” – 设置鼠标位置为(0,0)
“rundll32 user,wnetconnectdialog” – 打开”映射网络驱动器”窗口
“rundll32 user,wnetdisconnectdialog” – 打开”断开网络驱动器”窗口
“rundll32 user,disableoemlayer” – 显示BSOD窗口, (BSOD) = Blue Screen Of Death, 即蓝屏
“rundll32 diskcopy,DiskCopyRunDll” – 打开磁盘复制窗口
“rundll32 rnaui.dll,RnaWizard” – 运行”Internet连接向导”, 如果加上参数”/1″则为silent模式
“rundll32 shell32,SHFormatDrive” – 打开”格式化磁盘(A)”窗口
“rundll32 shell32,SHExitWindowsEx -1” – 冷启动Windows Explorer
“rundll32 shell32,SHExitWindowsEx 1” – 关机
“rundll32 shell32,SHExitWindowsEx 0” – 退当前用户
“rundll32 shell32,SHExitWindowsEx 2” Windows9x 快速重启
“rundll32 krnl386.exe,exitkernel” – 强行退出Windows 9x(无确认)
“rundll rnaui.dll,RnaDial “MyConnect” – 运行”网络连接”对话框
“rundll32 msprint2.dll,RUNDLL_PrintTestPage” – 选择打印机和打印测试页
“rundll32 user,setcaretblinktime” – 设置光标闪烁速度
“rundll32 user, setdoubleclicktime” – 测试鼠标双击速度
“rundll32 sysdm.cpl,InstallDevice_Rundll” – 搜索非PnP设备

***********************************
messagebeep(0);//声卡发出be声
windows.beep(2000,2000);//pc喇叭发出be声,很吓人//前一个是频率,后一个是延时,98下会忽略



发表评论

您的电子邮箱地址不会被公开。

42 + = 43