标题:关闭时打开网页
只看楼主
my3615115
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-4-18
 问题点数:0 回复次数:0 
关闭时打开网页

以前看到教主等人编写的程序,在关闭时都会弹出一张网页,现在初学Delphi,也明白了其中的奥秘,现在演示给大家拉:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,ShellApi, Menus;

type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
MainMenu1: TMainMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ShellExecute(0,'open','iexplore.exe','http://www.msinfo.cn','',SW_SHOWNORMAL);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;

procedure TForm1.N2Click(Sender: TObject);
begin
Close;
end;

end.

[此贴子已经被作者于2007-4-19 13:53:13编辑过]

搜索更多相关主题的帖子: 网页 TMenuItem 教主 uses Forms 
2007-04-19 13:48



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-133148-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.171814 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved