多线程与Messagebox,vcl皮肤 工程使用新的皮肤,一般情况下正常,现在使用createthread,func中调用messagebox,弹出来的对话框是系统默认皮肤而不是新的皮肤,参数没问题,因为把messagebox放到主程序中出来的对话框是正常的。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 messagebox();一直是系统的皮肤吧?APPlication.messagebox() messagebox();是系统皮肤如果你想要特殊的效果的话你只能是自画窗体了 messagebox用在主进程是可以用新皮肤的用APPlication.messagebox()也没有,我怀疑用createthread后messagebox不会用主进程的工程皮肤资源了。。,因为createthread是系统api,不知道这个函数继承怎么样弄 思路:messagebox让主进程去显示,线程中使用回调函数 使用接口也行,道理是一样的,关键是MESSAGEBOX让主程序去显示 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, WinSkinData, StdCtrls;const SX_SHOWMSG=WM_USER+100;type TForm1 = class(TForm) skndt1: TSkinData; btn1: TButton; procedure btn1Click(Sender: TObject); private procedure ShowMsg(var Msg:TMessage);message SX_SHOWMSG; public end; TestThread = class(TThread) private MainHandle:THandle; MyMsg:array[0..99] of Char; protected procedure Execute; override; public constructor Create(H:THandle); end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.btn1Click(Sender: TObject);begin TestThread.Create(Handle);end;{ TestThread }constructor TestThread.Create(H:THandle);begin MainHandle:=H; inherited Create(False);end;procedure TestThread.Execute;begin inherited; StrPCopy(MyMsg,'呵呵'); SendMessage(MainHandle,SX_SHOWMSG,Integer(@MyMsg),0);end;procedure TForm1.ShowMsg(var Msg:TMessage);begin Application.MessageBox(PChar(Msg.WParam), '提示', MB_OK + MB_ICONSTOP);end;end. 求一个delphi语句 自带的MediaPlayer组件,播放有些Mp3文件,没有声音,该如何解决,急!!! 急死了:程序打包安装后出现的怪问题!! DELPHI 中的简单问题,关于循环???? 谁能帮我编写一个使用16进制数进行相加并得出最后一位作为校验和的程序 线程类中使用其他类的变量不能赋值 数据库提取数据N多问题 关于DELPHI中的DBGRID控件 有谁用过DevExpress控件,帮帮我?这也许和DataSet有关,大家请进…… 请问delphi中怎样读出指定目录下的xml文件? 怎樣看sql語句,兄台。 ***怎么样才能读到IC卡的卡号啊*****
APPlication.messagebox()
如果你想要特殊的效果的话
你只能是自画窗体了
用APPlication.messagebox()也没有,我怀疑用createthread后messagebox不会用主进程的工程皮肤资源了。。,因为createthread是系统api,不知道这个函数继承怎么样弄
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, WinSkinData, StdCtrls;const SX_SHOWMSG=WM_USER+100;
type
TForm1 = class(TForm)
skndt1: TSkinData;
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
procedure ShowMsg(var Msg:TMessage);message SX_SHOWMSG;
public end;
TestThread = class(TThread)
private
MainHandle:THandle;
MyMsg:array[0..99] of Char;
protected
procedure Execute; override;
public
constructor Create(H:THandle);
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.btn1Click(Sender: TObject);
begin
TestThread.Create(Handle);
end;{ TestThread }constructor TestThread.Create(H:THandle);
begin
MainHandle:=H;
inherited Create(False);
end;procedure TestThread.Execute;
begin
inherited;
StrPCopy(MyMsg,'呵呵');
SendMessage(MainHandle,SX_SHOWMSG,Integer(@MyMsg),0);
end;
procedure TForm1.ShowMsg(var Msg:TMessage);
begin
Application.MessageBox(PChar(Msg.WParam), '提示', MB_OK + MB_ICONSTOP);
end;end.