API 操作心得

var
hDesktop: THandle;
begin
if stProgram[tmpint] = 'Dos' then
ShellExecute(0, 'open', 'cmd', nil, nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '我的电脑' then
ShellExecute(0, 'open', 'explorer.exe', '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}', nil, SW_NORMAL);
if stProgram[tmpint] = '资源管理器' then
ShellExecute(0, 'open', 'explorer.exe', nil, nil, sw_normal);
if stProgram[tmpint] = '记事本' then
ShellExecute(0, 'open', 'notepad', nil, nil, sw_normal);
if stProgram[tmpint] = '注册表' then
ShellExecute(0, 'open', 'regedit', nil, nil, sw_normal);
if stProgram[tmpint] = '计算器' then
ShellExecute(0, 'open', 'calc', nil, nil, sw_normal);
if stProgram[tmpint] = '画笔' then
ShellExecute(0, 'open', 'msPaint', nil, nil, sw_normal);
if stProgram[tmpint] = '重启' then ShutDown(4);
if stProgram[tmpint] = '关机' then ShutDown(5);
if stProgram[tmpint] = '注销' then ShutDown(2);
if stProgram[tmpint] = '控制面板' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL ', nil, sw_normal);
if stProgram[tmpint] = '辅助功能选项' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL access.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '添加和删除程序' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL appwiz.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '显示属性' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL desk.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '区域选项' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL intl.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '游戏控制器' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL joy.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '鼠标属性' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL main.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '声音和多媒体属性' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL mmsys.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '调制解调器' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL modem.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '系统特性' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL sysdm.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '时间日期属性' then
ShellExecute(0, 'open', 'rundll32.exe', 'shell32.dll,Control_RunDLL timedate.cpl', nil, SW_SHOWNORMAL);
if stProgram[tmpint] = '屏幕保护' then
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_SCREENSAVE, 0);
if stProgram[tmpint] = '隐藏桌面' then
begin
hDesktop := FindWindow('Progman', nil);
ShowWindow(hDesktop, SW_HIDE);
end;
if stProgram[tmpint] = '显示桌面' then
begin
hDesktop := FindWindow('Progman', nil);
ShowWindow(hDesktop, SW_SHOW);
end
else
ShellExecute(0, 'open', pchar(stProgram[tmpint]), nil, nil, sw_normal);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值