windows - 整数原子的使用

标签 windows winapi dde

String Atoms在 DDE(动态数据交换)中很有用。 Integer Atoms有什么用?

最佳答案

我所知道的唯一用途是内置对话框类名称的原子编号。 MessageBox 和其他人使用#32770。这就是你用来找回窗口的东西。还有一些,我高兴地忘记了它们的数量和用法。这可以追溯到 1980 年代,即 16 位 Windows 和极端资源限制的时代。

您可以在 this answer 中看到使用此原子序号的示例代码.

    // Checks if <hWnd> is a dialog
    StringBuilder sb = new StringBuilder(260);
    GetClassName(hWnd, sb, sb.Capacity);
    if (sb.ToString() != "#32770") return true;

[编辑]
添加了一些整数原子类:

#ifndef POPUPMENU_CLASS_NAME
#define POPUPMENU_CLASS_NAME "#32768"  /* PopupMenu */
#endif
#ifndef DESKTOP_CLASS_NAME
#define DESKTOP_CLASS_NAME   "#32769"  /* Desktop */
#endif
#ifndef DIALOG_CLASS_NAME
#define DIALOG_CLASS_NAME    "#32770"  /* Dialog */
#endif
#ifndef WINSWITCH_CLASS_NAME
#define WINSWITCH_CLASS_NAME "#32771"  /* WinSwitch */
#endif
#ifndef ICONTITLE_CLASS_NAME
#define ICONTITLE_CLASS_NAME "#32772"  /* IconTitle */
#endif

关于windows - 整数原子的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15546220/

相关文章:

ruby - 通过 win32API 调用 SendInput 时这些额外参数是什么

javascript - UWP:如何在后台任务中执行操作

python - 如何连续收听DDE数据

c - 以编程方式提前确定文件 "size on disk"

c++ - 在事件查看器应用程序日志中获取错误模块 OLEACC.dll,版本 4.2.5406.0 错误?

获取本地主机名和 IP 地址的 C++ Windows 函数调用

Windows 通信的 Java 接口(interface)? (OLE、OPC、DDE)

android - 在代理上运行 Genymotion/MEmu

c++ - DirectX 9 中的简单剪辑

delphi - OpenOffice DDE 执行失败