在我所有表单的 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.
然后,当用户单击跳转列表项时,将启动您的可执行文件并将您指定的参数传递给它。您需要使用 ParamCount
和 ParamStr
读取这些命令行参数,并相应地响应它们。
因为指定参数是创建任务的关键部分,AddTask
方法有一个可选参数来执行此操作。所以你可以这样做。
JumpList.AddTask(YourTasksFriendlyName, '', YourTasksArguments);
请注意,第二个参数指定了路径
,传递''
意味着您希望使用调用可执行文件的路径。
或者你可以这样做:
JumpListItem := JumpList.AddTask(YourTasksFriendlyName);
JumpListItem.Arguments := YourTasksArguments;
关于windows - JumpList 到 Delphi 上所有打开的表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34904932/