摘錄: 啟動外部程式使用的函數 -- ShellExecute -- 引用單元ShellAPI
来源:互联网 发布:个股期权软件 编辑:程序博客网 时间:2024/04/28 03:25
啟動外部程式, 可以使用函數Winexec、ShellExecute和ShellExecuteEx。
函數ShellExecute 相對靈活簡單。示例如下:
1 啟動一個程式
ShellExecute(Handle,'open',PChar('c: estapp.exe'),nil,nil,SW_SHOW);
2 啟動記事本 (因為記事本在系統路徑下,所以不必寫完整的路徑名了):
ShellExecute(Handle, 'open', PChar('notepad'),nil, nil, SW_SHOW);
3 啟動記事本並載入一個純文字檔案:
ShellExecute(Handle, 'open', PChar('notepad'),PChar('c:/readme.txt'), nil, SW_SHOW);
4 使用記事本打開一個純文字檔案 (請確定*.txt文件被關聯到記事本):
ShellExecute(Handle, 'open', PChar('c:/readme.txt'),nil, nil, SW_SHOW);
5 使用默認流覽器打開網址:
ShellExecute(Handle, 'open', PChar('http://www.festra.com/'),nil, nil, SW_SHOW);
6 列印一個檔:
ShellExecute(Handle, 'print', PChar('c:/readme.txt'),nil, nil, SW_SHOW);
7 用Windows Explorer打開一個檔夾:
ShellExecute(Handle, 'explore', PChar('c:/windows)',nil, nil, SW_SHOW);
8 運行一個DOS命令並立即返回:
ShellExecute(Handle, 'open', PChar('command.com'),PChar('/c copy file1.txt file2.txt'), nil, SW_SHOW);
9 運行一個DOS命令並保持DOS視窗打開 ("stay in DOS"):
ShellExecute(Handle, 'open', PChar('command.com'),PChar('/k dir'), nil, SW_SHOW);
- 摘錄: 啟動外部程式使用的函數 -- ShellExecute -- 引用單元ShellAPI
- delphi shellapi 的使用
- vc中ShellExecute的使用(调用外部程序)
- ShellExecute的使用
- ShellExecute使用的特殊性
- ShellExecute的使用
- ShellExecute 的使用
- delphi 啟動外部程式(收藏參考)
- shellapi
- shellapi
- [delphi]ShellExecute函數的用法
- 调用API要引用Shellapi单元
- 使用 ShellExecute 的一些技巧
- Delphi下的ShellExecute使用
- ShellExecute, WinExec, CreateProcess的使用
- ShellExecute使用
- ShellExecute使用
- ShellExecute使用
- 视频监控软件开发的需求管理
- 操作系统&浏览器发音_linux-ubuntu 你读错了吗?
- 下载积分
- struts2 配置
- JS在IE与firefox下用法之区别
- 摘錄: 啟動外部程式使用的函數 -- ShellExecute -- 引用單元ShellAPI
- s3c2440启动文件详细分析
- linux socket 例子
- 每类取前五
- SQL Server 优化存储过程的七种方法
- 位图的保存
- 万年历程序debug遇到的奇怪现象
- 思想培养例子
- 为了积分