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/