gpt4 book ai didi

delphi - 是否可以枚举 `TDdeClientConv` 类的所有可用 DDE 服务器?

转载 作者:行者123 更新时间:2023-12-02 03:44:11 24 4
gpt4 key购买 nike

我对所有正在运行的 DDE 服务器感到好奇,尝试了 TDdeClientConv 类,但对它感到困惑(可能只是不知道如何实现),最后推出了我自己的低级(通常是应用程序)应该使用DDEML抽象层)“client”:

procedure TForm6.FormClick(Sender: TObject);
begin
{ initiate DDE conversation with all top-level windows }
SendMessage(
HWND_BROADCAST,
WM_DDE_INITIATE,
Handle,
MakeLParam(
0, // all services
0 // all topics
)
);
end;

procedure TForm6.WMDDE_Ack(var Message: TWMDDE_Ack);
begin
{ this message handler receives acknowledgements }
{ and prints service-topic pairs to console }
Writeln('"' + GetAtom(Message.App) + '"', #9, '"' + GetAtom(Message.Topic) + '"');
end;

问题:是否可以对TDdeClientConv类执行相同的操作,即发起与所有可用服务的DDE对话并接收多个确认?或者 TDdeClientConv 仅仅代表 DDE session 的客户端端点,因此我的场景超出了范围?

最佳答案

TDdeClientConv 不使用任何窗口消息,它使用 Dynamic Data Exchange Management Library (DDEML)反而。 TDdeClientConv 只能连接到实现指定服务和/或主题的单个服务器,因为它使用 DDEML DdeConnect() 建立连接。功能:

Establishes a conversation with a server application that supports the specified service name and topic name pair. If more than one such server exists, the system selects only one.

DDEML 的 DdeConnectList()另一方面,函数可以与支持给定服务和/或主题的多个服务器建立对话。

Establishes a conversation with all server applications that support the specified service name and topic name pair. An application can also use this function to obtain a list of conversation handles by passing the function an existing conversation handle. The Dynamic Data Exchange Management Library removes the handles of any terminated conversations from the conversation list. The resulting conversation list contains the handles of all currently established conversations that support the specified service name and topic name.

您可以使用 DdeQueryNextServer() 枚举该列表。和 DdeQueryConvInfo()功能。

关于delphi - 是否可以枚举 `TDdeClientConv` 类的所有可用 DDE 服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42745052/

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