摘要载入中… 请稍等…
内容载入中… 请稍等…
| ◎→ | 本类最新 |
| 得到已安装的应用程序列表 创建“控制面板”的新项目 程序删除自身 得到Windows用户名和序列号 得到Win9X里缓存中的密码 从文件中获取最后一次访问信息 得到文件的版本信息程序 动态调整显示器的分辨率 防止关闭windows 改变文件的属性 |
|
| ◎→ | 相关资源 |
| VB窗体文章 HTML入门教程 JavaScript入门教程 VbScript入门教程 ASP.net入门教程 C语言入门教程 Deiphi实例教程 Deiphi窗体文章 Deiphi数据库编程 Deiphi网络编程 |
|
| ◎→ | 热门资源 |
| 得到已安装的应用程序列表 定制系统菜单 SEO实践增加外链方法 不用注册新部件就能增加新的方法 不用MediaPlayer播放Midi 从实作标题栏按钮开始浅谈组件的 从实作标题栏按钮开始浅谈组件的 “Delphi 书评” 为Delphi程序添加自动滚动的工具 实现应用程序的文件拖放功能 |
|
//主要思路:在另个个线程查找到该消息框,然后发WM_CLOSE消息
//为区别是其他的程序的消息框,我在提示的标题上多了一个空格,其实也可以用其他的办法。
//原码如下:
var myclose:tcloseother;
begin
myclose:=tcloseother.Create(false);
myclose.FreeOnTerminate:=true;
application.MessageBox('程序已经运行!','消息提示 ',mb_ok+mb_iconinformation);
end;
unit closeother;
interface
uses
Classes,messages,sysutils,windows,forms;
type
tcloseother = class(TThread)
private
{ Private declarations }
protected
procedure Execute; override;
public
//procedure create(myhwnd:integer);
end;
implementation
{ Important: Methods and properties of objects in VCL can only be used in a
method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure tcloseother.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ tcloseother }
//procedure tcloseother.create(myhwnd: integer);
//begin
//end;
procedure tcloseother.Execute;
const
NumSec=5; //设置5秒后自动关闭
var
messagehwnd:integer;
starttime:tdatetime;
begin
StartTime := now;
repeat
Application.ProcessMessages;
until Now > StartTime + NumSec * (1/24/60/60);
messagehwnd:=FindWindow(nil,'消息提示 ');
postmessage(messagehwnd,wm_close,0,0);
end;
end.
| 链 接 |
| 芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们 |