工程使用新的皮肤,一般情况下正常,现在使用createthread,func中调用messagebox,弹出来的对话框是系统默认皮肤而不是新的皮肤,
参数没问题,因为把messagebox放到主程序中出来的对话框是正常的。。

解决方案 »

  1.   

    messagebox();一直是系统的皮肤吧?
    APPlication.messagebox()
      

  2.   

    messagebox();是系统皮肤
    如果你想要特殊的效果的话
    你只能是自画窗体了
      

  3.   

    messagebox用在主进程是可以用新皮肤的
    用APPlication.messagebox()也没有,我怀疑用createthread后messagebox不会用主进程的工程皮肤资源了。。,因为createthread是系统api,不知道这个函数继承怎么样弄
      

  4.   

    思路:messagebox让主进程去显示,线程中使用回调函数
      

  5.   

    使用接口也行,道理是一样的,关键是MESSAGEBOX让主程序去显示
      

  6.   


    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.