gpt4 book ai didi

inno-setup - 在 Inno Setup 中复制到剪贴板

转载 作者:行者123 更新时间:2023-12-01 00:52:45 27 4
gpt4 key购买 nike

有没有办法使用 Inno Setup 将字符串复制到剪贴板?

我需要实现一个按钮来将字段的内容复制到剪贴板。

最佳答案

是的,您可以发送 WM_COPY 信息。例如:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Code]
const
WM_COPY = $0301;

var
EditToCopy: TNewEdit;

procedure CopyToClipboard(Control: TWinControl);
begin
SendMessage(Control.Handle, WM_COPY, 0, 0);
end;

procedure ButtonCopyClick(Sender: TObject);
begin
EditToCopy.SelectAll;
CopyToClipboard(EditToCopy);
end;

procedure InitializeWizard;
var
ButtonCopy: TNewButton;
WizardPage: TWizardPage;
begin
WizardPage := CreateCustomPage(wpWelcome, 'Caption', 'Description');
EditToCopy := TNewEdit.Create(WizardForm);
EditToCopy.Parent := WizardPage.Surface;
EditToCopy.Text := 'Text to copy';
ButtonCopy := TNewButton.Create(WizardForm);
ButtonCopy.Parent := WizardPage.Surface;
ButtonCopy.Caption := 'Copy';
ButtonCopy.Top := EditToCopy.Top + EditToCopy.Height + 8;
ButtonCopy.OnClick := @ButtonCopyClick;
end;

关于inno-setup - 在 Inno Setup 中复制到剪贴板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30105463/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com