⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usendmessagethread.pas

📁 多数代码可以直接在Delphi6和Delphi7环境下运行。部分涉及.NET技术内容的代码
💻 PAS
字号:
unit uSendMessageThread;

interface

uses
  Classes, Windows, Controls;

type
  TSendMessage = class(TThread)
  private
    { Private declarations }
  protected
    procedure Execute; override;
  end;

implementation

uses fmMain;

{ Important: Methods and properties of objects in visual components can only be
  used in a method called using Synchronize, for example,

      Synchronize(UpdateCaption);

  and UpdateCaption could look like,

    procedure SendMessage.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ SendMessage }

procedure TSendMessage.Execute;
begin
  { Place thread code here }
  while (not Terminated) do
    SendMessage(Form1.btnTriiger.Handle, CN_COMMAND, 0, 0);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -