我想在我在RAD Studio XE7制作的程序中添加两个按钮:
我该怎么做?
PS:我尝试使用ShellExecute作为URL,但它返回以下错误消息:[dcc32错误] Main.pas(44):E2003 Undeclared标识符:' ShellExecute'。
答案 0 :(得分:1)
uses ShellAPI;
// this opens a URL in the default browser
url := 'http://www.stackoverflow.com';
ShellExecute(HInstance, 'open', PChar(url), nil, nil, SW_NORMAL);
// this opens any file with the default program assigned to that extension
pdf := 'c:\data\stackoverflow.pdf';
ShellExecute(HInstance, 'open', PChar(pdf), nil, nil, SW_NORMAL);