请教关于"ShellExcute"这个API函数的使用实例 请教关于"ShellExcute"这个API函数的使用实例,主要是想知道它的参数的数据类型,帮助文件所讲的都是C++的变量类型,由于我刚接触delphi,所以不知道如何调用API 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 确保把ShellApi添加到你的Unit文件的uses语句中。--------------------打开notebook.exeuses ShellApi;...ShellExecute(Handle, ’open’, ’c:\Windows\notepad.exe’, nil, nil, SW_SHOWNORMAL);--------------------用记事本打开扩展名为txt的文件。ShellExecute(Handle,’open’, ’c:\windows\notepad.exe’,’c:\SomeText.txt’, nil, SW_SHOWNORMAL);--------------------显示DelphiDownlaod文件夹内容。ShellExecute(Handle,’open’, ’c:\DelphiDownload’, nil, nil, SW_SHOWNORMAL);--------------------通过扩展来执行一个文件ShellExecute(Handle, ’open’,’c:\MyDocuments\Letter.doc’,nil,nil,SW_SHOWNORMAL);--------------------用默认网页浏览器打开web站点或*.htm文件ShellExecute(Handle, ’open’, ’http://delphi.about.com’,nil,nil, SW_SHOWNORMAL);--------------------发送一带有标题和消息主题的E-mailvar em_subject, em_body, em_mail : string;begin em_subject := ’This is the subject line’; em_body := ’Message body text goes here’; em_mail := ’mailto:[email protected]?subject=’ + em_subject + ’&body=’ + em_body ; ShellExecute(Handle,’open’, PChar(em_mail), nil, nil, SW_SHOWNORMAL);end; 1.将ShellApi添加到你的Unit文件的uses语句中;2.shellexecute(self.hand,'open',pchar('要打开发文件的路径和名称'),nil,nil,Sw_shownormal); 参数说明:1.Thandle;2.String;3.Pchar(字符串指针);4.常量(参数)5.常量(默认目录)6.常量(显示窗口的模式) 如何让程序记下第一次运行时用户手工设置的值?因为只有很少的信息需记录,所以不想用ini文件的方法,可以实现吗? 使用重叠IO处理UDP接收的时候,WSARecvFrom返回10014的错误。请高手指教 [请教]在DELPHI中怎样控制网页中下拉列表的选择... 数据库字段操作! 求加密算法 MD5 和 RSA 的源代码 数据库高手请关注, 解决就给分 在线等待!!!!!!!!!!!!! 置疑 成长的步伐 怎么在一个string 类型的字符串内确定一个单词的位置? 怎么样获取程序执行的当前路径呀? 请问如何在一个窗体中画出一个动态的正弦曲线? fastReport中如何实现多页打印?
--------------------
打开notebook.exe
uses ShellApi;
...
ShellExecute(Handle, ’open’,
’c:\Windows\notepad.exe’, nil, nil, SW_SHOWNORMAL);
--------------------
用记事本打开扩展名为txt的文件。
ShellExecute(Handle,’open’,
’c:\windows\notepad.exe’,’c:\SomeText.txt’,
nil, SW_SHOWNORMAL);
--------------------
显示DelphiDownlaod文件夹内容。
ShellExecute(Handle,’open’,
’c:\DelphiDownload’,
nil, nil, SW_SHOWNORMAL);
--------------------
通过扩展来执行一个文件
ShellExecute(Handle, ’open’,
’c:\MyDocuments\Letter.doc’,nil,nil,SW_SHOWNORMAL);
--------------------
用默认网页浏览器打开web站点或*.htm文件
ShellExecute(Handle, ’open’,
’http://delphi.about.com’,nil,nil, SW_SHOWNORMAL);
--------------------
发送一带有标题和消息主题的E-mail
var em_subject, em_body, em_mail : string;
begin
em_subject := ’This is the subject line’;
em_body := ’Message body text goes here’;
em_mail := ’mailto:[email protected]?subject=’ + em_subject + ’&body=’ + em_body ;
ShellExecute(Handle,’open’,
PChar(em_mail), nil, nil, SW_SHOWNORMAL);
end;
2.shellexecute(self.hand,'open',pchar('要打开发文件的路径和名称'),nil,nil,Sw_shownormal);
1.Thandle;
2.String;
3.Pchar(字符串指针);
4.常量(参数)
5.常量(默认目录)
6.常量(显示窗口的模式)