windows - JumpList 到 Delphi 上所有打开的表单

标签 windows delphi

在我所有表单的 OnCreate 事件中,我将它们的名称添加到 JumpList

var
  i: Integer;
begin
  if JumpList = nil then
    JumpList := TJumpList.Create(Application);
  JumpList.TaskList.Clear;
  for i := 0 to OpenForms.Count - 1 do
    JumpList.AddTask(OpenForms[i].Caption);
  JumpList.UpdateList;
  JumpList.Enabled := true;
end;

我想显示在跳转列表中调用时单击的表单。

我知道我应该阅读 Windows 随应用程序的新实例发送的消息,但我找不到任何说明它发送的消息类型的文档。

只需要知道在哪里可以找到我想要的消息。

谢谢

最佳答案

当您调用 AddTask 时,将返回一个 TJumpListItem 实例。你应该设置 Arguments该实例的属性。

Description

String with the command-line arguments for the executable of your item.

When the user selects your item, Windows calls the executable at Path and passes that executable the content of Arguments as arguments.

然后,当用户单击跳转列表项时,将启动您的可执行文件并将您指定的参数传递给它。您需要使用 ParamCountParamStr 读取这些命令行参数,并相应地响应它们。

因为指定参数是创建任务的关键部分,AddTask方法有一个可选参数来执行此操作。所以你可以这样做。

JumpList.AddTask(YourTasksFriendlyName, '', YourTasksArguments);

请注意,第二个参数指定了路径,传递'' 意味着您希望使用调用可执行文件的路径。

或者你可以这样做:

JumpListItem := JumpList.AddTask(YourTasksFriendlyName);
JumpListItem.Arguments := YourTasksArguments;

关于windows - JumpList 到 Delphi 上所有打开的表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34904932/

相关文章:

windows - wscript exec cmd.exe/c不报错

windows - 是否可以在同一应用程序中使用两个不同版本的OpenSSL库?

.net - 从 Perl 调用 .NET

delphi - 在 TEasyListView 中创建列

database - Delphi + SQLite + DB Express select 参数错误

c++ - 使用 API WideChartoMultibyte 将日语字符从宽字符转换为多字节给出 '????'

python - 在 Windows 上将 msi 文件安装到 virtualenv pythons

delphi - 摘要 pdf 使用 Delphi 更改纸张大小

德尔福编码标准

android - DELPHI XE5 Android - 从 SDCard 保存/加载文件